-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathtests.sass
More file actions
332 lines (259 loc) · 5.98 KB
/
tests.sass
File metadata and controls
332 lines (259 loc) · 5.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
// Sass (indented syntax) Example File
// This file demonstrates the full syntax capabilities
// Module imports
@use "sass:math"
@use "sass:color"
@use "sass:list"
@use "sass:map"
// Variables
$primary-color: #3498db
$secondary-color: #2ecc71
$font-stack: 'Helvetica Neue', Arial, sans-serif
$base-font-size: 16px
$spacing-unit: 8px
// Maps
$breakpoints: (small: 576px, medium: 768px, large: 992px, xlarge: 1200px)
$theme-colors: (primary: $primary-color, secondary: $secondary-color, success: #27ae60, danger: #e74c3c, warning: #f39c12, info: #3498db)
// Functions
@function px-to-rem($px, $base: $base-font-size)
@return math.div($px, $base) * 1rem
@function spacing($multiplier: 1)
@return $spacing-unit * $multiplier
@function color-contrast($color)
$luminance: color.lightness($color)
@if $luminance > 50%
@return #000
@else
@return #fff
// Mixins
@mixin flex-center
display: flex
align-items: center
justify-content: center
@mixin size($width, $height: $width)
width: $width
height: $height
@mixin respond-to($breakpoint)
$bp-value: map.get($breakpoints, $breakpoint)
@if $bp-value
@media (min-width: $bp-value)
@content
@else
@warn "Unknown breakpoint: #{$breakpoint}"
// Shorthand mixin syntax
=button-base
display: inline-block
padding: spacing(1) spacing(2)
border: none
border-radius: 4px
cursor: pointer
transition: all 0.3s ease
&:hover
transform: translateY(-2px)
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1)
&:active
transform: translateY(0)
// Placeholder selectors
%clearfix
&::after
content: ""
display: table
clear: both
%visually-hidden
position: absolute
width: 1px
height: 1px
padding: 0
margin: -1px
overflow: hidden
clip: rect(0, 0, 0, 0)
border: 0
// Base styles
*
box-sizing: border-box
margin: 0
padding: 0
html
font-size: $base-font-size
line-height: 1.5
body
font-family: $font-stack
color: #333
background-color: #fafafa
// Typography
h1, h2, h3, h4, h5, h6
margin-bottom: spacing(2)
font-weight: 600
line-height: 1.2
// Generate heading sizes with loop
@for $i from 1 through 6
h#{$i}
font-size: px-to-rem(48px - ($i * 6))
// Links
a
color: $primary-color
text-decoration: none
transition: color 0.2s ease
&:hover
color: color.adjust($primary-color, $lightness: -10%)
&:focus
outline: 2px solid $primary-color
outline-offset: 2px
// Buttons
.btn
+button-base
// Generate button variants
@each $name, $color in $theme-colors
&--#{$name}
background-color: $color
color: color-contrast($color)
&:hover
background-color: color.adjust($color, $lightness: -10%)
// Layout components
.container
width: 100%
max-width: 1200px
margin: 0 auto
padding: 0 spacing(2)
@extend %clearfix
@include respond-to(medium)
padding: 0 spacing(3)
@include respond-to(large)
padding: 0 spacing(4)
.row
display: flex
flex-wrap: wrap
margin: 0 spacing(-1)
// Grid columns
@for $i from 1 through 12
.col-#{$i}
flex: 0 0 math.percentage(math.div($i, 12))
max-width: math.percentage(math.div($i, 12))
padding: 0 spacing(1)
// Card component
.card
background: white
border-radius: 8px
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1)
overflow: hidden
transition: box-shadow 0.3s ease
&:hover
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15)
&__header
padding: spacing(2)
border-bottom: 1px solid #eee
&__body
padding: spacing(3)
&__footer
padding: spacing(2)
background: #f8f9fa
border-top: 1px solid #eee
// Form elements
.form-group
margin-bottom: spacing(2)
label
display: block
margin-bottom: spacing(0.5)
font-weight: 500
input, textarea, select
width: 100%
padding: spacing(1) spacing(1.5)
border: 1px solid #ccc
border-radius: 4px
font-size: 1rem
transition: border-color 0.2s ease
&:focus
outline: none
border-color: $primary-color
box-shadow: 0 0 0 3px rgba($primary-color, 0.2)
&:disabled
background: #e9ecef
cursor: not-allowed
// Utilities
@each $prop, $abbrev in (margin: m, padding: p)
@each $size in (0, 1, 2, 3, 4, 5)
.#{$abbrev}-#{$size}
#{$prop}: spacing($size)
.#{$abbrev}t-#{$size}
#{$prop}-top: spacing($size)
.#{$abbrev}r-#{$size}
#{$prop}-right: spacing($size)
.#{$abbrev}b-#{$size}
#{$prop}-bottom: spacing($size)
.#{$abbrev}l-#{$size}
#{$prop}-left: spacing($size)
.#{$abbrev}x-#{$size}
#{$prop}-left: spacing($size)
#{$prop}-right: spacing($size)
.#{$abbrev}y-#{$size}
#{$prop}-top: spacing($size)
#{$prop}-bottom: spacing($size)
// Display utilities
$displays: (none, inline, inline-block, block, flex, inline-flex, grid)
@each $display in $displays
.d-#{$display}
display: $display
// Flex utilities
.flex-row
flex-direction: row
.flex-column
flex-direction: column
.justify-start
justify-content: flex-start
.justify-end
justify-content: flex-end
.justify-center
justify-content: center
.justify-between
justify-content: space-between
.justify-around
justify-content: space-around
.align-start
align-items: flex-start
.align-end
align-items: flex-end
.align-center
align-items: center
.align-stretch
align-items: stretch
// Text utilities
.text-left
text-align: left
.text-center
text-align: center
.text-right
text-align: right
// Screen reader only (using placeholder)
.sr-only
@extend %visually-hidden
// Animations
@keyframes fadeIn
from
opacity: 0
to
opacity: 1
@keyframes slideInUp
from
opacity: 0
transform: translateY(20px)
to
opacity: 1
transform: translateY(0)
@keyframes pulse
0%
transform: scale(1)
50%
transform: scale(1.05)
100%
transform: scale(1)
.animate-fade-in
animation: fadeIn 0.3s ease-in
.animate-slide-in-up
animation: slideInUp 0.4s ease-out
.animate-pulse
animation: pulse 2s infinite
// Debug mode
$debug-mode: false
@if $debug-mode
*
outline: 1px solid red !important