@keenmate/pure-css 1.0.0-rc05 → 1.0.0-rc07

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.
@@ -18,7 +18,7 @@
18
18
  }
19
19
 
20
20
  .pc-layout__sidebar {
21
- background-color: var(--pc-sidebar-bg);
21
+ background-color: var(--pc-sidebar-bg, var(--base-page-bg));
22
22
  border-inline-end: $border-width-base solid var(--pc-border-color); // RTL: flips to border-left
23
23
  flex-shrink: 0;
24
24
  position: relative;
@@ -127,7 +127,7 @@ body.pc-layout--sticky .pc-layout__sidebar {
127
127
  font-weight: $font-weight-semibold;
128
128
  text-transform: uppercase;
129
129
  letter-spacing: 0.05em;
130
- color: var(--pc-sidebar-text-secondary);
130
+ color: var(--pc-sidebar-text-secondary, var(--base-text-color-2));
131
131
  user-select: none;
132
132
 
133
133
  // First heading shouldn't push the whole nav down
@@ -154,7 +154,7 @@ body.pc-layout--sticky .pc-layout__sidebar {
154
154
  align-items: center;
155
155
  gap: $sidebar-item-gap;
156
156
  padding: $sidebar-padding;
157
- color: var(--pc-sidebar-text-secondary);
157
+ color: var(--pc-sidebar-text-secondary, var(--base-text-color-2));
158
158
  text-decoration: none;
159
159
  font-weight: $font-weight-medium;
160
160
  border-inline-end: $border-width-thick solid transparent; // RTL: flips to border-left
@@ -164,7 +164,7 @@ body.pc-layout--sticky .pc-layout__sidebar {
164
164
  }
165
165
 
166
166
  &:hover {
167
- color: var(--pc-sidebar-text);
167
+ color: var(--pc-sidebar-text, var(--base-text-color-1));
168
168
  background-color: var(--pc-accent-light);
169
169
  }
170
170
 
@@ -191,13 +191,15 @@ body.pc-layout--sticky .pc-layout__sidebar {
191
191
  // Sized on the md input height (35px) to match the navbar search boxes,
192
192
  // rather than the icon + $sidebar-padding metric of a nav row (40px). Trade-off:
193
193
  // it sits ~5px shorter than the links below it. Block padding is dropped (fixed
194
- // height + align-items:center owns the vertical); inline uses $spacing-base
195
- // (the inline half of the two-value $sidebar-padding — don't pass that token to
196
- // a single axis).
194
+ // height + align-items:center owns the vertical).
195
+ // Inline padding: right = $spacing-base (the nav-row inset); left = $spacing-sm
196
+ // so that margin ($spacing-sm) + padding-left ($spacing-sm) = $spacing-base —
197
+ // landing the magnifier exactly where the nav-row icons below it sit, instead
198
+ // of one box-margin too far in.
197
199
  height: #{$base-input-size-md-height}rem;
198
- padding: 0 $spacing-base;
200
+ padding: 0 $spacing-base 0 $spacing-sm;
199
201
  color: var(--pc-text-color-2);
200
- background-color: var(--pc-input-bg);
202
+ background-color: var(--pc-input-bg, var(--base-input-bg));
201
203
  border: $border-width-base solid var(--pc-border-color);
202
204
  border-radius: var(--pc-border-radius);
203
205
  text-align: start; // RTL: flips to right
@@ -216,12 +218,16 @@ body.pc-layout--sticky .pc-layout__sidebar {
216
218
 
217
219
  &:hover {
218
220
  border-color: $input-focus-border-color;
219
- color: var(--pc-sidebar-text);
221
+ color: var(--pc-sidebar-text, var(--base-text-color-1));
220
222
  }
221
223
 
222
- // Collapsed sidebar: drop the frame, icon-only, matching link padding so the
223
- // icon lands in the same column as every other sidebar icon.
224
- .pc-layout__sidebar--icon-collapse & {
224
+ // Collapsed rail ONLY (icon-collapse mode AND actually collapsed, i.e.
225
+ // body.sidebar-hidden): drop the frame, icon-only, matching link padding so
226
+ // the icon lands in the same column as every other sidebar icon. Must be
227
+ // gated by .sidebar-hidden — .pc-layout__sidebar--icon-collapse is the MODE
228
+ // class and stays on the element while the rail is expanded, so an unscoped
229
+ // rule would strip the search frame in the expanded state too.
230
+ .sidebar-hidden .pc-layout__sidebar--icon-collapse & {
225
231
  width: auto;
226
232
  margin: 0;
227
233
  padding: $sidebar-padding;
@@ -267,7 +273,7 @@ body.pc-layout--sticky .pc-layout__sidebar {
267
273
  border: none;
268
274
  outline: none;
269
275
  background: transparent;
270
- color: var(--pc-sidebar-text);
276
+ color: var(--pc-sidebar-text, var(--base-text-color-1));
271
277
  font: inherit;
272
278
  padding: 0;
273
279
 
@@ -283,9 +289,11 @@ body.pc-layout--sticky .pc-layout__sidebar {
283
289
  }
284
290
  }
285
291
 
286
- // Collapsed rail: the input variant sheds its field and centres on the submit
287
- // icon; clicking it submits with an empty query (the bare results page).
288
- .pc-layout__sidebar--icon-collapse &--input {
292
+ // Collapsed rail ONLY: the input variant sheds its field and centres on the
293
+ // submit icon; clicking it submits with an empty query (the bare results
294
+ // page). Gated by .sidebar-hidden so the field reappears when the icon-collapse
295
+ // rail is expanded (see frame rule above for why the mode class isn't enough).
296
+ .sidebar-hidden .pc-layout__sidebar--icon-collapse &--input {
289
297
  justify-content: center;
290
298
 
291
299
  .pc-sidebar__search-field {
@@ -300,7 +308,7 @@ body.pc-layout--sticky .pc-layout__sidebar {
300
308
  align-items: center;
301
309
  gap: $sidebar-item-gap;
302
310
  padding: $sidebar-padding;
303
- color: var(--pc-sidebar-text-secondary);
311
+ color: var(--pc-sidebar-text-secondary, var(--base-text-color-2));
304
312
  background: none;
305
313
  border: none;
306
314
  width: 100%;
@@ -313,7 +321,7 @@ body.pc-layout--sticky .pc-layout__sidebar {
313
321
  }
314
322
 
315
323
  &:hover {
316
- color: var(--pc-sidebar-text);
324
+ color: var(--pc-sidebar-text, var(--base-text-color-1));
317
325
  background-color: var(--pc-accent-light);
318
326
  }
319
327
 
@@ -354,7 +362,7 @@ body.pc-layout--sticky .pc-layout__sidebar {
354
362
  margin: 0;
355
363
  padding: 0;
356
364
  display: none;
357
- background-color: var(--pc-sidebar-submenu-bg);
365
+ background-color: var(--pc-sidebar-submenu-bg, var(--base-subtle-bg));
358
366
 
359
367
  &--open {
360
368
  display: block;
@@ -368,12 +376,12 @@ body.pc-layout--sticky .pc-layout__sidebar {
368
376
  border-inline-end: $border-width-medium solid transparent; // RTL: flips to border-left
369
377
 
370
378
  &:hover {
371
- background-color: var(--pc-sidebar-submenu-hover-bg);
379
+ background-color: var(--pc-sidebar-submenu-hover-bg, var(--base-subtle-bg));
372
380
  }
373
381
 
374
382
  &--active {
375
- background-color: var(--pc-sidebar-submenu-active-bg);
376
- color: var(--pc-sidebar-submenu-active-text);
383
+ background-color: var(--pc-sidebar-submenu-active-bg, var(--base-subtle-bg));
384
+ color: var(--pc-sidebar-submenu-active-text, var(--base-text-color-1));
377
385
  border-inline-end-color: var(--pc-accent); // RTL: flips to border-left-color
378
386
  }
379
387
  }
@@ -119,7 +119,7 @@ body {
119
119
  font-family: var(--base-font-family);
120
120
  font-size: 1.6rem; // 16px default text (with 10px rem base)
121
121
  color: var(--pc-text-color-1);
122
- background-color: var(--pc-main-bg);
122
+ background-color: var(--pc-page-bg);
123
123
  line-height: $line-height-base;
124
124
  }
125
125
 
@@ -19,14 +19,14 @@
19
19
  }
20
20
 
21
21
  *::-webkit-scrollbar-track {
22
- background: var(--pc-main-bg);
22
+ background: var(--pc-page-bg);
23
23
  border-radius: var(--pc-border-radius-sm);
24
24
  }
25
25
 
26
26
  *::-webkit-scrollbar-thumb {
27
27
  background: var(--pc-border-color);
28
28
  border-radius: var(--pc-border-radius-sm);
29
- border: $border-width-base solid var(--pc-main-bg);
29
+ border: $border-width-base solid var(--pc-page-bg);
30
30
 
31
31
  &:hover {
32
32
  background: var(--pc-accent);
@@ -38,11 +38,11 @@
38
38
  }
39
39
 
40
40
  *::-webkit-scrollbar-corner {
41
- background: var(--pc-main-bg);
41
+ background: var(--pc-page-bg);
42
42
  }
43
43
 
44
44
  /* Firefox */
45
45
  * {
46
46
  scrollbar-width: thin;
47
- scrollbar-color: var(--pc-border-color) var(--pc-main-bg);
47
+ scrollbar-color: var(--pc-border-color) var(--pc-page-bg);
48
48
  }
@@ -43,7 +43,12 @@ $base-subtle-bg: #e9ecef !default; // Muted areas, dividers
43
43
  $base-inverse-bg: #2c3e50 !default; // Inverse background (tooltips, dark elements)
44
44
  $base-overlay-bg: rgba(0, 0, 0, 0.5) !default; // Modal/overlay background
45
45
  $base-shadow-color: rgba(0, 0, 0, 0.15) !default; // Shadow color for elevation
46
- $base-elevated-bg: #f5f5f5 !default; // Header row, striped rows, elevated surfaces
46
+ // Elevated surface (header rows, striped rows, popovers/toolbars). Defaults to
47
+ // the page background so the default theme's header appearance is unchanged, but
48
+ // themes can override it independently to create a distinct raised tone.
49
+ $base-elevated-bg: $base-page-bg !default;
50
+ // Text on inverse/dark surfaces (web-component bridge: --base-text-inverted).
51
+ $base-text-inverted: #ffffff !default;
47
52
 
48
53
  // Interactive state backgrounds
49
54
  $base-hover-bg: $base-subtle-bg !default; // Hover state background
@@ -57,6 +62,8 @@ $base-disabled-bg: $base-subtle-bg !default; // Disabled element background
57
62
 
58
63
  $base-border-color: #e1e5e9 !default;
59
64
  $base-border: 1px solid $base-border-color !default;
65
+ // Checkbox/radio border (web-component bridge: --base-checkbox-border-color).
66
+ $base-checkbox-border-color: $base-border-color !default;
60
67
 
61
68
  // =============================================================================
62
69
  // INPUT FIELDS
@@ -65,11 +72,20 @@ $base-border: 1px solid $base-border-color !default;
65
72
 
66
73
  $base-input-bg: $base-main-bg !default;
67
74
  $base-input-color: #495057 !default;
68
- $base-input-border: 1px solid #ced4da !default;
75
+ // Input border as a colour (single source) + the 1px shorthand web components
76
+ // read via --base-input-border. Note: pure-admin's own inputs currently border
77
+ // off --base-border-color (#e1e5e9), not this (#ced4da) — a deliberate divergence
78
+ // kept to preserve appearance; see _colors.scss $input-border.
79
+ $base-input-border-color: #ced4da !default;
80
+ $base-input-border: 1px solid $base-input-border-color !default;
69
81
  $base-input-border-hover: 1px solid #b8bfc6 !default;
70
82
  $base-input-border-focus: 1px solid $base-accent-color !default;
71
83
  $base-input-placeholder-color: $base-text-color-4 !default;
72
84
  $base-input-bg-disabled: rgba($base-input-bg, 0.5) !default;
85
+ // Inline clear ("×") affordance inside inputs (web-component bridge:
86
+ // --base-input-clear-color / --base-input-clear-bg-hover).
87
+ $base-input-clear-color: $base-text-color-3 !default;
88
+ $base-input-clear-bg-hover: $base-hover-bg !default;
73
89
 
74
90
  // Input size heights (unitless multipliers for x10px base)
75
91
  $base-input-size-xs-height: 3.1 !default; // 31px
@@ -101,6 +117,7 @@ $base-tooltip-text-color: #ffffff !default;
101
117
  // =============================================================================
102
118
 
103
119
  $base-success-color: #22c55e !default; // Tailwind green-500 — aligns with --pc-positive in the sentiment scale
120
+ $base-success-bg: $base-success-color !default; // Solid role fill (web-component bridge: --base-success-bg)
104
121
  $base-success-color-hover: color.adjust($base-success-color, $lightness: -10%) !default;
105
122
  $base-success-bg-light: rgba($base-success-color, 0.1) !default;
106
123
  $base-success-bg-subtle: rgba($base-success-color, 0.08) !default;
@@ -115,6 +132,7 @@ $base-text-on-success: #ffffff !default;
115
132
  // =============================================================================
116
133
 
117
134
  $base-danger-color: #ef4444 !default; // Tailwind red-500 — aligns with --pc-negative in the sentiment scale
135
+ $base-danger-bg: $base-danger-color !default; // Solid role fill (web-component bridge: --base-danger-bg)
118
136
  $base-danger-color-hover: color.adjust($base-danger-color, $lightness: -10%) !default;
119
137
  $base-danger-bg-light: rgba($base-danger-color, 0.1) !default;
120
138
  $base-danger-bg-subtle: rgba($base-danger-color, 0.08) !default;
@@ -129,6 +147,7 @@ $base-text-on-danger: #ffffff !default;
129
147
  // =============================================================================
130
148
 
131
149
  $base-warning-color: #f97316 !default; // Tailwind orange-500 — also serves as the off-target axis in KPI components
150
+ $base-warning-bg: $base-warning-color !default; // Solid role fill (web-component bridge: --base-warning-bg)
132
151
  $base-warning-color-hover: color.adjust($base-warning-color, $lightness: -10%) !default;
133
152
  $base-warning-bg-light: rgba($base-warning-color, 0.1) !default;
134
153
  $base-warning-bg-subtle: rgba($base-warning-color, 0.08) !default;
@@ -210,6 +229,11 @@ $base-border-radius-sm: 0.4 !default; // 4px
210
229
  $base-border-radius-md: 0.6 !default; // 6px
211
230
  $base-border-radius-lg: 0.8 !default; // 8px
212
231
 
232
+ // Rem base for web components (bridge: --base-rem). They size themselves as
233
+ // `calc(<unitless-multiplier> * var(--base-rem, 10px))`. pure-css pins
234
+ // `html { font-size: 10px }` (reboot), so `1rem` tracks that base adaptively.
235
+ $base-rem: 1rem !default;
236
+
213
237
  // =============================================================================
214
238
  // COMPONENT-SPECIFIC DERIVED VALUES
215
239
  // Variables that components need, derived from base
@@ -12,9 +12,12 @@
12
12
  // LAYOUT COLORS (derived from base)
13
13
  // =============================================================================
14
14
 
15
- $main-bg: $base-page-bg !default;
15
+ // Surface tokens aligned with --base-*: main = the primary/raised surface (white),
16
+ // page = the canvas behind it (grey), subtle = a muted tone. (Previously main was
17
+ // wired to the page grey and subtle to white — an inversion vs --base-*.)
18
+ $main-bg: $base-main-bg !default;
16
19
  $page-bg: $base-page-bg !default;
17
- $subtle-bg: $base-main-bg !default;
20
+ $subtle-bg: $base-subtle-bg !default;
18
21
  $text-color-1: $base-text-color-1 !default;
19
22
  $text-color-2: $base-text-color-2 !default;
20
23
  $border-color: $base-border-color !default;
@@ -48,27 +51,30 @@ $accent-light: $base-accent-color-light !default;
48
51
  // CARD COLORS (derived from base surfaces)
49
52
  // =============================================================================
50
53
 
54
+ // Body surfaces → main-bg; header/tab chrome → elevated-bg (defaults to page-bg,
55
+ // so unchanged by default; themeable independently). Reconciled so these resolve
56
+ // to the same base tokens the web components read.
51
57
  $card-bg: $base-main-bg !default;
52
- $card-header-bg: $base-page-bg !default;
58
+ $card-header-bg: $base-elevated-bg !default;
53
59
  $card-footer-bg: $base-main-bg !default;
54
- $card-tabs-bg: $base-page-bg !default;
60
+ $card-tabs-bg: $base-elevated-bg !default;
55
61
 
56
62
  // =============================================================================
57
63
  // INPUT COLORS (derived from base input vars)
58
64
  // =============================================================================
59
65
 
60
66
  $input-bg: $base-input-bg !default;
61
- $input-border: #ced4da !default; // Extracted from base-input-border
67
+ $input-border: $base-input-border-color !default; // single-sourced from base (was hardcoded #ced4da)
62
68
  $input-text: $base-input-color !default;
63
69
 
64
70
  // =============================================================================
65
71
  // TABLE COLORS (derived from base surfaces)
66
72
  // =============================================================================
67
73
 
68
- $table-stripe: $base-page-bg !default;
74
+ $table-stripe: $base-elevated-bg !default; // striped/elevated rows → elevated-bg (= page-bg default)
69
75
  $table-bg: $base-main-bg !default;
70
- $table-header-bg: $base-page-bg !default;
71
- $table-hover-bg: $base-page-bg !default;
76
+ $table-header-bg: $base-elevated-bg !default; // header chrome → elevated-bg (= page-bg default)
77
+ $table-hover-bg: $base-hover-bg !default; // RECONCILED: was page-bg; now the shared hover surface
72
78
 
73
79
  // Table row hover accent (border)
74
80
  $table-hover-accent-width: 0 !default;
@@ -177,7 +183,7 @@ $tooltip-text: $base-tooltip-text-color !default;
177
183
 
178
184
  $popover-text-light: #ffffff !default;
179
185
  $popover-text-dark: #000000 !default;
180
- $popover-content-bg: $base-main-bg !default;
186
+ $popover-content-bg: $base-dropdown-bg !default; // floating surface → dropdown-bg (= main-bg default)
181
187
 
182
188
  // =============================================================================
183
189
  // CODE LANGUAGE COLORS (standalone - not themed)
@@ -276,7 +276,7 @@ $form-group-margin-compact: 1.2rem !default; // 12px (was 0.75rem)
276
276
  // Custom checkbox appearance (tri-state support)
277
277
  $checkbox-border-radius: $border-radius !default; // Match input border-radius
278
278
  $checkbox-border-width: $border-width-base !default; // 1px
279
- $checkbox-border-color: $border-color !default; // Default border
279
+ $checkbox-border-color: $base-checkbox-border-color !default; // reconciled: shared checkbox-border knob (= border-color default)
280
280
  $checkbox-border-color-hover: $accent-color !default; // Hover border
281
281
  $checkbox-border-color-checked: $accent-color !default; // Checked border
282
282
  $checkbox-bg: $card-bg !default; // Unchecked background
@@ -291,17 +291,17 @@ $checkbox-transition: $transition-fast !default;
291
291
  // ============================================================================
292
292
  $multiselect-input-padding-v: $input-padding-v !default;
293
293
  $multiselect-input-padding-h: $input-padding-h !default;
294
- $multiselect-dropdown-bg: $card-bg !default;
294
+ $multiselect-dropdown-bg: $base-dropdown-bg !default; // reconciled: floating surface → dropdown-bg (= main-bg default)
295
295
  $multiselect-dropdown-border: $border-color !default;
296
296
  $multiselect-dropdown-text: $text-color-1 !default;
297
297
  $multiselect-dropdown-shadow: $shadow-lg !default;
298
298
  $multiselect-dropdown-max-height: 32rem !default; // 320px (was 20rem)
299
- $multiselect-hint-bg: $main-bg !default;
299
+ $multiselect-hint-bg: $page-bg !default; // canvas tone (was $main-bg, which is now the white surface)
300
300
  $multiselect-hint-border: $border-color !default;
301
301
  $multiselect-hint-padding: $spacing-sm !default;
302
302
  $multiselect-option-padding-v: $spacing-sm !default;
303
303
  $multiselect-option-padding-h: $spacing-md !default;
304
- $multiselect-option-hover-bg: $main-bg !default;
304
+ $multiselect-option-hover-bg: $base-hover-bg !default; // RECONCILED: was main-bg; now the shared hover surface
305
305
  $multiselect-pill-bg: $accent-light !default;
306
306
  $multiselect-pill-border: $accent-color !default;
307
307
  $multiselect-pill-padding: $spacing-xs $spacing-sm !default;