crayon-css 0.2.0 → 0.2.1
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/package.json +1 -1
- package/src/_config.scss +7 -8
- package/src/_display.scss +2 -53
- package/src/_flex.scss +16 -0
- package/src/_grid.scss +61 -20
- package/src/_sizes.scss +32 -1
- package/src/crayon.scss +1 -1
package/package.json
CHANGED
package/src/_config.scss
CHANGED
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
@use "sass:math";
|
|
2
2
|
|
|
3
|
-
// Colour output space — used by colors.convert() and to-<space>()
|
|
4
|
-
// Options: srgb, hsl, oklch, oklab, display-p3
|
|
5
|
-
$convert-colorspace: true;
|
|
6
|
-
$output-colorspace: oklch;
|
|
7
|
-
|
|
8
|
-
// Layout divisions — used to generate fractional width/height classes like w-1/3, h-3/4 etc
|
|
9
|
-
$layout-divisions: (2, 3, 4, 5, 6, 12);
|
|
10
|
-
|
|
11
3
|
// Layout columns — used to generate grid-cols-* and col/row-span-* classes
|
|
12
4
|
$layout-columns: 12;
|
|
5
|
+
// Layout divisions — used to generate fractional width/height classes like w-1/3, h-3/4 etc
|
|
6
|
+
$layout-divisions: (2, 3, 4, 5, 6, 12);
|
|
13
7
|
|
|
14
8
|
$border-widths: (
|
|
15
9
|
"DEFAULT": 1px,
|
|
@@ -137,6 +131,11 @@ $base-sizes: (
|
|
|
137
131
|
9.5: $base-size * 9.5,
|
|
138
132
|
);
|
|
139
133
|
|
|
134
|
+
// Colour output space — used by colors.convert() and to-<space>()
|
|
135
|
+
// Options: srgb, hsl, oklch, oklab, display-p3
|
|
136
|
+
$convert-colorspace: true;
|
|
137
|
+
$output-colorspace: oklch;
|
|
138
|
+
|
|
140
139
|
/* The base color are the same as tailwind - it's all on you to extend etc */
|
|
141
140
|
$colors: (
|
|
142
141
|
// Slate
|
package/src/_display.scss
CHANGED
|
@@ -2,67 +2,16 @@
|
|
|
2
2
|
@use "config";
|
|
3
3
|
@use "utility";
|
|
4
4
|
|
|
5
|
-
// ─── Gap ──────────────────────────────────────────────────────────────────────
|
|
6
|
-
|
|
7
|
-
@mixin gap-classes($size-name, $value) {
|
|
8
|
-
$converted-value: utility.px-to-rem($value);
|
|
9
|
-
$escaped: utility.str-replace($size-name, ".", "\\.");
|
|
10
|
-
|
|
11
|
-
.gap-#{$escaped},
|
|
12
|
-
.gap#{$escaped} {
|
|
13
|
-
gap: $converted-value;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.gap-x-#{$escaped},
|
|
17
|
-
.gapx#{$escaped} {
|
|
18
|
-
column-gap: $converted-value;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.gap-y-#{$escaped},
|
|
22
|
-
.gapy#{$escaped} {
|
|
23
|
-
row-gap: $converted-value;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
@each $size, $value in config.$base-sizes {
|
|
28
|
-
@include gap-classes($size, $value);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
$gap-size: 10;
|
|
32
|
-
|
|
33
|
-
@while $gap-size <=config.$highest-multiplier {
|
|
34
|
-
@include gap-classes($gap-size, config.$base-size * $gap-size);
|
|
35
|
-
$gap-size: $gap-size + 1;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// ─── Display ──────────────────────────────────────────────────────────────────
|
|
39
|
-
|
|
40
5
|
.block {
|
|
41
6
|
display: block;
|
|
42
7
|
}
|
|
43
8
|
|
|
44
|
-
.inline-block {
|
|
45
|
-
display: inline-block;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
9
|
.inline {
|
|
49
10
|
display: inline;
|
|
50
11
|
}
|
|
51
12
|
|
|
52
|
-
.
|
|
53
|
-
display:
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.inline-flex {
|
|
57
|
-
display: inline-flex;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.grid {
|
|
61
|
-
display: grid;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.inline-grid {
|
|
65
|
-
display: inline-grid;
|
|
13
|
+
.inline-block {
|
|
14
|
+
display: inline-block;
|
|
66
15
|
}
|
|
67
16
|
|
|
68
17
|
.hidden,
|
package/src/_flex.scss
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
// ─── Display ──────────────────────────────────────────────────────────────────
|
|
2
|
+
|
|
3
|
+
.flex {
|
|
4
|
+
display: flex;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.inline-flex {
|
|
8
|
+
display: inline-flex;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// ─── Direction ────────────────────────────────────────────────────────────────
|
|
12
|
+
|
|
1
13
|
$flex: (
|
|
2
14
|
"row": row,
|
|
3
15
|
"col": column,
|
|
@@ -15,6 +27,8 @@ $flex: (
|
|
|
15
27
|
}
|
|
16
28
|
}
|
|
17
29
|
|
|
30
|
+
// ─── Grow & shrink ────────────────────────────────────────────────────────────
|
|
31
|
+
|
|
18
32
|
.grow {
|
|
19
33
|
flex-grow: 1;
|
|
20
34
|
}
|
|
@@ -33,6 +47,8 @@ $flex: (
|
|
|
33
47
|
flex-shrink: 0;
|
|
34
48
|
}
|
|
35
49
|
|
|
50
|
+
// ─── Wrap ─────────────────────────────────────────────────────────────────────
|
|
51
|
+
|
|
36
52
|
.flex-wrap {
|
|
37
53
|
flex-wrap: wrap;
|
|
38
54
|
}
|
package/src/_grid.scss
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
@use "config";
|
|
2
2
|
|
|
3
|
+
.grid {
|
|
4
|
+
display: grid;
|
|
5
|
+
}
|
|
6
|
+
|
|
3
7
|
// ─── Grid template columns ────────────────────────────────────────────────────
|
|
4
8
|
|
|
5
9
|
@for $column from 1 through config.$layout-columns {
|
|
@@ -8,17 +12,27 @@
|
|
|
8
12
|
}
|
|
9
13
|
}
|
|
10
14
|
|
|
11
|
-
.grid-cols-none {
|
|
15
|
+
.grid-cols-none {
|
|
16
|
+
grid-template-columns: none;
|
|
17
|
+
}
|
|
12
18
|
|
|
13
19
|
// ─── Column & row span ────────────────────────────────────────────────────────
|
|
14
20
|
|
|
15
21
|
@for $columns from 1 through config.$layout-columns {
|
|
16
|
-
.col-span-#{$columns} {
|
|
17
|
-
|
|
22
|
+
.col-span-#{$columns} {
|
|
23
|
+
grid-column: span #{$columns} / span #{$columns};
|
|
24
|
+
}
|
|
25
|
+
.row-span-#{$columns} {
|
|
26
|
+
grid-row: span #{$columns} / span #{$columns};
|
|
27
|
+
}
|
|
18
28
|
}
|
|
19
29
|
|
|
20
|
-
.col-span-full {
|
|
21
|
-
|
|
30
|
+
.col-span-full {
|
|
31
|
+
grid-column: 1 / -1;
|
|
32
|
+
}
|
|
33
|
+
.row-span-full {
|
|
34
|
+
grid-row: 1 / -1;
|
|
35
|
+
}
|
|
22
36
|
|
|
23
37
|
// ─── Grid template rows ───────────────────────────────────────────────────────
|
|
24
38
|
|
|
@@ -28,25 +42,52 @@
|
|
|
28
42
|
}
|
|
29
43
|
}
|
|
30
44
|
|
|
31
|
-
.grid-rows-none {
|
|
45
|
+
.grid-rows-none {
|
|
46
|
+
grid-template-rows: none;
|
|
47
|
+
}
|
|
32
48
|
|
|
33
49
|
// ─── Auto columns & rows ──────────────────────────────────────────────────────
|
|
34
50
|
|
|
35
|
-
.auto-cols-auto {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
.auto-cols-
|
|
51
|
+
.auto-cols-auto {
|
|
52
|
+
grid-auto-columns: auto;
|
|
53
|
+
}
|
|
54
|
+
.auto-cols-min {
|
|
55
|
+
grid-auto-columns: min-content;
|
|
56
|
+
}
|
|
57
|
+
.auto-cols-max {
|
|
58
|
+
grid-auto-columns: max-content;
|
|
59
|
+
}
|
|
60
|
+
.auto-cols-fr {
|
|
61
|
+
grid-auto-columns: minmax(0, 1fr);
|
|
62
|
+
}
|
|
39
63
|
|
|
40
|
-
.auto-rows-auto {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
.auto-rows-
|
|
64
|
+
.auto-rows-auto {
|
|
65
|
+
grid-auto-rows: auto;
|
|
66
|
+
}
|
|
67
|
+
.auto-rows-min {
|
|
68
|
+
grid-auto-rows: min-content;
|
|
69
|
+
}
|
|
70
|
+
.auto-rows-max {
|
|
71
|
+
grid-auto-rows: max-content;
|
|
72
|
+
}
|
|
73
|
+
.auto-rows-fr {
|
|
74
|
+
grid-auto-rows: minmax(0, 1fr);
|
|
75
|
+
}
|
|
44
76
|
|
|
45
77
|
// ─── Grid auto flow ───────────────────────────────────────────────────────────
|
|
46
78
|
|
|
47
|
-
.grid-flow-row
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
.grid-flow-
|
|
51
|
-
|
|
52
|
-
|
|
79
|
+
.grid-flow-row {
|
|
80
|
+
grid-auto-flow: row;
|
|
81
|
+
}
|
|
82
|
+
.grid-flow-col {
|
|
83
|
+
grid-auto-flow: column;
|
|
84
|
+
}
|
|
85
|
+
.grid-flow-dense {
|
|
86
|
+
grid-auto-flow: dense;
|
|
87
|
+
}
|
|
88
|
+
.grid-flow-row-dense {
|
|
89
|
+
grid-auto-flow: row dense;
|
|
90
|
+
}
|
|
91
|
+
.grid-flow-col-dense {
|
|
92
|
+
grid-auto-flow: column dense;
|
|
93
|
+
}
|
package/src/_sizes.scss
CHANGED
|
@@ -434,4 +434,35 @@ $size: 10;
|
|
|
434
434
|
.size-auto {
|
|
435
435
|
width: auto;
|
|
436
436
|
height: auto;
|
|
437
|
-
}
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
@mixin gap-classes($size-name, $value) {
|
|
440
|
+
$converted-value: utility.px-to-rem($value);
|
|
441
|
+
$escaped: utility.str-replace($size-name, ".", "\\.");
|
|
442
|
+
|
|
443
|
+
.gap-#{$escaped},
|
|
444
|
+
.gap#{$escaped} {
|
|
445
|
+
gap: $converted-value;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
.gap-x-#{$escaped},
|
|
449
|
+
.gapx#{$escaped} {
|
|
450
|
+
column-gap: $converted-value;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
.gap-y-#{$escaped},
|
|
454
|
+
.gapy#{$escaped} {
|
|
455
|
+
row-gap: $converted-value;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
@each $size, $value in config.$base-sizes {
|
|
460
|
+
@include gap-classes($size, $value);
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
$gap-size: 10;
|
|
464
|
+
|
|
465
|
+
@while $gap-size <=config.$highest-multiplier {
|
|
466
|
+
@include gap-classes($gap-size, config.$base-size * $gap-size);
|
|
467
|
+
$gap-size: $gap-size + 1;
|
|
468
|
+
}
|
package/src/crayon.scss
CHANGED