@medcore-ua/concrete-css 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +265 -0
- package/README.md +102 -0
- package/package.json +55 -0
- package/scss/abstracts/_functions.scss +86 -0
- package/scss/abstracts/_mixins.scss +170 -0
- package/scss/abstracts/_tokens.scss +249 -0
- package/scss/abstracts/_variables.scss +53 -0
- package/scss/base/_reset.scss +100 -0
- package/scss/base/_typography.scss +71 -0
- package/scss/main.scss +39 -0
- package/scss/utilities/_api.scss +406 -0
- package/scss/utilities/_core.scss +103 -0
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// UTILITIES API
|
|
3
|
+
// Master configuration defining all utility classes to generate
|
|
4
|
+
// =============================================================================
|
|
5
|
+
|
|
6
|
+
@use 'sass:map';
|
|
7
|
+
@use '../abstracts/tokens' as *;
|
|
8
|
+
|
|
9
|
+
// This map is the single source of truth for utility generation
|
|
10
|
+
$utilities: (
|
|
11
|
+
|
|
12
|
+
// ==========================================================================
|
|
13
|
+
// LAYOUT
|
|
14
|
+
// ==========================================================================
|
|
15
|
+
|
|
16
|
+
'display': (
|
|
17
|
+
'prefix': '',
|
|
18
|
+
'values': (
|
|
19
|
+
'block': block,
|
|
20
|
+
'inline-block': inline-block,
|
|
21
|
+
'inline': inline,
|
|
22
|
+
'flex': flex,
|
|
23
|
+
'inline-flex': inline-flex,
|
|
24
|
+
'grid': grid,
|
|
25
|
+
'inline-grid': inline-grid,
|
|
26
|
+
'table': table,
|
|
27
|
+
'hidden': none
|
|
28
|
+
),
|
|
29
|
+
'responsive': true,
|
|
30
|
+
'states': false
|
|
31
|
+
),
|
|
32
|
+
|
|
33
|
+
// ==========================================================================
|
|
34
|
+
// FLEXBOX
|
|
35
|
+
// ==========================================================================
|
|
36
|
+
|
|
37
|
+
'flex-direction': (
|
|
38
|
+
'prefix': 'flex',
|
|
39
|
+
'values': (
|
|
40
|
+
'row': row,
|
|
41
|
+
'row-reverse': row-reverse,
|
|
42
|
+
'col': column,
|
|
43
|
+
'col-reverse': column-reverse
|
|
44
|
+
),
|
|
45
|
+
'responsive': true,
|
|
46
|
+
'states': false
|
|
47
|
+
),
|
|
48
|
+
|
|
49
|
+
'flex-wrap': (
|
|
50
|
+
'prefix': 'flex',
|
|
51
|
+
'values': (
|
|
52
|
+
'wrap': wrap,
|
|
53
|
+
'wrap-reverse': wrap-reverse,
|
|
54
|
+
'nowrap': nowrap
|
|
55
|
+
),
|
|
56
|
+
'responsive': true,
|
|
57
|
+
'states': false
|
|
58
|
+
),
|
|
59
|
+
|
|
60
|
+
'justify-content': (
|
|
61
|
+
'prefix': 'justify',
|
|
62
|
+
'values': (
|
|
63
|
+
'start': flex-start,
|
|
64
|
+
'end': flex-end,
|
|
65
|
+
'center': center,
|
|
66
|
+
'between': space-between,
|
|
67
|
+
'around': space-around,
|
|
68
|
+
'evenly': space-evenly
|
|
69
|
+
),
|
|
70
|
+
'responsive': true,
|
|
71
|
+
'states': false
|
|
72
|
+
),
|
|
73
|
+
|
|
74
|
+
'align-items': (
|
|
75
|
+
'prefix': 'items',
|
|
76
|
+
'values': (
|
|
77
|
+
'start': flex-start,
|
|
78
|
+
'end': flex-end,
|
|
79
|
+
'center': center,
|
|
80
|
+
'baseline': baseline,
|
|
81
|
+
'stretch': stretch
|
|
82
|
+
),
|
|
83
|
+
'responsive': true,
|
|
84
|
+
'states': false
|
|
85
|
+
),
|
|
86
|
+
|
|
87
|
+
'align-self': (
|
|
88
|
+
'prefix': 'self',
|
|
89
|
+
'values': (
|
|
90
|
+
'auto': auto,
|
|
91
|
+
'start': flex-start,
|
|
92
|
+
'end': flex-end,
|
|
93
|
+
'center': center,
|
|
94
|
+
'stretch': stretch
|
|
95
|
+
),
|
|
96
|
+
'responsive': true,
|
|
97
|
+
'states': false
|
|
98
|
+
),
|
|
99
|
+
|
|
100
|
+
'flex-grow': (
|
|
101
|
+
'prefix': 'grow',
|
|
102
|
+
'values': (
|
|
103
|
+
'0': 0,
|
|
104
|
+
'1': 1
|
|
105
|
+
),
|
|
106
|
+
'responsive': true,
|
|
107
|
+
'states': false
|
|
108
|
+
),
|
|
109
|
+
|
|
110
|
+
'flex-shrink': (
|
|
111
|
+
'prefix': 'shrink',
|
|
112
|
+
'values': (
|
|
113
|
+
'0': 0,
|
|
114
|
+
'1': 1
|
|
115
|
+
),
|
|
116
|
+
'responsive': true,
|
|
117
|
+
'states': false
|
|
118
|
+
),
|
|
119
|
+
|
|
120
|
+
// ==========================================================================
|
|
121
|
+
// GRID
|
|
122
|
+
// ==========================================================================
|
|
123
|
+
|
|
124
|
+
'grid-template-columns': (
|
|
125
|
+
'prefix': 'grid-cols',
|
|
126
|
+
'values': (
|
|
127
|
+
'1': repeat(1, minmax(0, 1fr)),
|
|
128
|
+
'2': repeat(2, minmax(0, 1fr)),
|
|
129
|
+
'3': repeat(3, minmax(0, 1fr)),
|
|
130
|
+
'4': repeat(4, minmax(0, 1fr)),
|
|
131
|
+
'6': repeat(6, minmax(0, 1fr)),
|
|
132
|
+
'12': repeat(12, minmax(0, 1fr)),
|
|
133
|
+
'none': none
|
|
134
|
+
),
|
|
135
|
+
'responsive': true,
|
|
136
|
+
'states': false
|
|
137
|
+
),
|
|
138
|
+
|
|
139
|
+
'gap': (
|
|
140
|
+
'prefix': 'gap',
|
|
141
|
+
'values': $spacing,
|
|
142
|
+
'responsive': true,
|
|
143
|
+
'states': false
|
|
144
|
+
),
|
|
145
|
+
|
|
146
|
+
// ==========================================================================
|
|
147
|
+
// COLORS
|
|
148
|
+
// ==========================================================================
|
|
149
|
+
|
|
150
|
+
'background-color': (
|
|
151
|
+
'prefix': 'bg',
|
|
152
|
+
'values': $colors,
|
|
153
|
+
'responsive': false,
|
|
154
|
+
'states': true
|
|
155
|
+
),
|
|
156
|
+
|
|
157
|
+
'color': (
|
|
158
|
+
'prefix': 'text',
|
|
159
|
+
'values': $colors,
|
|
160
|
+
'responsive': false,
|
|
161
|
+
'states': true
|
|
162
|
+
),
|
|
163
|
+
|
|
164
|
+
'border-color': (
|
|
165
|
+
'prefix': 'border',
|
|
166
|
+
'values': $colors,
|
|
167
|
+
'responsive': false,
|
|
168
|
+
'states': true
|
|
169
|
+
),
|
|
170
|
+
|
|
171
|
+
// ==========================================================================
|
|
172
|
+
// BORDERS
|
|
173
|
+
// ==========================================================================
|
|
174
|
+
|
|
175
|
+
'border-width': (
|
|
176
|
+
'prefix': 'border',
|
|
177
|
+
'values': $border-widths,
|
|
178
|
+
'responsive': false,
|
|
179
|
+
'states': false
|
|
180
|
+
),
|
|
181
|
+
|
|
182
|
+
'border-style': (
|
|
183
|
+
'prefix': 'border',
|
|
184
|
+
'values': (
|
|
185
|
+
'solid': solid,
|
|
186
|
+
'dashed': dashed,
|
|
187
|
+
'dotted': dotted,
|
|
188
|
+
'none': none
|
|
189
|
+
),
|
|
190
|
+
'responsive': false,
|
|
191
|
+
'states': false
|
|
192
|
+
),
|
|
193
|
+
|
|
194
|
+
'border-radius': (
|
|
195
|
+
'prefix': 'rounded',
|
|
196
|
+
'values': $border-radius,
|
|
197
|
+
'responsive': false,
|
|
198
|
+
'states': false
|
|
199
|
+
),
|
|
200
|
+
|
|
201
|
+
// ==========================================================================
|
|
202
|
+
// SIZING
|
|
203
|
+
// ==========================================================================
|
|
204
|
+
|
|
205
|
+
'width': (
|
|
206
|
+
'prefix': 'w',
|
|
207
|
+
'values': map.merge($spacing, (
|
|
208
|
+
'full': 100%,
|
|
209
|
+
'screen': 100vw,
|
|
210
|
+
'min': min-content,
|
|
211
|
+
'max': max-content,
|
|
212
|
+
'fit': fit-content
|
|
213
|
+
)),
|
|
214
|
+
'responsive': true,
|
|
215
|
+
'states': false
|
|
216
|
+
),
|
|
217
|
+
|
|
218
|
+
'height': (
|
|
219
|
+
'prefix': 'h',
|
|
220
|
+
'values': map.merge($spacing, (
|
|
221
|
+
'full': 100%,
|
|
222
|
+
'screen': 100vh,
|
|
223
|
+
'min': min-content,
|
|
224
|
+
'max': max-content,
|
|
225
|
+
'fit': fit-content
|
|
226
|
+
)),
|
|
227
|
+
'responsive': true,
|
|
228
|
+
'states': false
|
|
229
|
+
),
|
|
230
|
+
|
|
231
|
+
'max-width': (
|
|
232
|
+
'prefix': 'max-w',
|
|
233
|
+
'values': $max-widths,
|
|
234
|
+
'responsive': true,
|
|
235
|
+
'states': false
|
|
236
|
+
),
|
|
237
|
+
|
|
238
|
+
// ==========================================================================
|
|
239
|
+
// TYPOGRAPHY
|
|
240
|
+
// ==========================================================================
|
|
241
|
+
|
|
242
|
+
'font-family': (
|
|
243
|
+
'prefix': 'font',
|
|
244
|
+
'values': (
|
|
245
|
+
'mono': $font-family-mono,
|
|
246
|
+
'sans': $font-family-sans,
|
|
247
|
+
'serif': $font-family-serif
|
|
248
|
+
),
|
|
249
|
+
'responsive': false,
|
|
250
|
+
'states': false
|
|
251
|
+
),
|
|
252
|
+
|
|
253
|
+
'font-size': (
|
|
254
|
+
'prefix': 'text',
|
|
255
|
+
'values': $font-sizes,
|
|
256
|
+
'responsive': true,
|
|
257
|
+
'states': false
|
|
258
|
+
),
|
|
259
|
+
|
|
260
|
+
'font-weight': (
|
|
261
|
+
'prefix': 'font',
|
|
262
|
+
'values': $font-weights,
|
|
263
|
+
'responsive': false,
|
|
264
|
+
'states': false
|
|
265
|
+
),
|
|
266
|
+
|
|
267
|
+
'line-height': (
|
|
268
|
+
'prefix': 'leading',
|
|
269
|
+
'values': $line-heights,
|
|
270
|
+
'responsive': false,
|
|
271
|
+
'states': false
|
|
272
|
+
),
|
|
273
|
+
|
|
274
|
+
'letter-spacing': (
|
|
275
|
+
'prefix': 'tracking',
|
|
276
|
+
'values': $letter-spacing,
|
|
277
|
+
'responsive': false,
|
|
278
|
+
'states': false
|
|
279
|
+
),
|
|
280
|
+
|
|
281
|
+
'text-align': (
|
|
282
|
+
'prefix': 'text',
|
|
283
|
+
'values': (
|
|
284
|
+
'left': left,
|
|
285
|
+
'center': center,
|
|
286
|
+
'right': right,
|
|
287
|
+
'justify': justify
|
|
288
|
+
),
|
|
289
|
+
'responsive': true,
|
|
290
|
+
'states': false
|
|
291
|
+
),
|
|
292
|
+
|
|
293
|
+
'text-transform': (
|
|
294
|
+
'prefix': '',
|
|
295
|
+
'values': (
|
|
296
|
+
'uppercase': uppercase,
|
|
297
|
+
'lowercase': lowercase,
|
|
298
|
+
'capitalize': capitalize,
|
|
299
|
+
'normal-case': none
|
|
300
|
+
),
|
|
301
|
+
'responsive': false,
|
|
302
|
+
'states': false
|
|
303
|
+
),
|
|
304
|
+
|
|
305
|
+
'text-decoration': (
|
|
306
|
+
'prefix': '',
|
|
307
|
+
'values': (
|
|
308
|
+
'underline': underline,
|
|
309
|
+
'line-through': line-through,
|
|
310
|
+
'no-underline': none
|
|
311
|
+
),
|
|
312
|
+
'responsive': false,
|
|
313
|
+
'states': true
|
|
314
|
+
),
|
|
315
|
+
|
|
316
|
+
// ==========================================================================
|
|
317
|
+
// EFFECTS
|
|
318
|
+
// ==========================================================================
|
|
319
|
+
|
|
320
|
+
'opacity': (
|
|
321
|
+
'prefix': 'opacity',
|
|
322
|
+
'values': $opacity,
|
|
323
|
+
'responsive': false,
|
|
324
|
+
'states': true
|
|
325
|
+
),
|
|
326
|
+
|
|
327
|
+
'box-shadow': (
|
|
328
|
+
'prefix': 'shadow',
|
|
329
|
+
'values': $shadows,
|
|
330
|
+
'responsive': false,
|
|
331
|
+
'states': true
|
|
332
|
+
),
|
|
333
|
+
|
|
334
|
+
// ==========================================================================
|
|
335
|
+
// POSITIONING
|
|
336
|
+
// ==========================================================================
|
|
337
|
+
|
|
338
|
+
'position': (
|
|
339
|
+
'prefix': '',
|
|
340
|
+
'values': (
|
|
341
|
+
'static': static,
|
|
342
|
+
'fixed': fixed,
|
|
343
|
+
'absolute': absolute,
|
|
344
|
+
'relative': relative,
|
|
345
|
+
'sticky': sticky
|
|
346
|
+
),
|
|
347
|
+
'responsive': true,
|
|
348
|
+
'states': false
|
|
349
|
+
),
|
|
350
|
+
|
|
351
|
+
'z-index': (
|
|
352
|
+
'prefix': 'z',
|
|
353
|
+
'values': (
|
|
354
|
+
'0': 0,
|
|
355
|
+
'10': 10,
|
|
356
|
+
'20': 20,
|
|
357
|
+
'30': 30,
|
|
358
|
+
'40': 40,
|
|
359
|
+
'50': 50,
|
|
360
|
+
'auto': auto
|
|
361
|
+
),
|
|
362
|
+
'responsive': false,
|
|
363
|
+
'states': false
|
|
364
|
+
),
|
|
365
|
+
|
|
366
|
+
// ==========================================================================
|
|
367
|
+
// OVERFLOW
|
|
368
|
+
// ==========================================================================
|
|
369
|
+
|
|
370
|
+
'overflow': (
|
|
371
|
+
'prefix': 'overflow',
|
|
372
|
+
'values': (
|
|
373
|
+
'auto': auto,
|
|
374
|
+
'hidden': hidden,
|
|
375
|
+
'visible': visible,
|
|
376
|
+
'scroll': scroll
|
|
377
|
+
),
|
|
378
|
+
'responsive': true,
|
|
379
|
+
'states': false
|
|
380
|
+
),
|
|
381
|
+
|
|
382
|
+
'overflow-x': (
|
|
383
|
+
'prefix': 'overflow-x',
|
|
384
|
+
'values': (
|
|
385
|
+
'auto': auto,
|
|
386
|
+
'hidden': hidden,
|
|
387
|
+
'visible': visible,
|
|
388
|
+
'scroll': scroll
|
|
389
|
+
),
|
|
390
|
+
'responsive': true,
|
|
391
|
+
'states': false
|
|
392
|
+
),
|
|
393
|
+
|
|
394
|
+
'overflow-y': (
|
|
395
|
+
'prefix': 'overflow-y',
|
|
396
|
+
'values': (
|
|
397
|
+
'auto': auto,
|
|
398
|
+
'hidden': hidden,
|
|
399
|
+
'visible': visible,
|
|
400
|
+
'scroll': scroll
|
|
401
|
+
),
|
|
402
|
+
'responsive': true,
|
|
403
|
+
'states': false
|
|
404
|
+
)
|
|
405
|
+
|
|
406
|
+
) !default;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// UTILITIES CORE
|
|
3
|
+
// The main loop that generates all utility classes
|
|
4
|
+
// =============================================================================
|
|
5
|
+
|
|
6
|
+
@use '../abstracts/functions' as *;
|
|
7
|
+
@use '../abstracts/variables' as *;
|
|
8
|
+
@use '../abstracts/tokens' as *;
|
|
9
|
+
@use '../abstracts/mixins' as *;
|
|
10
|
+
@use './api' as *;
|
|
11
|
+
|
|
12
|
+
// =============================================================================
|
|
13
|
+
// STEP 1: GENERATE BASE UTILITIES
|
|
14
|
+
// These are available at all screen sizes
|
|
15
|
+
// =============================================================================
|
|
16
|
+
|
|
17
|
+
@include generate-utilities($utilities);
|
|
18
|
+
|
|
19
|
+
// =============================================================================
|
|
20
|
+
// STEP 2: GENERATE SPACING UTILITIES
|
|
21
|
+
// Margin and padding with directional support
|
|
22
|
+
// =============================================================================
|
|
23
|
+
|
|
24
|
+
// Margin
|
|
25
|
+
@include generate-directional('m', 'margin', $spacing);
|
|
26
|
+
|
|
27
|
+
// Padding
|
|
28
|
+
@include generate-directional('p', 'padding', $spacing);
|
|
29
|
+
|
|
30
|
+
// Negative margins (if enabled)
|
|
31
|
+
@if $enable-negative-margins {
|
|
32
|
+
@include generate-negative-margins($spacing);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// =============================================================================
|
|
36
|
+
// STEP 3: GENERATE RESPONSIVE UTILITIES
|
|
37
|
+
// Wrap utilities in media queries for each breakpoint
|
|
38
|
+
// =============================================================================
|
|
39
|
+
|
|
40
|
+
@if $enable-responsive {
|
|
41
|
+
@each $breakpoint in $breakpoint-names {
|
|
42
|
+
@include responsive-utilities($breakpoint, $utilities);
|
|
43
|
+
|
|
44
|
+
// Responsive spacing
|
|
45
|
+
$bp-value: map-get($breakpoints, $breakpoint);
|
|
46
|
+
@media (min-width: $bp-value) {
|
|
47
|
+
// Responsive margin
|
|
48
|
+
@each $dir-key, $dir-value in $directions {
|
|
49
|
+
@each $size-key, $size-value in $spacing {
|
|
50
|
+
$class-name: if($dir-key == '', 'm-#{$size-key}', 'm#{$dir-key}-#{$size-key}');
|
|
51
|
+
|
|
52
|
+
.#{$breakpoint}\:#{$class-name} {
|
|
53
|
+
@if $dir-key == '' {
|
|
54
|
+
margin: $size-value;
|
|
55
|
+
} @else if $dir-key == 'x' {
|
|
56
|
+
margin-left: $size-value;
|
|
57
|
+
margin-right: $size-value;
|
|
58
|
+
} @else if $dir-key == 'y' {
|
|
59
|
+
margin-top: $size-value;
|
|
60
|
+
margin-bottom: $size-value;
|
|
61
|
+
} @else {
|
|
62
|
+
margin#{$dir-value}: $size-value;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Responsive padding
|
|
69
|
+
@each $dir-key, $dir-value in $directions {
|
|
70
|
+
@each $size-key, $size-value in $spacing {
|
|
71
|
+
$class-name: if($dir-key == '', 'p-#{$size-key}', 'p#{$dir-key}-#{$size-key}');
|
|
72
|
+
|
|
73
|
+
.#{$breakpoint}\:#{$class-name} {
|
|
74
|
+
@if $dir-key == '' {
|
|
75
|
+
padding: $size-value;
|
|
76
|
+
} @else if $dir-key == 'x' {
|
|
77
|
+
padding-left: $size-value;
|
|
78
|
+
padding-right: $size-value;
|
|
79
|
+
} @else if $dir-key == 'y' {
|
|
80
|
+
padding-top: $size-value;
|
|
81
|
+
padding-bottom: $size-value;
|
|
82
|
+
} @else {
|
|
83
|
+
padding#{$dir-value}: $size-value;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// =============================================================================
|
|
93
|
+
// STEP 4: GENERATE STATE MODIFIERS
|
|
94
|
+
// Hover, focus, active states
|
|
95
|
+
// =============================================================================
|
|
96
|
+
|
|
97
|
+
@if $enable-hover-states {
|
|
98
|
+
@include state-utilities('hover', $utilities);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@if $enable-focus-states {
|
|
102
|
+
@include state-utilities('focus', $utilities);
|
|
103
|
+
}
|