@graupl/core 1.0.0-beta.51 → 1.0.0-beta.53

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.
Files changed (49) hide show
  1. package/dist/css/graupl.css +1 -1
  2. package/dist/css/graupl.css.map +1 -1
  3. package/dist/css/layout/columns.css +1 -1
  4. package/dist/css/layout/columns.css.map +1 -1
  5. package/dist/css/layout/flex-columns.css.map +1 -1
  6. package/dist/css/layout.css +1 -1
  7. package/dist/css/layout.css.map +1 -1
  8. package/dist/css/utilities/block-size.css +1 -1
  9. package/dist/css/utilities/block-size.css.map +1 -1
  10. package/dist/css/utilities/grid.css +2 -0
  11. package/dist/css/utilities/grid.css.map +1 -0
  12. package/dist/css/utilities/inline-size.css +1 -1
  13. package/dist/css/utilities/inline-size.css.map +1 -1
  14. package/dist/css/utilities.css +1 -1
  15. package/dist/css/utilities.css.map +1 -1
  16. package/package.json +1 -1
  17. package/scss/utilities/grid.scss +3 -0
  18. package/src/scss/_defaults.scss +4 -0
  19. package/src/scss/layout/columns/_defaults.scss +26 -4
  20. package/src/scss/layout/columns/_index.scss +346 -35
  21. package/src/scss/layout/flex-columns/_defaults.scss +2 -2
  22. package/src/scss/layout/flex-columns/_index.scss +41 -41
  23. package/src/scss/utilities/_index.scss +1 -0
  24. package/src/scss/utilities/_template/_index.scss +1 -1
  25. package/src/scss/utilities/block-size/_defaults.scss +3 -3
  26. package/src/scss/utilities/block-size/_index.scss +84 -84
  27. package/src/scss/utilities/grid/_defaults.scss +89 -0
  28. package/src/scss/utilities/grid/_index.scss +236 -0
  29. package/src/scss/utilities/grid/_variables.scss +6 -0
  30. package/src/scss/utilities/grid/col-span/_defaults.scss +102 -0
  31. package/src/scss/utilities/grid/col-span/_index.scss +124 -0
  32. package/src/scss/utilities/grid/col-span/_variables.scss +6 -0
  33. package/src/scss/utilities/grid/grid-column/_defaults.scss +104 -0
  34. package/src/scss/utilities/grid/grid-column/_index.scss +140 -0
  35. package/src/scss/utilities/grid/grid-column/_variables.scss +6 -0
  36. package/src/scss/utilities/grid/grid-row/_defaults.scss +104 -0
  37. package/src/scss/utilities/grid/grid-row/_index.scss +140 -0
  38. package/src/scss/utilities/grid/grid-row/_variables.scss +6 -0
  39. package/src/scss/utilities/grid/grid-template-columns/_defaults.scss +102 -0
  40. package/src/scss/utilities/grid/grid-template-columns/_index.scss +124 -0
  41. package/src/scss/utilities/grid/grid-template-columns/_variables.scss +6 -0
  42. package/src/scss/utilities/grid/grid-template-rows/_defaults.scss +102 -0
  43. package/src/scss/utilities/grid/grid-template-rows/_index.scss +124 -0
  44. package/src/scss/utilities/grid/grid-template-rows/_variables.scss +6 -0
  45. package/src/scss/utilities/grid/row-span/_defaults.scss +102 -0
  46. package/src/scss/utilities/grid/row-span/_index.scss +124 -0
  47. package/src/scss/utilities/grid/row-span/_variables.scss +6 -0
  48. package/src/scss/utilities/inline-size/_defaults.scss +3 -3
  49. package/src/scss/utilities/inline-size/_index.scss +84 -84
@@ -0,0 +1,140 @@
1
+ // @graupl/core grid-column utilities styles.
2
+ //
3
+ // This file generates the grid utility classes provided by Graupl.
4
+ //
5
+ // The following classes are generated by default:
6
+ // - `.column-start-first`: Sets the `grid-column-start` property to `1`.
7
+ // - `.column-start-last`: Sets the `grid-column-start` property to `-1`.
8
+ // - `.column-start-auto`: Sets the `grid-column-start` property to `auto`.
9
+ // - `.column-start-1`: Sets the `grid-column-start` property to `1`.
10
+ // - `.column-start-2`: Sets the `grid-column-start` property to `2`.
11
+ // - `.column-start-3`: Sets the `grid-column-start` property to `3`.
12
+ // - `.column-start-4`: Sets the `grid-column-start` property to `4`.
13
+ // - `.column-start-5`: Sets the `grid-column-start` property to `5`.
14
+ // - `.column-start-6`: Sets the `grid-column-start` property to `6`.
15
+ // - `.column-start-7`: Sets the `grid-column-start` property to `7`.
16
+ // - `.column-start-8`: Sets the `grid-column-start` property to `8`.
17
+ // - `.column-start-9`: Sets the `grid-column-start` property to `9`.
18
+ // - `.column-start-10`: Sets the `grid-column-start` property to `10`.
19
+ // - `.column-start-11`: Sets the `grid-column-start` property to `11`.
20
+ // - `.column-start-12`: Sets the `grid-column-start` property to `12`.
21
+ // - `.column-end-first`: Sets the `grid-column-end` property to `1`.
22
+ // - `.column-end-last`: Sets the `grid-column-end` property to `-1`.
23
+ // - `.column-end-auto`: Sets the `grid-column-end` property to `auto`.
24
+ // - `.column-end-1`: Sets the `grid-column-end` property to `1`.
25
+ // - `.column-end-2`: Sets the `grid-column-end` property to `2`.
26
+ // - `.column-end-3`: Sets the `grid-column-end` property to `3`.
27
+ // - `.column-end-4`: Sets the `grid-column-end` property to `4`.
28
+ // - `.column-end-5`: Sets the `grid-column-end` property to `5`.
29
+ // - `.column-end-6`: Sets the `grid-column-end` property to `6`.
30
+ // - `.column-end-7`: Sets the `grid-column-end` property to `7`.
31
+ // - `.column-end-8`: Sets the `grid-column-end` property to `8`.
32
+ // - `.column-end-9`: Sets the `grid-column-end` property to `9`.
33
+ // - `.column-end-10`: Sets the `grid-column-end` property to `10`.
34
+ // - `.column-end-11`: Sets the `grid-column-end` property to `11`.
35
+ // - `.column-end-12`: Sets the `grid-column-end` property to `12`.
36
+ //
37
+ // The following custom properties control the generated classes:
38
+ // | Property | Description | Default Value |
39
+ // | -------- | ----------- | ------------- |
40
+ // | N/A | N/A | N/A |
41
+ //
42
+ // This utility does not define any custom properties.
43
+ //
44
+ // The following variables control the generated classes:
45
+ // | Variable | Description | Default Value |
46
+ // | ------------------------------------ | ----------------------------------------------------------- | ------------- |
47
+ // | `$selector-base` | Base selector for utility classes. | `"."` |
48
+ // | `$selector-prefix` | The selector prefix for all utility classes. | `""` |
49
+ // | `$selector-suffix` | The selctor suffix for all utility classes. | `""` |
50
+ // | `$selector-separator` | The selector separator for all utility classes. | `""` |
51
+ // | `$use-important` | Appends `!important` to generated utility declarations. | `true` |
52
+ // | `$generate-base-utilities` | Generates the base utility classes. | `true` |
53
+ // | `$screen-aware` | Enables screen-aware utility variants. | `false` |
54
+ // | `$theme-aware` | Enables theme-aware utility variants. | `false` |
55
+ // | `$scheme-aware` | Enables scheme-aware utility variants. | `false` |
56
+ // | `$state-aware` | Enables state-aware utility variants. | `false` |
57
+ // | `$container-aware` | Enables container-aware utility variants. | `false` |
58
+ // | `$screen-aware-selector-prefix` | Prefix to the screen-aware portion of utility selectors. | `""` |
59
+ // | `$screen-aware-selector-suffix` | Suffix to the screen-aware portion of utility selectors. | `""` |
60
+ // | `$screen-aware-selector-separator` | Separator inserted for screen-aware utility selectors. | `"\\:"` |
61
+ // | `$theme-aware-selector-prefix` | Prefix to the theme-aware portion of utility selectors. | `""` |
62
+ // | `$theme-aware-selector-suffix` | Suffix to the theme-aware portion of utility selectors. | `"-theme"` |
63
+ // | `$theme-aware-selector-separator` | Separator inserted for theme-aware utility selectors. | `"\\:"` |
64
+ // | `$scheme-aware-selector-prefix` | Prefix to the scheme-aware portion of utility selectors. | `""` |
65
+ // | `$scheme-aware-selector-suffix` | Suffix to the scheme-aware portion of utility selectors. | `"-mode"` |
66
+ // | `$scheme-aware-selector-separator` | Separator inserted for scheme-aware utility selectors. | `"\\:"` |
67
+ // | `$state-aware-selector-prefix` | Prefix to the state-aware portion of utility selectors. | `""` |
68
+ // | `$state-aware-selector-suffix` | Suffix to the state-aware portion of utility selectors. | `""` |
69
+ // | `$state-aware-selector-separator` | Separator inserted for state-aware utility selectors. | `"\\:"` |
70
+ // | `$container-aware-selector-prefix` | Prefix to the container-aware portion of utility selectors. | `"cq\\:"` |
71
+ // | `$container-aware-selector-suffix` | Suffix to the container-aware portion of utility selectors. | `""` |
72
+ // | `$container-aware-selector-separator`| Separator inserted for container-aware utility selectors. | `"\\:"` |
73
+ // | `$utility-properties` | Map of utility properties. | `()` |
74
+ // | `$utility-values` | Map of utility values. | `()` |
75
+ // | `$utility-map` | Map of utility property/value pairs. | `()` |
76
+ // | `$grid-column-min-count` | The minimum column count for generated utilities. | `1` |
77
+ // | `$grid-column-max-count` | The maximum column count for generated utilities. | `12` |
78
+ //
79
+ // Generating responsive utility classes can be done by setting `$screen-aware`, `$theme-aware`, `$scheme-aware`, `$state-aware`, or `$container-aware` to `true`.
80
+ // By default, no responsive utility classes are generated for grid-column.
81
+ //
82
+ // When set to true, screen-aware utility classes will be generated for each screen size in the following pattern: `.{screen-modifier}:{utility-selector}`
83
+ //
84
+ // e.g. `sm:column-start-2` will apply the `column-start-2` class on small-sized screens and up.
85
+ //
86
+ // When set to true, theme-aware utility classes will be generated for each theme in the following pattern: `.{theme-modifier}:{utility-selector}`
87
+ //
88
+ // e.g. `default-theme:column-start-2` will apply the `column-start-2` class when using the default theme.
89
+ //
90
+ // When set to true, scheme-aware utility classes will be generated for each theme in the following pattern: `.{scheme-modifier}:{utility-selector}`
91
+ //
92
+ // e.g. `dark-mode:column-start-2` will apply the `column-start-2` class when dark-mode is active.
93
+ //
94
+ // When set to true, state-aware utility classes will be generated for each state in the following pattern: `.{state-modifier}:{utility-selector}`
95
+ //
96
+ // e.g. `hover:column-start-2` will apply the `column-start-2` class when hovered.
97
+ //
98
+ // When set to true, container-aware utility classes will be generated for each container in the following pattern: `.{container-modifier}:{utility-selector}`
99
+ //
100
+ // e.g. `cq:md:column-start-2` will apply the `column-start-2` class on medium-sized containers and up.
101
+ //
102
+ // @example
103
+ // <div class="column-start-2">This content will start on column 2.</div>
104
+
105
+ @use "../../../mixins/layer" as *;
106
+ @use "../../../mixins/utility";
107
+ @use "defaults";
108
+ @use "variables" as *;
109
+
110
+ @include layer(utilities) {
111
+ // Create a utitlity for each entry in the utility map.
112
+ @include utility.generate(
113
+ $map: defaults.$utility-map,
114
+ $selector-base: defaults.$selector-base,
115
+ $selector-prefix: defaults.$selector-prefix,
116
+ $selector-suffix: defaults.$selector-suffix,
117
+ $screen-aware: defaults.$screen-aware,
118
+ $screen-aware-selector-prefix: defaults.$screen-aware-selector-prefix,
119
+ $screen-aware-selector-suffix: defaults.$screen-aware-selector-suffix,
120
+ $screen-aware-selector-separator: defaults.$screen-aware-selector-separator,
121
+ $theme-aware: defaults.$theme-aware,
122
+ $theme-aware-selector-prefix: defaults.$theme-aware-selector-prefix,
123
+ $theme-aware-selector-suffix: defaults.$theme-aware-selector-suffix,
124
+ $theme-aware-selector-separator: defaults.$theme-aware-selector-separator,
125
+ $scheme-aware: defaults.$scheme-aware,
126
+ $scheme-aware-selector-prefix: defaults.$scheme-aware-selector-prefix,
127
+ $scheme-aware-selector-suffix: defaults.$scheme-aware-selector-suffix,
128
+ $scheme-aware-selector-separator: defaults.$scheme-aware-selector-separator,
129
+ $state-aware: defaults.$state-aware,
130
+ $state-aware-selector-prefix: defaults.$state-aware-selector-prefix,
131
+ $state-aware-selector-suffix: defaults.$state-aware-selector-suffix,
132
+ $state-aware-selector-separator: defaults.$state-aware-selector-separator,
133
+ $container-aware: defaults.$container-aware,
134
+ $container-aware-selector-prefix: defaults.$container-aware-selector-prefix,
135
+ $container-aware-selector-suffix: defaults.$container-aware-selector-suffix,
136
+ $container-aware-selector-separator:
137
+ defaults.$container-aware-selector-separator,
138
+ $important: defaults.$use-important
139
+ );
140
+ }
@@ -0,0 +1,6 @@
1
+ // @graupl/core grid-column utilities variables.
2
+ //
3
+ // These values are to be used to directly style components and provide a
4
+ // cleaner way to reference custom properties.
5
+
6
+ @use "defaults";
@@ -0,0 +1,104 @@
1
+ // @graupl/core grid-row utilities default values.
2
+ //
3
+ // Generally, these should not be used directly when styling components unless a static value is needed.
4
+ // They are mainly used to provide class selectors, fallbacks for custom properties, or loop values.
5
+ //
6
+ // They should not be used to define direct property values (i.e. font-size, color, etc.).
7
+ // Those should be defined as custom properties in the `_variables.scss` file.
8
+
9
+ @use "../defaults" as grid-defaults;
10
+ @use "../../../functions/utility";
11
+ @use "sass:map";
12
+ @use "sass:math";
13
+
14
+ // Utility modifiers.
15
+ $selector-base: grid-defaults.$selector-base !default;
16
+ $selector-prefix: grid-defaults.$selector-prefix !default;
17
+ $selector-suffix: grid-defaults.$selector-suffix !default;
18
+ $selector-separator: grid-defaults.$selector-separator !default;
19
+ $use-important: grid-defaults.$use-important !default;
20
+ $generate-base-utilities: grid-defaults.$generate-base-utilities !default;
21
+ $screen-aware: grid-defaults.$screen-aware !default;
22
+ $theme-aware: grid-defaults.$theme-aware !default;
23
+ $scheme-aware: grid-defaults.$scheme-aware !default;
24
+ $state-aware: grid-defaults.$state-aware !default;
25
+ $container-aware: grid-defaults.$container-aware !default;
26
+ $screen-aware-selector-prefix: grid-defaults.$screen-aware-selector-prefix !default;
27
+ $screen-aware-selector-suffix: grid-defaults.$screen-aware-selector-suffix !default;
28
+ $screen-aware-selector-separator: grid-defaults.$screen-aware-selector-separator !default;
29
+ $theme-aware-selector-prefix: grid-defaults.$theme-aware-selector-prefix !default;
30
+ $theme-aware-selector-suffix: grid-defaults.$theme-aware-selector-suffix !default;
31
+ $theme-aware-selector-separator: grid-defaults.$theme-aware-selector-separator !default;
32
+ $scheme-aware-selector-prefix: grid-defaults.$scheme-aware-selector-prefix !default;
33
+ $scheme-aware-selector-suffix: grid-defaults.$scheme-aware-selector-suffix !default;
34
+ $scheme-aware-selector-separator: grid-defaults.$scheme-aware-selector-separator !default;
35
+ $state-aware-selector-prefix: grid-defaults.$state-aware-selector-prefix !default;
36
+ $state-aware-selector-suffix: grid-defaults.$state-aware-selector-suffix !default;
37
+ $state-aware-selector-separator: grid-defaults.$state-aware-selector-separator !default;
38
+ $container-aware-selector-prefix: grid-defaults.$container-aware-selector-prefix !default;
39
+ $container-aware-selector-suffix: grid-defaults.$container-aware-selector-suffix !default;
40
+ $container-aware-selector-separator: grid-defaults.$container-aware-selector-separator !default;
41
+ $grid-row-min-count: grid-defaults.$grid-row-min-count;
42
+ $grid-row-max-count: grid-defaults.$grid-row-max-count;
43
+
44
+ // Properties.
45
+ $-utility-properties: (
46
+ "row-start": grid-row-start,
47
+ "row-end": grid-row-end,
48
+ );
49
+ $utility-properties: () !default;
50
+
51
+ // Values.
52
+ $-utility-values: (
53
+ "first": 1,
54
+ "last": -1,
55
+ "auto": auto,
56
+ );
57
+ $utility-values: () !default;
58
+
59
+ // Add the count values to the base values.
60
+ @for $i from $grid-row-min-count through $grid-row-max-count {
61
+ $-utility-values: map.merge(
62
+ $-utility-values,
63
+ (
64
+ math.abs($i): $i,
65
+ )
66
+ );
67
+ }
68
+
69
+ // Merge custom and base properties/values if generating base utilities.
70
+ @if $generate-base-utilities {
71
+ $utility-properties: map.deep-merge(
72
+ $-utility-properties,
73
+ $utility-properties
74
+ );
75
+ $utility-values: map.deep-merge($-utility-values, $utility-values);
76
+ }
77
+
78
+ // Set up all utility classes and properties for cleaner generation in the index file.
79
+ //
80
+ // The end result of this map is something like:
81
+ // $-utility-map: (
82
+ // class-name: (
83
+ // property: value,
84
+ // property: value,
85
+ // ...
86
+ // ),
87
+ // class-name: (
88
+ // property: value,
89
+ // property: value,
90
+ // ...
91
+ // ),
92
+ // ...
93
+ // );
94
+ $-utility-map: ();
95
+ $-utility-map: map.deep-merge(
96
+ $-utility-map,
97
+ utility.generate-utility-map(
98
+ $utility-properties,
99
+ $utility-values,
100
+ $selector-separator
101
+ )
102
+ );
103
+ $utility-map: () !default;
104
+ $utility-map: map.deep-merge($-utility-map, $utility-map);
@@ -0,0 +1,140 @@
1
+ // @graupl/core grid-row utilities styles.
2
+ //
3
+ // This file generates the grid utility classes provided by Graupl.
4
+ //
5
+ // The following classes are generated by default:
6
+ // - `.row-start-first`: Sets the `grid-row-start` property to `1`.
7
+ // - `.row-start-last`: Sets the `grid-row-start` property to `-1`.
8
+ // - `.row-start-auto`: Sets the `grid-row-start` property to `auto`.
9
+ // - `.row-start-1`: Sets the `grid-row-start` property to `1`.
10
+ // - `.row-start-2`: Sets the `grid-row-start` property to `2`.
11
+ // - `.row-start-3`: Sets the `grid-row-start` property to `3`.
12
+ // - `.row-start-4`: Sets the `grid-row-start` property to `4`.
13
+ // - `.row-start-5`: Sets the `grid-row-start` property to `5`.
14
+ // - `.row-start-6`: Sets the `grid-row-start` property to `6`.
15
+ // - `.row-start-7`: Sets the `grid-row-start` property to `7`.
16
+ // - `.row-start-8`: Sets the `grid-row-start` property to `8`.
17
+ // - `.row-start-9`: Sets the `grid-row-start` property to `9`.
18
+ // - `.row-start-10`: Sets the `grid-row-start` property to `10`.
19
+ // - `.row-start-11`: Sets the `grid-row-start` property to `11`.
20
+ // - `.row-start-12`: Sets the `grid-row-start` property to `12`.
21
+ // - `.row-end-first`: Sets the `grid-row-end` property to `1`.
22
+ // - `.row-end-last`: Sets the `grid-row-end` property to `-1`.
23
+ // - `.row-end-auto`: Sets the `grid-row-end` property to `auto`.
24
+ // - `.row-end-1`: Sets the `grid-row-end` property to `1`.
25
+ // - `.row-end-2`: Sets the `grid-row-end` property to `2`.
26
+ // - `.row-end-3`: Sets the `grid-row-end` property to `3`.
27
+ // - `.row-end-4`: Sets the `grid-row-end` property to `4`.
28
+ // - `.row-end-5`: Sets the `grid-row-end` property to `5`.
29
+ // - `.row-end-6`: Sets the `grid-row-end` property to `6`.
30
+ // - `.row-end-7`: Sets the `grid-row-end` property to `7`.
31
+ // - `.row-end-8`: Sets the `grid-row-end` property to `8`.
32
+ // - `.row-end-9`: Sets the `grid-row-end` property to `9`.
33
+ // - `.row-end-10`: Sets the `grid-row-end` property to `10`.
34
+ // - `.row-end-11`: Sets the `grid-row-end` property to `11`.
35
+ // - `.row-end-12`: Sets the `grid-row-end` property to `12`.
36
+ //
37
+ // The following custom properties control the generated classes:
38
+ // | Property | Description | Default Value |
39
+ // | -------- | ----------- | ------------- |
40
+ // | N/A | N/A | N/A |
41
+ //
42
+ // This utility does not define any custom properties.
43
+ //
44
+ // The following variables control the generated classes:
45
+ // | Variable | Description | Default Value |
46
+ // | ------------------------------------ | ----------------------------------------------------------- | ------------- |
47
+ // | `$selector-base` | Base selector for utility classes. | `"."` |
48
+ // | `$selector-prefix` | The selector prefix for all utility classes. | `""` |
49
+ // | `$selector-suffix` | The selctor suffix for all utility classes. | `""` |
50
+ // | `$selector-separator` | The selector separator for all utility classes. | `""` |
51
+ // | `$use-important` | Appends `!important` to generated utility declarations. | `true` |
52
+ // | `$generate-base-utilities` | Generates the base utility classes. | `true` |
53
+ // | `$screen-aware` | Enables screen-aware utility variants. | `false` |
54
+ // | `$theme-aware` | Enables theme-aware utility variants. | `false` |
55
+ // | `$scheme-aware` | Enables scheme-aware utility variants. | `false` |
56
+ // | `$state-aware` | Enables state-aware utility variants. | `false` |
57
+ // | `$container-aware` | Enables container-aware utility variants. | `false` |
58
+ // | `$screen-aware-selector-prefix` | Prefix to the screen-aware portion of utility selectors. | `""` |
59
+ // | `$screen-aware-selector-suffix` | Suffix to the screen-aware portion of utility selectors. | `""` |
60
+ // | `$screen-aware-selector-separator` | Separator inserted for screen-aware utility selectors. | `"\\:"` |
61
+ // | `$theme-aware-selector-prefix` | Prefix to the theme-aware portion of utility selectors. | `""` |
62
+ // | `$theme-aware-selector-suffix` | Suffix to the theme-aware portion of utility selectors. | `"-theme"` |
63
+ // | `$theme-aware-selector-separator` | Separator inserted for theme-aware utility selectors. | `"\\:"` |
64
+ // | `$scheme-aware-selector-prefix` | Prefix to the scheme-aware portion of utility selectors. | `""` |
65
+ // | `$scheme-aware-selector-suffix` | Suffix to the scheme-aware portion of utility selectors. | `"-mode"` |
66
+ // | `$scheme-aware-selector-separator` | Separator inserted for scheme-aware utility selectors. | `"\\:"` |
67
+ // | `$state-aware-selector-prefix` | Prefix to the state-aware portion of utility selectors. | `""` |
68
+ // | `$state-aware-selector-suffix` | Suffix to the state-aware portion of utility selectors. | `""` |
69
+ // | `$state-aware-selector-separator` | Separator inserted for state-aware utility selectors. | `"\\:"` |
70
+ // | `$container-aware-selector-prefix` | Prefix to the container-aware portion of utility selectors. | `"cq\\:"` |
71
+ // | `$container-aware-selector-suffix` | Suffix to the container-aware portion of utility selectors. | `""` |
72
+ // | `$container-aware-selector-separator`| Separator inserted for container-aware utility selectors. | `"\\:"` |
73
+ // | `$utility-properties` | Map of utility properties. | `()` |
74
+ // | `$utility-values` | Map of utility values. | `()` |
75
+ // | `$utility-map` | Map of utility property/value pairs. | `()` |
76
+ // | `$grid-row-min-count` | The minimum row count for generated utilities. | `1` |
77
+ // | `$grid-row-max-count` | The maximum row count for generated utilities. | `12` |
78
+ //
79
+ // Generating responsive utility classes can be done by setting `$screen-aware`, `$theme-aware`, `$scheme-aware`, `$state-aware`, or `$container-aware` to `true`.
80
+ // By default, no responsive utility classes are generated for grid-row.
81
+ //
82
+ // When set to true, screen-aware utility classes will be generated for each screen size in the following pattern: `.{screen-modifier}:{utility-selector}`
83
+ //
84
+ // e.g. `sm:row-start-2` will apply the `row-start-2` class on small-sized screens and up.
85
+ //
86
+ // When set to true, theme-aware utility classes will be generated for each theme in the following pattern: `.{theme-modifier}:{utility-selector}`
87
+ //
88
+ // e.g. `default-theme:row-start-2` will apply the `row-start-2` class when using the default theme.
89
+ //
90
+ // When set to true, scheme-aware utility classes will be generated for each theme in the following pattern: `.{scheme-modifier}:{utility-selector}`
91
+ //
92
+ // e.g. `dark-mode:row-start-2` will apply the `row-start-2` class when dark-mode is active.
93
+ //
94
+ // When set to true, state-aware utility classes will be generated for each state in the following pattern: `.{state-modifier}:{utility-selector}`
95
+ //
96
+ // e.g. `hover:row-start-2` will apply the `row-start-2` class when hovered.
97
+ //
98
+ // When set to true, container-aware utility classes will be generated for each container in the following pattern: `.{container-modifier}:{utility-selector}`
99
+ //
100
+ // e.g. `cq:md:row-start-2` will apply the `row-start-2` class on medium-sized containers and up.
101
+ //
102
+ // @example
103
+ // <div class="row-start-2">This content will start on row 2.</div>
104
+
105
+ @use "../../../mixins/layer" as *;
106
+ @use "../../../mixins/utility";
107
+ @use "defaults";
108
+ @use "variables" as *;
109
+
110
+ @include layer(utilities) {
111
+ // Create a utitlity for each entry in the utility map.
112
+ @include utility.generate(
113
+ $map: defaults.$utility-map,
114
+ $selector-base: defaults.$selector-base,
115
+ $selector-prefix: defaults.$selector-prefix,
116
+ $selector-suffix: defaults.$selector-suffix,
117
+ $screen-aware: defaults.$screen-aware,
118
+ $screen-aware-selector-prefix: defaults.$screen-aware-selector-prefix,
119
+ $screen-aware-selector-suffix: defaults.$screen-aware-selector-suffix,
120
+ $screen-aware-selector-separator: defaults.$screen-aware-selector-separator,
121
+ $theme-aware: defaults.$theme-aware,
122
+ $theme-aware-selector-prefix: defaults.$theme-aware-selector-prefix,
123
+ $theme-aware-selector-suffix: defaults.$theme-aware-selector-suffix,
124
+ $theme-aware-selector-separator: defaults.$theme-aware-selector-separator,
125
+ $scheme-aware: defaults.$scheme-aware,
126
+ $scheme-aware-selector-prefix: defaults.$scheme-aware-selector-prefix,
127
+ $scheme-aware-selector-suffix: defaults.$scheme-aware-selector-suffix,
128
+ $scheme-aware-selector-separator: defaults.$scheme-aware-selector-separator,
129
+ $state-aware: defaults.$state-aware,
130
+ $state-aware-selector-prefix: defaults.$state-aware-selector-prefix,
131
+ $state-aware-selector-suffix: defaults.$state-aware-selector-suffix,
132
+ $state-aware-selector-separator: defaults.$state-aware-selector-separator,
133
+ $container-aware: defaults.$container-aware,
134
+ $container-aware-selector-prefix: defaults.$container-aware-selector-prefix,
135
+ $container-aware-selector-suffix: defaults.$container-aware-selector-suffix,
136
+ $container-aware-selector-separator:
137
+ defaults.$container-aware-selector-separator,
138
+ $important: defaults.$use-important
139
+ );
140
+ }
@@ -0,0 +1,6 @@
1
+ // @graupl/core grid-row utilities variables.
2
+ //
3
+ // These values are to be used to directly style components and provide a
4
+ // cleaner way to reference custom properties.
5
+
6
+ @use "defaults";
@@ -0,0 +1,102 @@
1
+ // @graupl/core grid-template-columns utilities default values.
2
+ //
3
+ // Generally, these should not be used directly when styling components unless a static value is needed.
4
+ // They are mainly used to provide class selectors, fallbacks for custom properties, or loop values.
5
+ //
6
+ // They should not be used to define direct property values (i.e. font-size, color, etc.).
7
+ // Those should be defined as custom properties in the `_variables.scss` file.
8
+
9
+ @use "../defaults" as grid-defaults;
10
+ @use "../../../functions/utility";
11
+ @use "sass:map";
12
+ @use "sass:math";
13
+
14
+ // Utility modifiers.
15
+ $selector-base: grid-defaults.$selector-base !default;
16
+ $selector-prefix: grid-defaults.$selector-prefix !default;
17
+ $selector-suffix: grid-defaults.$selector-suffix !default;
18
+ $selector-separator: grid-defaults.$selector-separator !default;
19
+ $use-important: grid-defaults.$use-important !default;
20
+ $generate-base-utilities: grid-defaults.$generate-base-utilities !default;
21
+ $screen-aware: grid-defaults.$screen-aware !default;
22
+ $theme-aware: grid-defaults.$theme-aware !default;
23
+ $scheme-aware: grid-defaults.$scheme-aware !default;
24
+ $state-aware: grid-defaults.$state-aware !default;
25
+ $container-aware: grid-defaults.$container-aware !default;
26
+ $screen-aware-selector-prefix: grid-defaults.$screen-aware-selector-prefix !default;
27
+ $screen-aware-selector-suffix: grid-defaults.$screen-aware-selector-suffix !default;
28
+ $screen-aware-selector-separator: grid-defaults.$screen-aware-selector-separator !default;
29
+ $theme-aware-selector-prefix: grid-defaults.$theme-aware-selector-prefix !default;
30
+ $theme-aware-selector-suffix: grid-defaults.$theme-aware-selector-suffix !default;
31
+ $theme-aware-selector-separator: grid-defaults.$theme-aware-selector-separator !default;
32
+ $scheme-aware-selector-prefix: grid-defaults.$scheme-aware-selector-prefix !default;
33
+ $scheme-aware-selector-suffix: grid-defaults.$scheme-aware-selector-suffix !default;
34
+ $scheme-aware-selector-separator: grid-defaults.$scheme-aware-selector-separator !default;
35
+ $state-aware-selector-prefix: grid-defaults.$state-aware-selector-prefix !default;
36
+ $state-aware-selector-suffix: grid-defaults.$state-aware-selector-suffix !default;
37
+ $state-aware-selector-separator: grid-defaults.$state-aware-selector-separator !default;
38
+ $container-aware-selector-prefix: grid-defaults.$container-aware-selector-prefix !default;
39
+ $container-aware-selector-suffix: grid-defaults.$container-aware-selector-suffix !default;
40
+ $container-aware-selector-separator: grid-defaults.$container-aware-selector-separator !default;
41
+ $grid-column-min-count: grid-defaults.$grid-column-min-count;
42
+ $grid-column-max-count: grid-defaults.$grid-column-max-count;
43
+
44
+ // Properties.
45
+ $-utility-properties: (
46
+ "grid-cols": grid-template-columns,
47
+ );
48
+ $utility-properties: () !default;
49
+
50
+ // Values.
51
+ $-utility-values: (
52
+ "auto": auto,
53
+ "subgrid": subgrid,
54
+ );
55
+ $utility-values: () !default;
56
+
57
+ // Add the count values to the base values.
58
+ @for $i from $grid-column-min-count through $grid-column-max-count {
59
+ $-utility-values: map.merge(
60
+ $-utility-values,
61
+ (
62
+ math.abs($i): repeat($i, minmax(0, 1fr)),
63
+ )
64
+ );
65
+ }
66
+
67
+ // Merge custom and base properties/values if generating base utilities.
68
+ @if $generate-base-utilities {
69
+ $utility-properties: map.deep-merge(
70
+ $-utility-properties,
71
+ $utility-properties
72
+ );
73
+ $utility-values: map.deep-merge($-utility-values, $utility-values);
74
+ }
75
+
76
+ // Set up all utility classes and properties for cleaner generation in the index file.
77
+ //
78
+ // The end result of this map is something like:
79
+ // $-utility-map: (
80
+ // class-name: (
81
+ // property: value,
82
+ // property: value,
83
+ // ...
84
+ // ),
85
+ // class-name: (
86
+ // property: value,
87
+ // property: value,
88
+ // ...
89
+ // ),
90
+ // ...
91
+ // );
92
+ $-utility-map: ();
93
+ $-utility-map: map.deep-merge(
94
+ $-utility-map,
95
+ utility.generate-utility-map(
96
+ $utility-properties,
97
+ $utility-values,
98
+ $selector-separator
99
+ )
100
+ );
101
+ $utility-map: () !default;
102
+ $utility-map: map.deep-merge($-utility-map, $utility-map);
@@ -0,0 +1,124 @@
1
+ // @graupl/core grid-template-columns utilities styles.
2
+ //
3
+ // This file generates the grid utility classes provided by Graupl.
4
+ //
5
+ // The following classes are generated by default:
6
+ // - `.grid-cols-auto`: Sets the `grid-template-columns` property to `auto`.
7
+ // - `.grid-cols-subgrid`: Sets the `grid-template-columns` property to `subgrid`.
8
+ // - `.grid-cols-1`: Sets the `grid-template-columns` property to `1`.
9
+ // - `.grid-cols-2`: Sets the `grid-template-columns` property to `2`.
10
+ // - `.grid-cols-3`: Sets the `grid-template-columns` property to `3`.
11
+ // - `.grid-cols-4`: Sets the `grid-template-columns` property to `4`.
12
+ // - `.grid-cols-5`: Sets the `grid-template-columns` property to `5`.
13
+ // - `.grid-cols-6`: Sets the `grid-template-columns` property to `6`.
14
+ // - `.grid-cols-7`: Sets the `grid-template-columns` property to `7`.
15
+ // - `.grid-cols-8`: Sets the `grid-template-columns` property to `8`.
16
+ // - `.grid-cols-9`: Sets the `grid-template-columns` property to `9`.
17
+ // - `.grid-cols-10`: Sets the `grid-template-columns` property to `10`.
18
+ // - `.grid-cols-11`: Sets the `grid-template-columns` property to `11`.
19
+ // - `.grid-cols-12`: Sets the `grid-template-columns` property to `12`.
20
+ //
21
+ // The following custom properties control the generated classes:
22
+ // | Property | Description | Default Value |
23
+ // | -------- | ----------- | ------------- |
24
+ // | N/A | N/A | N/A |
25
+ //
26
+ // This utility does not define any custom properties.
27
+ //
28
+ // The following variables control the generated classes:
29
+ // | Variable | Description | Default Value |
30
+ // | ------------------------------------ | ----------------------------------------------------------- | ------------- |
31
+ // | `$selector-base` | Base selector for utility classes. | `"."` |
32
+ // | `$selector-prefix` | The selector prefix for all utility classes. | `""` |
33
+ // | `$selector-suffix` | The selctor suffix for all utility classes. | `""` |
34
+ // | `$selector-separator` | The selector separator for all utility classes. | `""` |
35
+ // | `$use-important` | Appends `!important` to generated utility declarations. | `true` |
36
+ // | `$generate-base-utilities` | Generates the base utility classes. | `true` |
37
+ // | `$screen-aware` | Enables screen-aware utility variants. | `false` |
38
+ // | `$theme-aware` | Enables theme-aware utility variants. | `false` |
39
+ // | `$scheme-aware` | Enables scheme-aware utility variants. | `false` |
40
+ // | `$state-aware` | Enables state-aware utility variants. | `false` |
41
+ // | `$container-aware` | Enables container-aware utility variants. | `false` |
42
+ // | `$screen-aware-selector-prefix` | Prefix to the screen-aware portion of utility selectors. | `""` |
43
+ // | `$screen-aware-selector-suffix` | Suffix to the screen-aware portion of utility selectors. | `""` |
44
+ // | `$screen-aware-selector-separator` | Separator inserted for screen-aware utility selectors. | `"\\:"` |
45
+ // | `$theme-aware-selector-prefix` | Prefix to the theme-aware portion of utility selectors. | `""` |
46
+ // | `$theme-aware-selector-suffix` | Suffix to the theme-aware portion of utility selectors. | `"-theme"` |
47
+ // | `$theme-aware-selector-separator` | Separator inserted for theme-aware utility selectors. | `"\\:"` |
48
+ // | `$scheme-aware-selector-prefix` | Prefix to the scheme-aware portion of utility selectors. | `""` |
49
+ // | `$scheme-aware-selector-suffix` | Suffix to the scheme-aware portion of utility selectors. | `"-mode"` |
50
+ // | `$scheme-aware-selector-separator` | Separator inserted for scheme-aware utility selectors. | `"\\:"` |
51
+ // | `$state-aware-selector-prefix` | Prefix to the state-aware portion of utility selectors. | `""` |
52
+ // | `$state-aware-selector-suffix` | Suffix to the state-aware portion of utility selectors. | `""` |
53
+ // | `$state-aware-selector-separator` | Separator inserted for state-aware utility selectors. | `"\\:"` |
54
+ // | `$container-aware-selector-prefix` | Prefix to the container-aware portion of utility selectors. | `"cq\\:"` |
55
+ // | `$container-aware-selector-suffix` | Suffix to the container-aware portion of utility selectors. | `""` |
56
+ // | `$container-aware-selector-separator`| Separator inserted for container-aware utility selectors. | `"\\:"` |
57
+ // | `$utility-properties` | Map of utility properties. | `()` |
58
+ // | `$utility-values` | Map of utility values. | `()` |
59
+ // | `$utility-map` | Map of utility property/value pairs. | `()` |
60
+ // | `$grid-column-min-count` | The minimum column count for generated utilities. | `1` |
61
+ // | `$grid-column-max-count` | The maximum column count for generated utilities. | `12` |
62
+ //
63
+ // Generating responsive utility classes can be done by setting `$screen-aware`, `$theme-aware`, `$scheme-aware`, `$state-aware`, or `$container-aware` to `true`.
64
+ // By default, no responsive utility classes are generated for grid-template-columns.
65
+ //
66
+ // When set to true, screen-aware utility classes will be generated for each screen size in the following pattern: `.{screen-modifier}:{utility-selector}`
67
+ //
68
+ // e.g. `sm:grid-cols-5` will apply the `grid-cols-5` class on small-sized screens and up.
69
+ //
70
+ // When set to true, theme-aware utility classes will be generated for each theme in the following pattern: `.{theme-modifier}:{utility-selector}`
71
+ //
72
+ // e.g. `default-theme:grid-cols-5` will apply the `grid-cols-5` class when using the default theme.
73
+ //
74
+ // When set to true, scheme-aware utility classes will be generated for each theme in the following pattern: `.{scheme-modifier}:{utility-selector}`
75
+ //
76
+ // e.g. `dark-mode:grid-cols-5` will apply the `grid-cols-5` class when dark-mode is active.
77
+ //
78
+ // When set to true, state-aware utility classes will be generated for each state in the following pattern: `.{state-modifier}:{utility-selector}`
79
+ //
80
+ // e.g. `hover:grid-cols-5` will apply the `grid-cols-5` class when hovered.
81
+ //
82
+ // When set to true, container-aware utility classes will be generated for each container in the following pattern: `.{container-modifier}:{utility-selector}`
83
+ //
84
+ // e.g. `cq:md:grid-cols-5` will apply the `grid-cols-5` class on medium-sized containers and up.
85
+ //
86
+ // @example
87
+ // <div class="display-grid grid-cols-5">This content will have 5 columns.</div>
88
+
89
+ @use "../../../mixins/layer" as *;
90
+ @use "../../../mixins/utility";
91
+ @use "defaults";
92
+ @use "variables" as *;
93
+
94
+ @include layer(utilities) {
95
+ // Create a utitlity for each entry in the utility map.
96
+ @include utility.generate(
97
+ $map: defaults.$utility-map,
98
+ $selector-base: defaults.$selector-base,
99
+ $selector-prefix: defaults.$selector-prefix,
100
+ $selector-suffix: defaults.$selector-suffix,
101
+ $screen-aware: defaults.$screen-aware,
102
+ $screen-aware-selector-prefix: defaults.$screen-aware-selector-prefix,
103
+ $screen-aware-selector-suffix: defaults.$screen-aware-selector-suffix,
104
+ $screen-aware-selector-separator: defaults.$screen-aware-selector-separator,
105
+ $theme-aware: defaults.$theme-aware,
106
+ $theme-aware-selector-prefix: defaults.$theme-aware-selector-prefix,
107
+ $theme-aware-selector-suffix: defaults.$theme-aware-selector-suffix,
108
+ $theme-aware-selector-separator: defaults.$theme-aware-selector-separator,
109
+ $scheme-aware: defaults.$scheme-aware,
110
+ $scheme-aware-selector-prefix: defaults.$scheme-aware-selector-prefix,
111
+ $scheme-aware-selector-suffix: defaults.$scheme-aware-selector-suffix,
112
+ $scheme-aware-selector-separator: defaults.$scheme-aware-selector-separator,
113
+ $state-aware: defaults.$state-aware,
114
+ $state-aware-selector-prefix: defaults.$state-aware-selector-prefix,
115
+ $state-aware-selector-suffix: defaults.$state-aware-selector-suffix,
116
+ $state-aware-selector-separator: defaults.$state-aware-selector-separator,
117
+ $container-aware: defaults.$container-aware,
118
+ $container-aware-selector-prefix: defaults.$container-aware-selector-prefix,
119
+ $container-aware-selector-suffix: defaults.$container-aware-selector-suffix,
120
+ $container-aware-selector-separator:
121
+ defaults.$container-aware-selector-separator,
122
+ $important: defaults.$use-important
123
+ );
124
+ }
@@ -0,0 +1,6 @@
1
+ // @graupl/core grid-template-columns utilities variables.
2
+ //
3
+ // These values are to be used to directly style components and provide a
4
+ // cleaner way to reference custom properties.
5
+
6
+ @use "defaults";