crayon-css 0.2.0 → 0.2.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crayon-css",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "A Sass utility CSS toolkit.",
5
5
  "sass": "src/crayon.scss",
6
6
  "files": [
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
- .flex {
53
- display: flex;
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 { grid-template-columns: 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} { grid-column: span #{$columns} / span #{$columns}; }
17
- .row-span-#{$columns} { grid-row: span #{$columns} / span #{$columns}; }
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 { grid-column: 1 / -1; }
21
- .row-span-full { grid-row: 1 / -1; }
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 { grid-template-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 { grid-auto-columns: auto; }
36
- .auto-cols-min { grid-auto-columns: min-content; }
37
- .auto-cols-max { grid-auto-columns: max-content; }
38
- .auto-cols-fr { grid-auto-columns: minmax(0, 1fr); }
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 { grid-auto-rows: auto; }
41
- .auto-rows-min { grid-auto-rows: min-content; }
42
- .auto-rows-max { grid-auto-rows: max-content; }
43
- .auto-rows-fr { grid-auto-rows: minmax(0, 1fr); }
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 { grid-auto-flow: row; }
48
- .grid-flow-col { grid-auto-flow: column; }
49
- .grid-flow-dense { grid-auto-flow: dense; }
50
- .grid-flow-row-dense { grid-auto-flow: row dense; }
51
- .grid-flow-col-dense { grid-auto-flow: column dense; }
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/_reset.scss CHANGED
@@ -30,8 +30,8 @@ dd {
30
30
  }
31
31
 
32
32
  /* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
33
- ul[role='list'],
34
- ol[role='list'] {
33
+ ul[role="list"],
34
+ ol[role="list"] {
35
35
  list-style: none;
36
36
  }
37
37
 
@@ -44,6 +44,11 @@ body {
44
44
  font-weight: typography.font-weight("normal");
45
45
  }
46
46
 
47
+ /* Table */
48
+ table {
49
+ border-collapse: collapse;
50
+ }
51
+
47
52
  /* Set shorter line heights on headings and interactive elements */
48
53
  h1,
49
54
  h2,
@@ -63,6 +68,10 @@ h4 {
63
68
  text-wrap: balance;
64
69
  }
65
70
 
71
+ p {
72
+ margin: 0;
73
+ }
74
+
66
75
  /*
67
76
  Text-level semantics
68
77
  ====================
@@ -87,12 +96,7 @@ kbd,
87
96
  samp,
88
97
  pre {
89
98
  font-family:
90
- ui-monospace,
91
- SFMono-Regular,
92
- Consolas,
93
- 'Liberation Mono',
94
- Menlo,
95
- monospace;
99
+ ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
96
100
  /* 1 */
97
101
  font-size: 1em;
98
102
  /* 2 */
@@ -156,4 +160,4 @@ textarea:not([rows]) {
156
160
  /* Anything that has been anchored to should have extra scroll margin */
157
161
  :target {
158
162
  scroll-margin-block: 5ex;
159
- }
163
+ }
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
@@ -9,4 +9,4 @@
9
9
  @forward "colors";
10
10
  @forward "typography";
11
11
  @forward "borders";
12
- @forward "mixins";
12
+ @forward "mixins";