@greese/ui 1.0.0 → 1.2.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.
Files changed (210) hide show
  1. package/README.md +19 -14
  2. package/dist/_maps.scss +1 -1
  3. package/dist/_tokens-base.scss +30 -6
  4. package/dist/_tokens.scss +31 -2
  5. package/dist/_utilities-table.scss +1615 -0
  6. package/dist/clipboard.d.ts +18 -0
  7. package/dist/clipboard.js +62 -0
  8. package/dist/css/Button.css +2 -2
  9. package/dist/css/Carousel.css +145 -47
  10. package/dist/css/Checkbox.css +2 -2
  11. package/dist/css/Chip.css +38 -8
  12. package/dist/css/ChoiceGroup.css +42 -1
  13. package/dist/css/Collapsible.css +1 -0
  14. package/dist/css/ColorPicker.css +84 -0
  15. package/dist/css/Combobox.css +2 -2
  16. package/dist/css/Dialog.css +24 -22
  17. package/dist/css/EditableField.css +219 -0
  18. package/dist/css/Input.css +11 -2
  19. package/dist/css/Menu.css +9 -0
  20. package/dist/css/NumberField.css +53 -8
  21. package/dist/css/NumberStepper.css +9 -0
  22. package/dist/css/OtpField.css +1 -1
  23. package/dist/css/PageTransition.css +12 -0
  24. package/dist/css/Radio.css +2 -2
  25. package/dist/css/ScrollCarousel.css +225 -0
  26. package/dist/css/SegmentedControl.css +2 -2
  27. package/dist/css/Select.css +3 -2
  28. package/dist/css/Slider.css +45 -5
  29. package/dist/css/Switch.css +6 -6
  30. package/dist/css/Text.css +14 -14
  31. package/dist/css/Textarea.css +1 -1
  32. package/dist/css/core.css +36 -6
  33. package/dist/css/resets.css +162 -0
  34. package/dist/css.d.ts +2 -0
  35. package/dist/css.js +2 -0
  36. package/dist/greese.css +990 -138
  37. package/dist/index.d.ts +2 -1
  38. package/dist/index.js +2 -1
  39. package/dist/scss/components/_Accordion.scss +2 -0
  40. package/dist/scss/components/_ActionSelect.scss +2 -0
  41. package/dist/scss/components/_Alert.scss +2 -0
  42. package/dist/scss/components/_AppBar.scss +2 -0
  43. package/dist/scss/components/_AspectRatio.scss +2 -0
  44. package/dist/scss/components/_AutoLayout.scss +2 -0
  45. package/dist/scss/components/_Avatar.scss +2 -0
  46. package/dist/scss/components/_Badge.scss +2 -0
  47. package/dist/scss/components/_Box.scss +2 -0
  48. package/dist/scss/components/_Breadcrumbs.scss +2 -0
  49. package/dist/scss/components/_Button.scss +2 -0
  50. package/dist/scss/components/_ButtonGroup.scss +2 -0
  51. package/dist/scss/components/_Card.scss +2 -0
  52. package/dist/scss/components/_Carousel.scss +2 -0
  53. package/dist/scss/components/_Center.scss +2 -0
  54. package/dist/scss/components/_ChatBubble.scss +2 -0
  55. package/dist/scss/components/_Checkbox.scss +2 -0
  56. package/dist/scss/components/_Chip.scss +2 -0
  57. package/dist/scss/components/_ChoiceGroup.scss +2 -0
  58. package/dist/scss/components/_Code.scss +2 -0
  59. package/dist/scss/components/_Collapsible.scss +2 -0
  60. package/dist/scss/components/_ColorPicker.scss +2 -0
  61. package/dist/scss/components/_Combobox.scss +2 -0
  62. package/dist/scss/components/_Container.scss +2 -0
  63. package/dist/scss/components/_Countdown.scss +2 -0
  64. package/dist/scss/components/_DateField.scss +2 -0
  65. package/dist/scss/components/_Dialog.scss +2 -0
  66. package/dist/scss/components/_Diff.scss +2 -0
  67. package/dist/scss/components/_Divider.scss +2 -0
  68. package/dist/scss/components/_Dock.scss +2 -0
  69. package/dist/scss/components/_EditableField.scss +2 -0
  70. package/dist/scss/components/_Field.scss +2 -0
  71. package/dist/scss/components/_Fieldset.scss +2 -0
  72. package/dist/scss/components/_FileInput.scss +2 -0
  73. package/dist/scss/components/_Footer.scss +2 -0
  74. package/dist/scss/components/_Grid.scss +2 -0
  75. package/dist/scss/components/_Header.scss +2 -0
  76. package/dist/scss/components/_Heading.scss +2 -0
  77. package/dist/scss/components/_Icon.scss +2 -0
  78. package/dist/scss/components/_IconButton.scss +2 -0
  79. package/dist/scss/components/_Image.scss +2 -0
  80. package/dist/scss/components/_Indicator.scss +2 -0
  81. package/dist/scss/components/_Input.scss +2 -0
  82. package/dist/scss/components/_Key.scss +2 -0
  83. package/dist/scss/components/_Link.scss +2 -0
  84. package/dist/scss/components/_List.scss +2 -0
  85. package/dist/scss/components/_Media.scss +2 -0
  86. package/dist/scss/components/_Menu.scss +2 -0
  87. package/dist/scss/components/_Motion.scss +2 -0
  88. package/dist/scss/components/_NumberField.scss +2 -0
  89. package/dist/scss/components/_NumberStepper.scss +2 -0
  90. package/dist/scss/components/_OtpField.scss +2 -0
  91. package/dist/scss/components/_PageTransition.scss +2 -0
  92. package/dist/scss/components/_Pagination.scss +2 -0
  93. package/dist/scss/components/_Popover.scss +2 -0
  94. package/dist/scss/components/_Progress.scss +2 -0
  95. package/dist/scss/components/_RadialProgress.scss +2 -0
  96. package/dist/scss/components/_Radio.scss +2 -0
  97. package/dist/scss/components/_Rating.scss +2 -0
  98. package/dist/scss/components/_ScrollCarousel.scss +2 -0
  99. package/dist/scss/components/_ScrollSpy.scss +2 -0
  100. package/dist/scss/components/_SegmentedControl.scss +2 -0
  101. package/dist/scss/components/_Select.scss +2 -0
  102. package/dist/scss/components/_Sidebar.scss +2 -0
  103. package/dist/scss/components/_Skeleton.scss +2 -0
  104. package/dist/scss/components/_Slider.scss +2 -0
  105. package/dist/scss/components/_Spacer.scss +2 -0
  106. package/dist/scss/components/_SpeedDial.scss +2 -0
  107. package/dist/scss/components/_Spinner.scss +2 -0
  108. package/dist/scss/components/_Stack.scss +2 -0
  109. package/dist/scss/components/_Stat.scss +2 -0
  110. package/dist/scss/components/_Status.scss +2 -0
  111. package/dist/scss/components/_Steps.scss +2 -0
  112. package/dist/scss/components/_Swap.scss +2 -0
  113. package/dist/scss/components/_Switch.scss +2 -0
  114. package/dist/scss/components/_Table.scss +2 -0
  115. package/dist/scss/components/_Tabs.scss +2 -0
  116. package/dist/scss/components/_Text.scss +2 -0
  117. package/dist/scss/components/_TextRotate.scss +2 -0
  118. package/dist/scss/components/_Textarea.scss +2 -0
  119. package/dist/scss/components/_ThemeProvider.scss +2 -0
  120. package/dist/scss/components/_Tile.scss +2 -0
  121. package/dist/scss/components/_Toast.scss +2 -0
  122. package/dist/scss/components/_ToggleButton.scss +2 -0
  123. package/dist/scss/components/_Tooltip.scss +2 -0
  124. package/dist/scss/components/_Type.scss +2 -0
  125. package/dist/scss/components/_Visibility.scss +2 -0
  126. package/dist/scss/components/_VisuallyHidden.scss +2 -0
  127. package/dist/shapes.d.ts +12 -1
  128. package/dist/shapes.js +11 -10
  129. package/dist/style-manifest.json +18837 -132
  130. package/dist/theme.js +6 -1
  131. package/dist/themeFiles/index.d.ts +9 -0
  132. package/dist/themeFiles/index.js +9 -0
  133. package/dist/themeFiles/scssModule.d.ts +100 -0
  134. package/dist/themeFiles/scssModule.js +384 -0
  135. package/dist/themeFiles/spec.d.ts +198 -0
  136. package/dist/themeFiles/spec.js +877 -0
  137. package/dist/tokens.css +30 -1
  138. package/dist/typography.js +1 -1
  139. package/dist/utilities.css +435 -0
  140. package/dist/utilities.d.ts +8 -0
  141. package/dist/utilities.js +75 -0
  142. package/package.json +20 -1
  143. package/src/components/AutoLayout/AutoLayout.scss +2 -26
  144. package/src/components/Carousel/Carousel.scss +122 -126
  145. package/src/components/Checkbox/Checkbox.scss +2 -2
  146. package/src/components/Chip/Chip.scss +63 -8
  147. package/src/components/ChoiceGroup/ChoiceGroup.scss +19 -1
  148. package/src/components/Collapsible/Collapsible.scss +3 -0
  149. package/src/components/ColorPicker/ColorPicker.scss +95 -0
  150. package/src/components/Combobox/Combobox.scss +4 -2
  151. package/src/components/Dialog/Dialog.scss +24 -7
  152. package/src/components/EditableField/EditableField.scss +275 -0
  153. package/src/components/Grid/Grid.scss +2 -70
  154. package/src/components/Input/Input.scss +29 -0
  155. package/src/components/Menu/Menu.scss +18 -0
  156. package/src/components/NumberField/NumberField.scss +56 -9
  157. package/src/components/NumberStepper/NumberStepper.scss +13 -0
  158. package/src/components/PageTransition/PageTransition.scss +29 -0
  159. package/src/components/Radio/Radio.scss +2 -2
  160. package/src/components/ScrollCarousel/ScrollCarousel.scss +142 -0
  161. package/src/components/Select/Select.scss +4 -0
  162. package/src/components/Slider/Slider.scss +51 -6
  163. package/src/components/Stack/Stack.scss +2 -48
  164. package/src/components/Switch/Switch.scss +9 -6
  165. package/src/components/Text/Text.scss +5 -2
  166. package/src/styles/_breakpoint-vars.scss +17 -11
  167. package/src/styles/_controls.scss +2 -2
  168. package/src/styles/_core.scss +1 -0
  169. package/src/styles/_kit.scss +483 -56
  170. package/src/styles/_layout-props.scss +197 -0
  171. package/src/styles/_manifest.scss +55 -25
  172. package/src/styles/_mixins.scss +53 -15
  173. package/src/styles/_slides.scss +112 -0
  174. package/src/styles/_utilities.scss +104 -0
  175. package/src/styles/breakpoints.test.ts +21 -1
  176. package/src/styles/entryPoints.test.ts +25 -2
  177. package/src/styles/index.scss +3 -1
  178. package/src/styles/kit.test.ts +171 -1
  179. package/src/styles/public/_breakpoints.scss +43 -0
  180. package/src/styles/public/_slides.scss +3 -0
  181. package/src/styles/public/_utilities.scss +3 -0
  182. package/src/styles/resets.scss +7 -0
  183. package/src/styles/utilities.test.ts +39 -0
  184. package/themes/bevel.css +187 -187
  185. package/themes/bevel.scss +960 -958
  186. package/themes/candy.css +87 -0
  187. package/themes/candy.scss +32 -0
  188. package/themes/extrude.css +42 -42
  189. package/themes/folio.css +200 -200
  190. package/themes/folio.scss +880 -878
  191. package/themes/forest.css +87 -0
  192. package/themes/forest.scss +32 -0
  193. package/themes/grape.css +87 -0
  194. package/themes/grape.scss +32 -0
  195. package/themes/greese.css +36 -0
  196. package/themes/greese.scss +21 -0
  197. package/themes/mono.css +87 -0
  198. package/themes/mono.scss +32 -0
  199. package/themes/ocean.css +87 -0
  200. package/themes/ocean.scss +32 -0
  201. package/themes/outline.css +18 -18
  202. package/themes/pebble.css +8 -8
  203. package/themes/ridge.css +188 -188
  204. package/themes/ridge.scss +820 -818
  205. package/themes/soft.css +11 -11
  206. package/themes/sunset.css +87 -0
  207. package/themes/sunset.scss +32 -0
  208. package/themes/ticket.css +180 -180
  209. package/themes/ticket.scss +881 -879
  210. package/themes/tilt.css +25 -25
@@ -0,0 +1,142 @@
1
+ @use '../../styles/mixins';
2
+ @use '../../styles/slides';
3
+
4
+ @layer greese.components {
5
+ .greese-ScrollCarousel {
6
+ @include mixins.component-root;
7
+
8
+ position: relative;
9
+ display: grid;
10
+ gap: var(--greese-space-3);
11
+ min-inline-size: 0;
12
+ }
13
+
14
+ // Native scrolling and snapping: swipe, trackpad and keys all work.
15
+ .greese-ScrollCarousel-viewport {
16
+ --greese-scrollcarousel-per-view: 1;
17
+ --greese-scrollcarousel-gap: var(--greese-space-3);
18
+
19
+ display: flex;
20
+ gap: var(--greese-scrollcarousel-gap);
21
+ overflow-x: auto;
22
+ overscroll-behavior-x: contain;
23
+ scroll-snap-type: x mandatory;
24
+ scrollbar-width: none;
25
+ border-radius: var(--greese-corner-panel);
26
+
27
+ &::-webkit-scrollbar {
28
+ display: none;
29
+ }
30
+
31
+ @include mixins.focus-ring;
32
+
33
+ // The buttons and dots read this to choose a smooth or instant scroll.
34
+ @include mixins.motion-safe {
35
+ scroll-behavior: smooth;
36
+ }
37
+ }
38
+
39
+ // Vertical: a column in a viewport of its own height, snapping on y.
40
+ .greese-ScrollCarousel--vertical > .greese-ScrollCarousel-viewport {
41
+ flex-direction: column;
42
+ block-size: var(--greese-scrollcarousel-size, 20rem);
43
+ overflow: hidden auto;
44
+ overscroll-behavior: auto contain;
45
+ scroll-snap-type: y mandatory;
46
+ }
47
+
48
+ // Each slide's width: the viewport shared by `per-view` slides and the gaps.
49
+ .greese-ScrollCarouselSlide {
50
+ --greese-scrollcarousel-gaps: calc(
51
+ (var(--greese-scrollcarousel-per-view) - 1) * var(--greese-scrollcarousel-gap)
52
+ );
53
+
54
+ flex: 0 0
55
+ calc(
56
+ (100% - var(--greese-scrollcarousel-gaps)) / var(--greese-scrollcarousel-per-view)
57
+ );
58
+ min-inline-size: 0;
59
+ scroll-snap-align: start;
60
+ }
61
+
62
+ @include slides.controls('greese-ScrollCarousel', scrollcarousel);
63
+
64
+ // Vertical: the buttons sit centred on the top and bottom edges, the
65
+ // chevron turned to point up and down.
66
+ .greese-ScrollCarousel--vertical > .greese-ScrollCarousel-control {
67
+ inset-inline: 0;
68
+ margin-inline: auto;
69
+ translate: none;
70
+
71
+ > svg {
72
+ rotate: 90deg;
73
+ scale: 1;
74
+ }
75
+ }
76
+
77
+ .greese-ScrollCarousel--vertical > .greese-ScrollCarousel-control--previous {
78
+ inset-block-start: var(--greese-space-2);
79
+ }
80
+
81
+ .greese-ScrollCarousel--vertical > .greese-ScrollCarousel-control--next {
82
+ inset-block: auto calc(var(--greese-space-2) + var(--greese-scrollcarousel-dots, 0px));
83
+
84
+ > svg {
85
+ rotate: -90deg;
86
+ }
87
+ }
88
+
89
+ // A strip of controls (tabs, a toolbar): each as wide as its content, no
90
+ // snapping, and small buttons over the ends that scroll it a view along.
91
+ .greese-ScrollCarousel--strip {
92
+ gap: 0;
93
+
94
+ > .greese-ScrollCarousel-viewport {
95
+ --greese-scrollcarousel-gap: var(--greese-space-1);
96
+
97
+ align-items: center;
98
+ scroll-snap-type: none;
99
+ border-radius: 0;
100
+ }
101
+
102
+ > .greese-ScrollCarousel-control {
103
+ inset-block-start: 50%;
104
+ inline-size: 1.5rem;
105
+ block-size: 1.5rem;
106
+ box-shadow: var(--greese-shadow-sm);
107
+
108
+ > svg {
109
+ inline-size: 0.875rem;
110
+ block-size: 0.875rem;
111
+ }
112
+ }
113
+
114
+ > .greese-ScrollCarousel-control--previous {
115
+ inset-inline-start: 0;
116
+ }
117
+
118
+ > .greese-ScrollCarousel-control--next {
119
+ inset-inline-end: 0;
120
+ }
121
+ }
122
+
123
+ .greese-ScrollCarousel--strip
124
+ > .greese-ScrollCarousel-viewport
125
+ > .greese-ScrollCarouselSlide {
126
+ flex: none;
127
+ scroll-snap-align: none;
128
+ }
129
+
130
+ // Phones swipe; the buttons come back where a pointer can hover.
131
+ @media (hover: none) {
132
+ .greese-ScrollCarousel-control {
133
+ display: none;
134
+ }
135
+ }
136
+
137
+ @include mixins.responsive-prop(
138
+ 'greese-ScrollCarousel',
139
+ 'per-view',
140
+ --greese-scrollcarousel-per-view
141
+ );
142
+ }
@@ -17,6 +17,10 @@
17
17
  padding-inline: var(--greese-select-padding)
18
18
  calc(var(--greese-select-padding) + 1.5em);
19
19
  font: inherit;
20
+
21
+ // A line no taller than the text, so the frame's height is the size's on
22
+ // every pointer, not the font's default line.
23
+ line-height: 1.25;
20
24
  color: inherit;
21
25
  cursor: pointer;
22
26
  background: none;
@@ -1,3 +1,5 @@
1
+ @use 'sass:map';
2
+ @use '../../styles/controls';
1
3
  @use '../../styles/mixins';
2
4
 
3
5
  // Vendor pseudo-elements are the only way to style range parts.
@@ -13,6 +15,18 @@
13
15
  border-radius: var(--greese-corner-pill);
14
16
  }
15
17
 
18
+ // The thumb's size, on the wrapper as well as the slider: a custom property
19
+ // inherits down, and the bubble's anchor is the slider's sibling, so reading
20
+ // it from the slider alone would leave the anchor's `calc()` invalid.
21
+ @mixin thumb-size {
22
+ --greese-slider-thumb: 1.25rem;
23
+
24
+ // A thumb big enough for fingers.
25
+ @media (pointer: coarse) {
26
+ --greese-slider-thumb: 1.75rem;
27
+ }
28
+ }
29
+
16
30
  @mixin thumb {
17
31
  box-sizing: border-box;
18
32
  inline-size: var(--greese-slider-thumb);
@@ -24,8 +38,44 @@
24
38
  }
25
39
 
26
40
  @layer greese.components {
41
+ // The thumb follows the control scale, so a slider in a row of inputs is
42
+ // the same height as they are.
43
+ @each $size, $spec in controls.$sizes {
44
+ .greese-Slider--size-#{$size} {
45
+ --greese-slider-thumb: calc(#{map.get($spec, height)} * 0.5);
46
+ }
47
+ }
48
+
49
+ // Only present when the slider shows a value bubble, so a plain slider's
50
+ // markup is unchanged.
51
+ .greese-Slider-wrap {
52
+ @include thumb-size;
53
+
54
+ position: relative;
55
+ display: block;
56
+ }
57
+
58
+ // A zero-size anchor sitting at the centre of the thumb, so the bubble
59
+ // follows the value. The thumb's travel is inset by half its width at each
60
+ // end, which is why this is not simply the fill percentage.
61
+ .greese-Slider-thumbAnchor {
62
+ --greese-slider-travel: calc(100% - var(--greese-slider-thumb));
63
+ --greese-slider-offset: calc(
64
+ var(--greese-slider-travel) * var(--greese-slider-ratio, 0)
65
+ );
66
+
67
+ position: absolute;
68
+ inset-block-start: 0;
69
+ inset-inline-start: calc(
70
+ var(--greese-slider-thumb) / 2 + var(--greese-slider-offset)
71
+ );
72
+ inline-size: 0;
73
+ block-size: var(--greese-slider-thumb);
74
+ }
75
+
27
76
  .greese-Slider {
28
- --greese-slider-thumb: 1.25rem;
77
+ @include thumb-size;
78
+
29
79
  --greese-slider-towards: right;
30
80
 
31
81
  @include mixins.component-root;
@@ -42,11 +92,6 @@
42
92
  --greese-slider-towards: left;
43
93
  }
44
94
 
45
- // A thumb big enough for fingers.
46
- @media (pointer: coarse) {
47
- --greese-slider-thumb: 1.75rem;
48
- }
49
-
50
95
  &:focus-visible {
51
96
  outline: none;
52
97
  }
@@ -1,4 +1,4 @@
1
- @use '../../styles/mixins';
1
+ @use '../../styles/layout-props';
2
2
 
3
3
  @layer greese.components {
4
4
  .greese-Stack {
@@ -7,51 +7,5 @@
7
7
  min-inline-size: 0;
8
8
  }
9
9
 
10
- @include mixins.responsive-prop(
11
- 'greese-Stack',
12
- 'direction',
13
- flex-direction,
14
- (
15
- row: row,
16
- column: column,
17
- row-reverse: row-reverse,
18
- column-reverse: column-reverse,
19
- )
20
- );
21
- @include mixins.responsive-prop('greese-Stack', 'gap', gap, mixins.space-tokens());
22
- @include mixins.responsive-prop(
23
- 'greese-Stack',
24
- 'align',
25
- align-items,
26
- (
27
- start: flex-start,
28
- center: center,
29
- end: flex-end,
30
- stretch: stretch,
31
- baseline: baseline,
32
- )
33
- );
34
- @include mixins.responsive-prop(
35
- 'greese-Stack',
36
- 'justify',
37
- justify-content,
38
- (
39
- start: flex-start,
40
- center: center,
41
- end: flex-end,
42
- between: space-between,
43
- around: space-around,
44
- evenly: space-evenly,
45
- )
46
- );
47
- @include mixins.responsive-prop(
48
- 'greese-Stack',
49
- 'wrap',
50
- flex-wrap,
51
- (
52
- wrap: wrap,
53
- nowrap: nowrap,
54
- wrap-reverse: wrap-reverse,
55
- )
56
- );
10
+ @include layout-props.stack;
57
11
  }
@@ -6,8 +6,8 @@
6
6
  display: inline-flex;
7
7
  flex-shrink: 0;
8
8
  align-items: center;
9
- inline-size: 2.25rem;
10
- block-size: 1.25rem;
9
+ inline-size: calc(var(--greese-choice-box, 1.125rem) * 2);
10
+ block-size: calc(var(--greese-choice-box, 1.125rem) * 1.111);
11
11
  margin-block: calc((1lh - 1.25rem) / 2);
12
12
  }
13
13
 
@@ -43,8 +43,8 @@
43
43
 
44
44
  .greese-Switch-thumb {
45
45
  position: relative;
46
- inline-size: 1rem;
47
- block-size: 1rem;
46
+ inline-size: calc(var(--greese-choice-box, 1.125rem) * 0.889);
47
+ block-size: calc(var(--greese-choice-box, 1.125rem) * 0.889);
48
48
  margin-inline-start: 0.125rem;
49
49
  pointer-events: none;
50
50
  background-color: var(--greese-color-canvas);
@@ -53,11 +53,14 @@
53
53
  transition: translate var(--greese-duration-fast) var(--greese-easing-standard);
54
54
  }
55
55
 
56
+ // The track's width less the thumb and a margin each side (the thumb is
57
+ // 0.889 of a box and the track 2), so it ends inside the track at every
58
+ // size: a fixed 1rem overshot the small one.
56
59
  .greese-Switch-input:checked + .greese-Switch-thumb {
57
- translate: 1rem 0;
60
+ translate: calc(125% - 0.25rem) 0;
58
61
 
59
62
  &:dir(rtl) {
60
- translate: -1rem 0;
63
+ translate: calc(0.25rem - 125%) 0;
61
64
  }
62
65
  }
63
66
  }
@@ -6,14 +6,17 @@
6
6
  margin: 0;
7
7
  }
8
8
 
9
+ // Doubled with `.greese-Text` to beat the type variant every Text carries
10
+ // (`greese-Type--p1` when none is named), which comes later and sets weight
11
+ // and colour too. Text only renders a weight with no variant named.
9
12
  @each $weight in (regular, medium, semibold, bold) {
10
- .greese-Text--#{$weight} {
13
+ .greese-Text.greese-Text--#{$weight} {
11
14
  font-weight: var(--greese-font-weight-#{$weight});
12
15
  }
13
16
  }
14
17
 
15
18
  @each $tone, $pair in tones.$tones {
16
- .greese-Text--#{$tone} {
19
+ .greese-Text.greese-Text--#{$tone} {
17
20
  color: list.nth($pair, 1);
18
21
  }
19
22
  }
@@ -1,16 +1,22 @@
1
- // Built with your own breakpoints (changed values or extra keys): the tokens
2
- // declare the defaults' `--greese-breakpoint-*` custom properties, so
3
- // redeclare every one with the configured values. Nothing is emitted for the
4
- // defaults.
1
+ // The breakpoints the stylesheet is built with, as custom properties for CSS
2
+ // and JavaScript to read: `--greese-breakpoint-md: 900px`, and the keys in
3
+ // order, `--greese-breakpoint-keys: xs sm md lg xl`, which
4
+ // `configureBreakpoints()` reads. Media queries can't use them, so they're
5
+ // written once, here, from the configured breakpoints.
6
+ @use 'sass:list';
7
+ @use 'sass:map';
5
8
  @use 'config';
6
- @use '../../dist/maps' as defaults;
7
9
 
8
- @if config.$breakpoints != defaults.$breakpoints {
9
- @layer greese.tokens {
10
- :root {
11
- @each $key, $min in config.$breakpoints {
12
- --greese-breakpoint-#{$key}: #{$min};
13
- }
10
+ @layer greese.tokens {
11
+ :root {
12
+ @each $key, $min in config.$breakpoints {
13
+ --greese-breakpoint-#{$key}: #{$min};
14
14
  }
15
+
16
+ --greese-breakpoint-keys: #{list.join(
17
+ map.keys(config.$breakpoints),
18
+ (),
19
+ $separator: space
20
+ )};
15
21
  }
16
22
  }
@@ -5,8 +5,8 @@
5
5
  /// Control size scale: block size, inline padding, font size.
6
6
  $sizes: (
7
7
  xs: (
8
- height: 1rem,
9
- padding: var(--greese-space-1),
8
+ height: 1.5rem,
9
+ padding: var(--greese-space-2),
10
10
  font: var(--greese-type-p3-font-size),
11
11
  ),
12
12
  sm: (
@@ -1,4 +1,5 @@
1
1
  // What every component needs: the layer order, the tokens and the type
2
2
  // system. The whole stylesheet and css/core.css both start from this.
3
3
  @use '../../dist/tokens-base';
4
+ @use 'breakpoint-vars';
4
5
  @use 'typography-vars';