@expressivecss/expressive 0.1.0-alpha.3 → 0.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 (154) hide show
  1. package/LICENSE +82 -2
  2. package/README.md +153 -43
  3. package/dist/css/expressive.css +7121 -9658
  4. package/dist/css/expressive.css.map +1 -0
  5. package/dist/css/expressive.min.css +1 -1
  6. package/dist/css/expressive.min.css.map +1 -0
  7. package/dist/js/expressive.cjs +7521 -0
  8. package/dist/js/expressive.cjs.map +7 -0
  9. package/dist/js/expressive.js +7383 -8099
  10. package/dist/js/expressive.js.map +7 -1
  11. package/dist/js/expressive.min.js +75 -1
  12. package/dist/js/expressive.min.js.map +7 -1
  13. package/dist/js/expressive.mjs +7292 -7998
  14. package/dist/js/expressive.mjs.map +7 -1
  15. package/dist/types/behaviors/dialogs.d.ts +25 -0
  16. package/dist/{js → types}/components/autocomplete.d.ts +10 -1
  17. package/dist/{js → types}/components/buttons.d.ts +11 -1
  18. package/dist/{js → types}/components/cards.d.ts +10 -1
  19. package/dist/{js → types}/components/carousel.d.ts +4 -5
  20. package/dist/{js/forms/character-counter.d.ts → types/components/characterCounter.d.ts} +1 -1
  21. package/dist/{js → types}/components/chips.d.ts +1 -1
  22. package/dist/{js → types}/components/collapsible.d.ts +1 -1
  23. package/dist/{js → types}/components/datepicker.d.ts +63 -2
  24. package/dist/{js → types}/components/dropdown.d.ts +3 -3
  25. package/dist/types/components/index.d.ts +23 -0
  26. package/dist/{js/components/materialbox.d.ts → types/components/lightbox.d.ts} +21 -21
  27. package/dist/{js → types}/components/modal.d.ts +1 -1
  28. package/dist/{js → types}/components/parallax.d.ts +11 -5
  29. package/dist/{js → types}/components/pushpin.d.ts +1 -1
  30. package/dist/{js/forms → types/components}/range.d.ts +3 -3
  31. package/dist/types/components/registry.d.ts +107 -0
  32. package/dist/{js → types}/components/scrollspy.d.ts +6 -9
  33. package/dist/{js/forms → types/components}/select.d.ts +11 -2
  34. package/dist/{js → types}/components/sidenav.d.ts +1 -1
  35. package/dist/{js → types}/components/slider.d.ts +3 -2
  36. package/dist/{js → types}/components/tabs.d.ts +3 -2
  37. package/dist/{js/components/tap-target.d.ts → types/components/tapTarget.d.ts} +2 -2
  38. package/dist/{js → types}/components/timepicker.d.ts +13 -5
  39. package/dist/{js/components/toast.d.ts → types/components/toasts.d.ts} +28 -4
  40. package/dist/{js → types}/components/tooltip.d.ts +2 -2
  41. package/dist/types/core/bounding.d.ts +6 -0
  42. package/dist/{js/foundation → types/core}/component.d.ts +1 -1
  43. package/dist/types/core/edges.d.ts +6 -0
  44. package/dist/{js/foundation → types/core}/utils.d.ts +21 -14
  45. package/dist/types/index.d.ts +7 -0
  46. package/dist/{js/plugins/docked-display.d.ts → types/plugins/dockedDisplayPlugin.d.ts} +7 -0
  47. package/package.json +60 -36
  48. package/src/sass/README.md +200 -0
  49. package/src/sass/abstracts/_breakpoints.scss +69 -0
  50. package/src/sass/abstracts/_elevation.scss +34 -0
  51. package/src/sass/abstracts/_index.scss +7 -0
  52. package/src/sass/abstracts/_mixins.scss +171 -0
  53. package/src/sass/abstracts/_variables.scss +57 -0
  54. package/src/{scss/layout/_table.scss → sass/base/_global.scss} +64 -2
  55. package/src/{scss/layout → sass/base}/_grid.scss +6 -6
  56. package/src/sass/base/_index.scss +6 -0
  57. package/src/{scss/foundation → sass/base}/_normalize.scss +51 -139
  58. package/src/sass/base/_typography.scss +90 -0
  59. package/src/sass/components/_badges.scss +77 -0
  60. package/src/{scss → sass}/components/_breadcrumb.scss +2 -0
  61. package/src/sass/components/_buttons.scss +407 -0
  62. package/src/sass/components/_cards.scss +328 -0
  63. package/src/{scss → sass}/components/_carousel.scss +5 -3
  64. package/src/sass/components/_chips.scss +140 -0
  65. package/src/sass/components/_collapsible.scss +81 -0
  66. package/src/{scss → sass}/components/_collection.scss +2 -2
  67. package/src/{scss/components/_date-picker.scss → sass/components/_datepicker.scss} +51 -44
  68. package/src/sass/components/_docked-display.scss +11 -0
  69. package/src/sass/components/_dropdown.scss +129 -0
  70. package/src/{scss/components/_material-icons.scss → sass/components/_icons-material-design.scss} +2 -0
  71. package/src/sass/components/_index.scss +35 -0
  72. package/src/{scss/components/_material-box.scss → sass/components/_lightbox.scss} +6 -4
  73. package/src/sass/components/_modal.scss +208 -0
  74. package/src/sass/components/_navbar.scss +345 -0
  75. package/src/{scss/layout/_footer.scss → sass/components/_page-footer.scss} +7 -6
  76. package/src/{scss → sass}/components/_pagination.scss +4 -3
  77. package/src/{scss → sass}/components/_parallax.scss +4 -1
  78. package/src/{scss → sass}/components/_preloader.scss +19 -97
  79. package/src/{scss → sass}/components/_pulse.scss +2 -0
  80. package/src/sass/components/_pushpin.scss +11 -0
  81. package/src/{scss → sass}/components/_sidenav.scss +99 -82
  82. package/src/{scss → sass}/components/_slider.scss +3 -1
  83. package/src/{scss/components/_table-of-contents.scss → sass/components/_table_of_contents.scss} +2 -0
  84. package/src/sass/components/_tabs.scss +232 -0
  85. package/src/{scss/components/_tap-target.scss → sass/components/_tapTarget.scss} +24 -22
  86. package/src/{scss/components/_time-picker.scss → sass/components/_timepicker.scss} +56 -56
  87. package/src/sass/components/_toast.scss +260 -0
  88. package/src/sass/components/_toolbar.scss +192 -0
  89. package/src/sass/components/_tooltip.scss +166 -0
  90. package/src/{scss → sass}/components/_transitions.scss +4 -4
  91. package/src/sass/components/forms/_checkboxes.scss +288 -0
  92. package/src/sass/components/forms/_fieldset.scss +128 -0
  93. package/src/{scss → sass/components}/forms/_file-input.scss +11 -9
  94. package/src/{scss → sass/components}/forms/_index.scss +2 -0
  95. package/src/sass/components/forms/_input-fields.scss +326 -0
  96. package/src/sass/components/forms/_radio-buttons.scss +190 -0
  97. package/src/sass/components/forms/_range.scss +310 -0
  98. package/src/sass/components/forms/_select.scss +103 -0
  99. package/src/sass/components/forms/_switches.scss +239 -0
  100. package/src/sass/expressive.scss +60 -0
  101. package/src/sass/tokens/_index.scss +4 -0
  102. package/src/sass/tokens/_reference.scss +265 -0
  103. package/src/sass/tokens/_theme.scss +49 -0
  104. package/src/sass/utilities/_helpers.scss +63 -0
  105. package/src/sass/utilities/_index.scss +8 -0
  106. package/src/{scss → sass}/utilities/_spacing.scss +4 -3
  107. package/src/sass/utilities/_typescale.scss +45 -0
  108. package/src/sass/utilities/_visibility.scss +63 -0
  109. package/src/sass/utilities/_z-depth.scss +18 -0
  110. package/dist/js/components/index.d.ts +0 -21
  111. package/dist/js/forms/index.d.ts +0 -4
  112. package/dist/js/foundation/index.d.ts +0 -2
  113. package/dist/js/index.d.ts +0 -52
  114. package/dist/js/plugins/index.d.ts +0 -1
  115. package/src/scss/components/_appbar.scss +0 -454
  116. package/src/scss/components/_badges.scss +0 -77
  117. package/src/scss/components/_buttons.scss +0 -412
  118. package/src/scss/components/_cards.scss +0 -267
  119. package/src/scss/components/_chips.scss +0 -147
  120. package/src/scss/components/_collapsible.scss +0 -84
  121. package/src/scss/components/_dropdown.scss +0 -98
  122. package/src/scss/components/_index.scss +0 -28
  123. package/src/scss/components/_modal.scss +0 -84
  124. package/src/scss/components/_tabs.scss +0 -176
  125. package/src/scss/components/_toast.scss +0 -70
  126. package/src/scss/components/_tooltip.scss +0 -49
  127. package/src/scss/components/_video.scss +0 -15
  128. package/src/scss/expressive.scss +0 -7
  129. package/src/scss/forms/_checkboxes.scss +0 -199
  130. package/src/scss/forms/_input-fields.scss +0 -360
  131. package/src/scss/forms/_radio-buttons.scss +0 -114
  132. package/src/scss/forms/_range.scss +0 -148
  133. package/src/scss/forms/_select.scss +0 -108
  134. package/src/scss/forms/_switches.scss +0 -127
  135. package/src/scss/foundation/_base.scss +0 -71
  136. package/src/scss/foundation/_color-palette.scss +0 -402
  137. package/src/scss/foundation/_index.scss +0 -10
  138. package/src/scss/foundation/_mixins.scss +0 -198
  139. package/src/scss/foundation/_motion.scss +0 -70
  140. package/src/scss/foundation/_shape.scss +0 -30
  141. package/src/scss/foundation/_state-layers.scss +0 -68
  142. package/src/scss/foundation/_theme.scss +0 -238
  143. package/src/scss/foundation/_tokens.scss +0 -511
  144. package/src/scss/foundation/_variables.scss +0 -57
  145. package/src/scss/layout/_index.scss +0 -3
  146. package/src/scss/utilities/_a11y.scss +0 -77
  147. package/src/scss/utilities/_elevation.scss +0 -63
  148. package/src/scss/utilities/_helpers.scss +0 -50
  149. package/src/scss/utilities/_index.scss +0 -7
  150. package/src/scss/utilities/_responsive.scss +0 -62
  151. package/src/scss/utilities/_typography.scss +0 -115
  152. /package/dist/{js/forms → types/behaviors}/forms.d.ts +0 -0
  153. /package/dist/{js/components → types/behaviors}/waves.d.ts +0 -0
  154. /package/src/{scss → sass}/utilities/_colors.scss +0 -0
@@ -1,4 +1,32 @@
1
- /*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
1
+ @use "../abstracts" as *;
2
+
3
+ /*! Based on normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
4
+
5
+ // Trimmed to the project's support baseline: the last 5 Chrome and Firefox
6
+ // versions. Every rule normalize carried whose own comment named IE, Edge
7
+ // Legacy or Chrome 57- has been removed, because those corrections are for
8
+ // engines that no longer run this stylesheet. What is left is the set that
9
+ // still corrects live Chrome/Firefox/Safari behaviour.
10
+ //
11
+ // Removed, with normalize's stated reason:
12
+ // main { display: block } - "Render consistently in IE"
13
+ // a { background-color: transparent } - "Remove gray background in IE 10"
14
+ // img { border-style: none } - "Remove border in IE 10"
15
+ // abbr[title] { border-bottom: none } - "Remove bottom border in Chrome 57-"
16
+ // button, input { overflow: visible } - "Show the overflow in IE/Edge"
17
+ // textarea { overflow: auto } - "Remove scrollbar in IE 10+"
18
+ // [type=checkbox], [type=radio] { ... } - "box sizing / padding in IE 10"
19
+ // details { display: block } - "Add display in Edge, IE 10+"
20
+ // template { display: none } - "Add display in IE 10+"
21
+ // [hidden] { display: none } - "Add display in IE 10" (UA stylesheets do this)
22
+ // ::-moz-focus-inner, :-moz-focusring - pre-FF-50 focus ring; :focus-visible
23
+ // replaces it, see abstracts/_mixins.scss
24
+ // legend's display:table/max-width/ - "text wrapping in Edge and IE",
25
+ // white-space/box-sizing/color "colour inheritance in IE"
26
+ //
27
+ // Also simplified: `font-family: monospace, monospace` was a workaround for the
28
+ // generic-family font-size quirk, which the adjacent `font-size: 1em` already
29
+ // handles; and abbr's doubled text-decoration dropped its non-dotted fallback.
2
30
 
3
31
  /* Document
4
32
  ========================================================================== */
@@ -24,14 +52,6 @@ body {
24
52
  margin: 0;
25
53
  }
26
54
 
27
- /**
28
- * Render the `main` element consistently in IE.
29
- */
30
-
31
- main {
32
- display: block;
33
- }
34
-
35
55
  /**
36
56
  * Correct the font size and margin on `h1` elements within `section` and
37
57
  * `article` contexts in Chrome, Firefox, and Safari.
@@ -46,46 +66,33 @@ h1 {
46
66
  ========================================================================== */
47
67
 
48
68
  /**
49
- * 1. Add the correct box sizing in Firefox.
50
- * 2. Show the overflow in Edge and IE.
69
+ * Add the correct box sizing in Firefox. Needed because base/_global.scss sets
70
+ * `box-sizing: border-box` globally, which would collapse a 0-height `hr`.
51
71
  */
52
72
 
53
73
  hr {
54
- box-sizing: content-box; /* 1 */
55
- height: 0; /* 1 */
56
- overflow: visible; /* 2 */
74
+ box-sizing: content-box;
75
+ height: 0;
57
76
  }
58
77
 
59
78
  /**
60
- * 1. Correct the inheritance and scaling of font size in all browsers.
61
- * 2. Correct the odd `em` font sizing in all browsers.
79
+ * Correct the inheritance and scaling of font size in all browsers.
62
80
  */
63
81
 
64
82
  pre {
65
- font-family: monospace, monospace; /* 1 */
66
- font-size: 1em; /* 2 */
83
+ font-family: monospace;
84
+ font-size: 1em;
67
85
  }
68
86
 
69
87
  /* Text-level semantics
70
88
  ========================================================================== */
71
89
 
72
90
  /**
73
- * Remove the gray background on active links in IE 10.
74
- */
75
-
76
- a {
77
- background-color: transparent;
78
- }
79
-
80
- /**
81
- * 1. Remove the bottom border in Chrome 57-
82
- * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
91
+ * Add the correct text decoration in Chrome, Edge, Opera, and Safari.
83
92
  */
84
93
 
85
94
  abbr[title] {
86
- border-bottom: none; /* 1 */
87
- text-decoration: underline; /* 2 */
88
- text-decoration: underline dotted; /* 2 */
95
+ text-decoration: underline dotted;
89
96
  }
90
97
 
91
98
  /**
@@ -98,15 +105,14 @@ strong {
98
105
  }
99
106
 
100
107
  /**
101
- * 1. Correct the inheritance and scaling of font size in all browsers.
102
- * 2. Correct the odd `em` font sizing in all browsers.
108
+ * Correct the inheritance and scaling of font size in all browsers.
103
109
  */
104
110
 
105
111
  code,
106
112
  kbd,
107
113
  samp {
108
- font-family: monospace, monospace; /* 1 */
109
- font-size: 1em; /* 2 */
114
+ font-family: monospace;
115
+ font-size: 1em;
110
116
  }
111
117
 
112
118
  /**
@@ -138,17 +144,6 @@ sup {
138
144
  top: -0.5em;
139
145
  }
140
146
 
141
- /* Embedded content
142
- ========================================================================== */
143
-
144
- /**
145
- * Remove the border on images inside links in IE 10.
146
- */
147
-
148
- img {
149
- border-style: none;
150
- }
151
-
152
147
  /* Forms
153
148
  ========================================================================== */
154
149
 
@@ -169,27 +164,17 @@ textarea {
169
164
  }
170
165
 
171
166
  /**
172
- * Show the overflow in IE.
173
- * 1. Show the overflow in Edge.
174
- */
175
-
176
- button,
177
- input { /* 1 */
178
- overflow: visible;
179
- }
180
-
181
- /**
182
- * Remove the inheritance of text transform in Edge, Firefox, and IE.
183
- * 1. Remove the inheritance of text transform in Firefox.
167
+ * Remove the inheritance of text transform in Firefox.
184
168
  */
185
169
 
186
170
  button,
187
- select { /* 1 */
171
+ select {
188
172
  text-transform: none;
189
173
  }
190
174
 
191
175
  /**
192
176
  * Correct the inability to style clickable types in iOS and Safari.
177
+ * Kept prefixed: this is a WebKit correction, and Safari is what needs it.
193
178
  */
194
179
 
195
180
  button,
@@ -200,28 +185,14 @@ button,
200
185
  }
201
186
 
202
187
  /**
203
- * Remove the inner border and padding in Firefox.
188
+ * Remove the padding so developers are not caught out when they zero out
189
+ * `fieldset` elements in all browsers.
204
190
  */
205
191
 
206
- button::-moz-focus-inner,
207
- [type="button"]::-moz-focus-inner,
208
- [type="reset"]::-moz-focus-inner,
209
- [type="submit"]::-moz-focus-inner {
210
- border-style: none;
192
+ legend {
211
193
  padding: 0;
212
194
  }
213
195
 
214
- /**
215
- * Restore the focus styles unset by the previous rule.
216
- */
217
-
218
- button:-moz-focusring,
219
- [type="button"]:-moz-focusring,
220
- [type="reset"]:-moz-focusring,
221
- [type="submit"]:-moz-focusring {
222
- outline: 1px dotted ButtonText;
223
- }
224
-
225
196
  /**
226
197
  * Correct the padding in Firefox.
227
198
  */
@@ -230,22 +201,6 @@ fieldset {
230
201
  padding: 0.35em 0.75em 0.625em;
231
202
  }
232
203
 
233
- /**
234
- * 1. Correct the text wrapping in Edge and IE.
235
- * 2. Correct the color inheritance from `fieldset` elements in IE.
236
- * 3. Remove the padding so developers are not caught out when they zero out
237
- * `fieldset` elements in all browsers.
238
- */
239
-
240
- legend {
241
- box-sizing: border-box; /* 1 */
242
- color: inherit; /* 2 */
243
- display: table; /* 1 */
244
- max-width: 100%; /* 1 */
245
- padding: 0; /* 3 */
246
- white-space: normal; /* 1 */
247
- }
248
-
249
204
  /**
250
205
  * Add the correct vertical alignment in Chrome, Firefox, and Opera.
251
206
  */
@@ -254,25 +209,6 @@ progress {
254
209
  vertical-align: baseline;
255
210
  }
256
211
 
257
- /**
258
- * Remove the default vertical scrollbar in IE 10+.
259
- */
260
-
261
- textarea {
262
- overflow: auto;
263
- }
264
-
265
- /**
266
- * 1. Add the correct box sizing in IE 10.
267
- * 2. Remove the padding in IE 10.
268
- */
269
-
270
- [type="checkbox"],
271
- [type="radio"] {
272
- box-sizing: border-box; /* 1 */
273
- padding: 0; /* 2 */
274
- }
275
-
276
212
  /**
277
213
  * Correct the cursor style of increment and decrement buttons in Chrome.
278
214
  */
@@ -303,9 +239,12 @@ textarea {
303
239
  /**
304
240
  * 1. Correct the inability to style clickable types in iOS and Safari.
305
241
  * 2. Change font properties to `inherit` in Safari.
242
+ *
243
+ * `::file-selector-button` is the standardised name (Chrome 89+, Firefox 82+);
244
+ * the `::-webkit-file-upload-button` alias it replaced is gone.
306
245
  */
307
246
 
308
- ::-webkit-file-upload-button {
247
+ ::file-selector-button {
309
248
  -webkit-appearance: button; /* 1 */
310
249
  font: inherit; /* 2 */
311
250
  }
@@ -313,14 +252,6 @@ textarea {
313
252
  /* Interactive
314
253
  ========================================================================== */
315
254
 
316
- /*
317
- * Add the correct display in Edge, IE 10+, and Firefox.
318
- */
319
-
320
- details {
321
- display: block;
322
- }
323
-
324
255
  /*
325
256
  * Add the correct display in all browsers.
326
257
  */
@@ -328,22 +259,3 @@ details {
328
259
  summary {
329
260
  display: list-item;
330
261
  }
331
-
332
- /* Misc
333
- ========================================================================== */
334
-
335
- /**
336
- * Add the correct display in IE 10+.
337
- */
338
-
339
- template {
340
- display: none;
341
- }
342
-
343
- /**
344
- * Add the correct display in IE 10.
345
- */
346
-
347
- [hidden] {
348
- display: none;
349
- }
@@ -0,0 +1,90 @@
1
+ @use "sass:math";
2
+ @use "../abstracts" as *;
3
+
4
+ // Semantic type. Headings, paragraphs, and small print consume the M3
5
+ // type scale directly so a page does not need .display-large / .body-medium
6
+ // unless it wants a role the element does not imply.
7
+ //
8
+ // h1 display-small h2 headline-large h3 headline-medium
9
+ // h4 headline-small h5 title-large h6 title-medium
10
+ // p body-large small / figcaption body-small
11
+ // body body-medium (matches the 14px root)
12
+ //
13
+ // Display-large / display-medium stay as utility classes — they are too
14
+ // large for a default <h1>. Component slots (app bar, card, dialog) set
15
+ // their own roles and win on specificity.
16
+
17
+ html {
18
+ font-family: $font-stack;
19
+ font-weight: var(--md-sys-typescale-body-medium-font-weight);
20
+ color: $text-color;
21
+ font-size: $root-font-size;
22
+
23
+ // Deliberately still a two-step ladder rather than a fluid clamp(): the root
24
+ // font size is the basis of every rem in the sheet, so making it continuous
25
+ // would move every computed length at every viewport width.
26
+ @include bp-up("large") {
27
+ font-size: 14.5px;
28
+ }
29
+
30
+ @include bp-up("xlarge") {
31
+ font-size: 15px;
32
+ }
33
+ }
34
+
35
+ body {
36
+ @include typescale("body-medium");
37
+ font-family: $font-stack;
38
+ }
39
+
40
+ h1 { @include typescale("display-small"); }
41
+ h2 { @include typescale("headline-large"); }
42
+ h3 { @include typescale("headline-medium"); }
43
+ h4 { @include typescale("headline-small"); }
44
+ h5 { @include typescale("title-large"); }
45
+ h6 { @include typescale("title-medium"); }
46
+
47
+ h1, h2, h3 {
48
+ margin: 0 0 0.4em;
49
+ }
50
+
51
+ h4, h5, h6 {
52
+ margin: 0 0 0.35em;
53
+ }
54
+
55
+ h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
56
+ font-weight: inherit;
57
+ color: inherit;
58
+ }
59
+
60
+ p {
61
+ @include typescale("body-large");
62
+ font-family: $font-stack;
63
+ margin: 0 0 1em;
64
+ }
65
+
66
+ small,
67
+ figcaption {
68
+ @include typescale("body-small");
69
+ font-family: $font-stack;
70
+ }
71
+
72
+ em { font-style: italic; }
73
+ strong, b { font-weight: 500; }
74
+
75
+ // Flow text: font-size scales with the viewport between two bounds.
76
+ //
77
+ // This was a @while loop emitting 21 media queries, stepping the size every
78
+ // 30px of viewport width from 360px to 960px. clamp() expresses the same line
79
+ // as one declaration - and continuously, so the type no longer jumps.
80
+ //
81
+ // The whole fluid range sits below the "large" breakpoint, so 1rem is
82
+ // $root-font-size throughout it and the conversion below is exact.
83
+ $_flow-min-px: math.div($flow-text-min, 1rem) * $root-font-size;
84
+ $_flow-max-px: math.div($flow-text-max, 1rem) * $root-font-size;
85
+ $_flow-slope: math.div($_flow-max-px - $_flow-min-px, $flow-text-to - $flow-text-from);
86
+ $_flow-intercept: math.div($_flow-min-px - ($_flow-slope * $flow-text-from), $root-font-size) * 1rem;
87
+
88
+ .flow-text {
89
+ font-size: clamp(#{$flow-text-min}, #{$_flow-intercept} + #{$_flow-slope * 100}vw, #{$flow-text-max});
90
+ }
@@ -0,0 +1,77 @@
1
+ @use "../abstracts" as *;
2
+
3
+ // TODO: Make better structure
4
+ :root {
5
+ --bagde-height: 22px;
6
+ }
7
+
8
+ span.badge {
9
+ min-width: 3rem;
10
+ padding: 0 6px;
11
+ margin-left: 14px;
12
+ text-align: center;
13
+ font-size: 1rem;
14
+ line-height: var(--bagde-height);
15
+ height: var(--bagde-height);
16
+ color: var(--md-sys-color-on-surface-variant);
17
+ float: right;
18
+ box-sizing: border-box;
19
+
20
+ &.new {
21
+ font-weight: 300;
22
+ font-size: 0.8rem;
23
+ color: var(--md-sys-color-on-primary);
24
+ background-color: var(--md-sys-color-primary);
25
+ border-radius: 2px;
26
+ }
27
+ &.new:after {
28
+ content: " new";
29
+ }
30
+
31
+ &[data-badge-caption]::after {
32
+ content: " " attr(data-badge-caption);
33
+ }
34
+ }
35
+
36
+ .active span.badge {
37
+ color: var(--md-sys-color-on-primary);
38
+ }
39
+
40
+ // Special cases
41
+
42
+ header:has(> nav) nav a span.badge {
43
+ display: inline-block;
44
+ float: none;
45
+ margin-left: 4px;
46
+ line-height: var(--bagde-height);
47
+ height: var(--bagde-height);
48
+ -webkit-font-smoothing: auto;
49
+ }
50
+
51
+ // Line height centering
52
+ .collection-item span.badge {
53
+ margin-top: calc(calc(1.5rem * 0.5) - calc(var(--bagde-height) * 0.5));
54
+ }
55
+
56
+ .collapsible span.badge {
57
+ margin-left: auto;
58
+
59
+ &.leading {
60
+ margin-right: 7px;
61
+ order: -1;
62
+ }
63
+ }
64
+
65
+ .collapsible .active span.badge:not(.new) {
66
+ color: var(--md-sys-color-on-surface-variant);
67
+ }
68
+
69
+ .sidenav span.badge {
70
+ margin-top: calc(calc(var(--sidenav-line-height) * 0.5) - calc(22px * 0.5));
71
+ }
72
+
73
+ table span.badge {
74
+ display: inline-block;
75
+ float: none;
76
+ margin-left: auto;
77
+ }
@@ -1,3 +1,5 @@
1
+ @use "../abstracts" as *;
2
+
1
3
  .breadcrumb-wrapper {
2
4
  display: flex;
3
5
  align-items: center;