@keenmate/pure-css 1.1.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.
@@ -1,48 +1,48 @@
1
- // @keenmate/pure-css — full foundation bundle
2
- // ============================================================================
3
- // The Keenmate CSS foundation, extracted from @keenmate/pure-admin-core so it
4
- // can be consumed on its own (docs sites, standalone pages, non-admin portals)
5
- // and so pure-admin-core, themes and any web/svelte component share ONE
6
- // theming contract: the `--base-*` (and derived `--pc-*`) custom properties.
7
- //
8
- // This bundle emits:
9
- // 1. `:root` defaults for the BASE --base-*/--pc-* tokens (light values) —
10
- // surfaces, text, accent, links, border, semantic role identities, the
11
- // theme palette slots, and the radius scale. Component tokens (buttons,
12
- // cards, tables, alerts, …) are pure-admin's contract, NOT emitted here.
13
- // 2. the reboot (10px rem base + element reset — the sizing contract)
14
- // 3. themed scrollbars (global browser chrome)
15
- // 4. the native flexbox grid (.pc-row / .pc-col)
16
- // 5. the utility classes (.m-*, .d-flex, .w-*, …)
17
- //
18
- // A *theme* is just an override of the `$base-*` SCSS variables (or the
19
- // `--base-*` custom properties) — everything else re-derives. See README.
20
- // ============================================================================
21
-
22
- @use 'base-css-variables' as bcv;
23
- @use 'reboot';
24
- @use 'scrollbars';
25
- @use 'pa-grid';
26
-
27
- // App shell — the navbar, sidebar, and layout container components. Relocated
28
- // from pure-admin-core so the foundation single-sources the shell; pure-admin
29
- // keeps same-named partials that just @forward these (resize-handle is a
30
- // mixin-only dependency @used by sidebar, so it emits nothing on its own).
31
- @use 'navbar';
32
- @use 'navbar-elements';
33
- @use 'sidebar';
34
- @use 'sidebar-states';
35
- @use 'layout-container';
36
- @use 'layout-responsive';
37
- @use 'fit-flyout';
38
- @use 'icon-hover';
39
-
40
- @use 'utilities';
41
-
42
- // CSS variable defaults at :root. Themes ship their own values by overriding
43
- // $base-* before importing base-css-variables; this only affects the unthemed
44
- // bundle and the FOUC window before a theme stylesheet resolves.
45
- :root {
46
- @include bcv.output-base-css-variables;
47
- @include bcv.output-pc-css-variables;
48
- }
1
+ // @keenmate/pure-css — full foundation bundle
2
+ // ============================================================================
3
+ // The Keenmate CSS foundation, extracted from @keenmate/pure-admin-core so it
4
+ // can be consumed on its own (docs sites, standalone pages, non-admin portals)
5
+ // and so pure-admin-core, themes and any web/svelte component share ONE
6
+ // theming contract: the `--base-*` (and derived `--pc-*`) custom properties.
7
+ //
8
+ // This bundle emits:
9
+ // 1. `:root` defaults for the BASE --base-*/--pc-* tokens (light values) —
10
+ // surfaces, text, accent, links, border, semantic role identities, the
11
+ // theme palette slots, and the radius scale. Component tokens (buttons,
12
+ // cards, tables, alerts, …) are pure-admin's contract, NOT emitted here.
13
+ // 2. the reboot (10px rem base + element reset — the sizing contract)
14
+ // 3. themed scrollbars (global browser chrome)
15
+ // 4. the native flexbox grid (.pc-row / .pc-col)
16
+ // 5. the utility classes (.m-*, .d-flex, .w-*, …)
17
+ //
18
+ // A *theme* is just an override of the `$base-*` SCSS variables (or the
19
+ // `--base-*` custom properties) — everything else re-derives. See README.
20
+ // ============================================================================
21
+
22
+ @use 'base-css-variables' as bcv;
23
+ @use 'reboot';
24
+ @use 'scrollbars';
25
+ @use 'pa-grid';
26
+
27
+ // App shell — the navbar, sidebar, and layout container components. Relocated
28
+ // from pure-admin-core so the foundation single-sources the shell; pure-admin
29
+ // keeps same-named partials that just @forward these (resize-handle is a
30
+ // mixin-only dependency @used by sidebar, so it emits nothing on its own).
31
+ @use 'navbar';
32
+ @use 'navbar-elements';
33
+ @use 'sidebar';
34
+ @use 'sidebar-states';
35
+ @use 'layout-container';
36
+ @use 'layout-responsive';
37
+ @use 'fit-flyout';
38
+ @use 'icon-hover';
39
+
40
+ @use 'utilities';
41
+
42
+ // CSS variable defaults at :root. Themes ship their own values by overriding
43
+ // $base-* before importing base-css-variables; this only affects the unthemed
44
+ // bundle and the FOUC window before a theme stylesheet resolves.
45
+ :root {
46
+ @include bcv.output-base-css-variables;
47
+ @include bcv.output-pc-css-variables;
48
+ }
@@ -709,16 +709,65 @@ $spacers: (
709
709
  .text-warning { color: var(--pc-warning-text) !important; }
710
710
  .text-info { color: var(--pc-info-text) !important; }
711
711
 
712
- // Text color utilities (theme custom colors 1-9)
713
- .text-color-1 { color: var(--pc-color-1) !important; }
714
- .text-color-2 { color: var(--pc-color-2) !important; }
715
- .text-color-3 { color: var(--pc-color-3) !important; }
716
- .text-color-4 { color: var(--pc-color-4) !important; }
717
- .text-color-5 { color: var(--pc-color-5) !important; }
718
- .text-color-6 { color: var(--pc-color-6) !important; }
719
- .text-color-7 { color: var(--pc-color-7) !important; }
720
- .text-color-8 { color: var(--pc-color-8) !important; }
721
- .text-color-9 { color: var(--pc-color-9) !important; }
712
+ // Role SURFACE utilities — the role parallel of the numeric
713
+ // .{bg,text-on,surface}-color-N family below. Fill = --pc-{role} (primary →
714
+ // --pc-accent); on-fill contrast text = --base-text-on-{role} (the only on-role
715
+ // contrast token — foreground .text-{role} above is a DIFFERENT colour). All
716
+ // !important for cascade parity with the role text utilities.
717
+ //
718
+ // .bg-{role} role colour as background (no text change)
719
+ // .text-on-{role} contrast text to sit on a role fill (pair with .bg-{role})
720
+ // .surface-{role} role background + contrast text in one class
721
+ @each $role, $fill in (primary: accent, success: success, warning: warning, danger: danger, info: info) {
722
+ .bg-#{$role} { background-color: var(--pc-#{$fill}) !important; }
723
+ .text-on-#{$role} { color: var(--base-text-on-#{$role}) !important; }
724
+ .surface-#{$role} {
725
+ background-color: var(--pc-#{$fill}) !important;
726
+ color: var(--base-text-on-#{$role}) !important;
727
+ }
728
+ }
729
+
730
+ // Text colour — neutral hierarchy. Maps to --pc-text-color-N (text HIERARCHY),
731
+ // a DIFFERENT scale from the numbered .text-color-N palette below (--pc-color-N
732
+ // data colours). `.text-secondary` is the flat muted/subdued text utility (the
733
+ // muted token used to live only inside a component modifier); `.text-body` is the
734
+ // explicit default body colour. !important so the colour wins when composed onto
735
+ // a component that carries its own colour.
736
+ .text-body { color: var(--pc-text-color-1) !important; } // default body text (explicit)
737
+ .text-secondary { color: var(--pc-text-color-2) !important; } // muted / subdued body text
738
+
739
+ // Semantic text shorthands (compound).
740
+ .text-caption {
741
+ font-size: $font-size-xs;
742
+ color: var(--pc-text-color-2);
743
+ margin-bottom: $spacing-sm;
744
+ }
745
+ .text-lead {
746
+ font-size: $font-size-base;
747
+ line-height: $line-height-relaxed;
748
+ }
749
+
750
+ // Theme palette colour utilities (theme custom colors 1-9).
751
+ // Two token layers per slot: --pc-color-N (the slot) + --pc-color-N-text (its
752
+ // guaranteed-contrasting text). Each form applies the slot to one property;
753
+ // `.surface-color-N` is the composite (slot background + readable text). All
754
+ // !important for cascade parity with the role colours above.
755
+ //
756
+ // .text-color-N slot as text colour
757
+ // .bg-color-N slot as background
758
+ // .border-color-N slot as border colour
759
+ // .text-on-color-N contrast text only (pair with .bg-color-N yourself)
760
+ // .surface-color-N slot background + contrast text in one class
761
+ @for $i from 1 through 9 {
762
+ .text-color-#{$i} { color: var(--pc-color-#{$i}) !important; }
763
+ .bg-color-#{$i} { background-color: var(--pc-color-#{$i}) !important; }
764
+ .border-color-#{$i} { border-color: var(--pc-color-#{$i}) !important; }
765
+ .text-on-color-#{$i} { color: var(--pc-color-#{$i}-text) !important; }
766
+ .surface-color-#{$i} {
767
+ background-color: var(--pc-color-#{$i}) !important;
768
+ color: var(--pc-color-#{$i}-text) !important;
769
+ }
770
+ }
722
771
 
723
772
  // Rounded utilities
724
773
  .rounded {
@@ -296,6 +296,14 @@ $base-border-radius-sm: 0.4 !default; // 4px
296
296
  $base-border-radius-md: 0.6 !default; // 6px
297
297
  $base-border-radius-lg: 0.8 !default; // 8px
298
298
 
299
+ // Checkbox BOX scale (web-component bridge: --base-checkbox-scale) — multiplies
300
+ // the box's OWN width/height, NOT a CSS transform (a transform pixel-snaps the
301
+ // fractionally-positioned mask glyph and shifts it off-centre). The box sizes as
302
+ // `calc(<base-size> * var(--base-checkbox-scale))`, the glyph via
303
+ // --base-icon-check-size. One knob every component with a checkbox reads, so a
304
+ // theme resizes all of them in lockstep. 1 = the component's base size.
305
+ $base-checkbox-scale: 1 !default;
306
+
299
307
  // Rem base for web components (bridge: --base-rem). They size themselves as
300
308
  // `calc(<unitless-multiplier> * var(--base-rem, 10px))`. pure-css pins
301
309
  // `html { font-size: 10px }` (reboot), so `1rem` tracks that base adaptively.