zeus-css 1.0.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 (105) hide show
  1. package/README.md +81 -0
  2. package/bin/init.js +89 -0
  3. package/dist/zeus.css +8456 -0
  4. package/dist/zeus.min.css +1 -0
  5. package/package.json +44 -0
  6. package/scss/.stylelintrc.json +41 -0
  7. package/scss/API.md +168 -0
  8. package/scss/CHANGELOG.md +281 -0
  9. package/scss/LICENSE +21 -0
  10. package/scss/README.md +160 -0
  11. package/scss/cheatsheet.md +249 -0
  12. package/scss/dist/zeus.css +8465 -0
  13. package/scss/dist/zeus.css.map +1 -0
  14. package/scss/dist/zeus.min.css +1 -0
  15. package/scss/dist/zeus.min.css.map +1 -0
  16. package/scss/foundation/core/_api.scss +10 -0
  17. package/scss/foundation/core/_design.scss +33 -0
  18. package/scss/foundation/core/_engine.scss +18 -0
  19. package/scss/foundation/core/buttons/variants.scss +72 -0
  20. package/scss/foundation/core/design/_design-system.scss +41 -0
  21. package/scss/foundation/core/design/_validate.scss +114 -0
  22. package/scss/foundation/core/design/borders/border-line.scss +29 -0
  23. package/scss/foundation/core/design/borders/border-radius.scss +31 -0
  24. package/scss/foundation/core/design/buttons/sizes.scss +32 -0
  25. package/scss/foundation/core/design/colors/_color-derivation.scss +80 -0
  26. package/scss/foundation/core/design/colors/base-colors.scss +31 -0
  27. package/scss/foundation/core/design/colors/semantic-colors.scss +130 -0
  28. package/scss/foundation/core/design/core/basic.scss +40 -0
  29. package/scss/foundation/core/design/dimensions/sizes.scss +29 -0
  30. package/scss/foundation/core/design/dimensions/spaces.scss +42 -0
  31. package/scss/foundation/core/design/effects/_z-index.scss +30 -0
  32. package/scss/foundation/core/design/effects/shadows.scss +65 -0
  33. package/scss/foundation/core/design/layout/grid.scss +86 -0
  34. package/scss/foundation/core/design/typography/typography.scss +435 -0
  35. package/scss/foundation/core/engine/_fluid-core.scss +54 -0
  36. package/scss/foundation/core/engine/animations.scss +91 -0
  37. package/scss/foundation/core/engine/buttons.scss +226 -0
  38. package/scss/foundation/core/engine/color-api.scss +37 -0
  39. package/scss/foundation/core/engine/helpers.scss +39 -0
  40. package/scss/foundation/core/engine/layout.scss +156 -0
  41. package/scss/foundation/core/engine/responsive.scss +67 -0
  42. package/scss/foundation/core/engine/shadows.scss +186 -0
  43. package/scss/foundation/core/engine/shortcuts.scss +30 -0
  44. package/scss/foundation/core/engine/sizing.scss +49 -0
  45. package/scss/foundation/core/engine/theme-builder.scss +83 -0
  46. package/scss/foundation/core/engine/typographics.scss +44 -0
  47. package/scss/foundation/core/engine/typography-calc.scss +71 -0
  48. package/scss/foundation/foundation.scss +29 -0
  49. package/scss/foundation/views/_render.scss +13 -0
  50. package/scss/foundation/views/components/_alert.scss +103 -0
  51. package/scss/foundation/views/components/_avatar.scss +84 -0
  52. package/scss/foundation/views/components/_badge.scss +100 -0
  53. package/scss/foundation/views/components/_breadcrumb.scss +70 -0
  54. package/scss/foundation/views/components/_card.scss +117 -0
  55. package/scss/foundation/views/components/_dropdown.scss +123 -0
  56. package/scss/foundation/views/components/_form.scss +209 -0
  57. package/scss/foundation/views/components/_index.scss +20 -0
  58. package/scss/foundation/views/components/_modal.scss +138 -0
  59. package/scss/foundation/views/components/_pagination.scss +82 -0
  60. package/scss/foundation/views/components/_skeleton.scss +69 -0
  61. package/scss/foundation/views/components/_table.scss +94 -0
  62. package/scss/foundation/views/components/_tabs.scss +96 -0
  63. package/scss/foundation/views/components/_toast.scss +139 -0
  64. package/scss/foundation/views/components/_tooltip.scss +100 -0
  65. package/scss/foundation/views/patterns/_hero.scss +121 -0
  66. package/scss/foundation/views/patterns/_index.scss +8 -0
  67. package/scss/foundation/views/patterns/_sidebar-layout.scss +83 -0
  68. package/scss/foundation/views/render/_layer-order.scss +11 -0
  69. package/scss/foundation/views/render/classes/_animations.scss +233 -0
  70. package/scss/foundation/views/render/classes/_aspect-ratio.scss +17 -0
  71. package/scss/foundation/views/render/classes/_borders.scss +31 -0
  72. package/scss/foundation/views/render/classes/_buttons.scss +40 -0
  73. package/scss/foundation/views/render/classes/_colors.scss +83 -0
  74. package/scss/foundation/views/render/classes/_compounds.scss +103 -0
  75. package/scss/foundation/views/render/classes/_containers.scss +20 -0
  76. package/scss/foundation/views/render/classes/_misc-utils.scss +51 -0
  77. package/scss/foundation/views/render/classes/_position.scss +56 -0
  78. package/scss/foundation/views/render/classes/_sections.scss +30 -0
  79. package/scss/foundation/views/render/classes/_shadows.scss +198 -0
  80. package/scss/foundation/views/render/classes/_sizes.scss +39 -0
  81. package/scss/foundation/views/render/classes/_sizing-utils.scss +53 -0
  82. package/scss/foundation/views/render/classes/_spacing.scss +91 -0
  83. package/scss/foundation/views/render/classes/_state-variants.scss +47 -0
  84. package/scss/foundation/views/render/classes/_typography.scss +32 -0
  85. package/scss/foundation/views/render/classes/_utilities.scss +103 -0
  86. package/scss/foundation/views/render/classes/_z-index.scss +22 -0
  87. package/scss/foundation/views/render/classes/flexbox.scss +56 -0
  88. package/scss/foundation/views/render/classes/grid.scss +195 -0
  89. package/scss/foundation/views/render/classes.scss +116 -0
  90. package/scss/foundation/views/render/html-body.scss +54 -0
  91. package/scss/foundation/views/render/property-registration.scss +77 -0
  92. package/scss/foundation/views/render/reset.scss +147 -0
  93. package/scss/foundation/views/render/root-generator.scss +166 -0
  94. package/scss/foundation/views/render/root.scss +19 -0
  95. package/scss/foundation/views/render/typography.scss +129 -0
  96. package/scss/llms.txt +247 -0
  97. package/scss/package.json +89 -0
  98. package/scss/scripts/gen-cheatsheet.mjs +178 -0
  99. package/scss/scripts/gen-tokens.mjs +91 -0
  100. package/scss/scripts/test-compile.mjs +474 -0
  101. package/scss/zeus.config.scss +99 -0
  102. package/scss/zeus.customize.scss +246 -0
  103. package/scss/zeus.scss +17 -0
  104. package/scss/zeus.token.sets.example.scss +176 -0
  105. package/scss/zeus.tokens.json +687 -0
@@ -0,0 +1,72 @@
1
+ // ╔══════════════════════════════════════════════════════════════╗
2
+ // ║ ⚡ Zeus CSS — Variants ║
3
+ // ║ ║
4
+ // ║ Core styles and definitions for variants. ║
5
+ // ╚══════════════════════════════════════════════════════════════╝
6
+
7
+ @use "sass:map";
8
+ @use "../../../zeus.config" as config;
9
+
10
+ $_button-variants-defaults: (
11
+ "primary": (
12
+ "default": (
13
+ "background": var(--color-primary),
14
+ "color": var(--color-text-inverse),
15
+ "border": none,
16
+ ),
17
+ "hover": (
18
+ "background": var(--color-primary-dark),
19
+ "color": var(--color-text-inverse),
20
+ "border": none,
21
+ ),
22
+ "active": (
23
+ "background": var(--color-primary-dark),
24
+ "color": var(--color-text-inverse),
25
+ "border": none,
26
+ ),
27
+ ),
28
+ "secondary": (
29
+ "default": (
30
+ "background": transparent,
31
+ "color": var(--color-primary),
32
+ "border": var(--border-line-sm) solid var(--color-primary),
33
+ ),
34
+ "hover": (
35
+ "color": var(--color-primary-dark),
36
+ "border-color": var(--color-primary-dark),
37
+ ),
38
+ "active": (
39
+ "color": var(--color-primary-dark),
40
+ "border-color": var(--color-primary-dark),
41
+ ),
42
+ ),
43
+ "tertiary": (
44
+ "default": (
45
+ "background": transparent,
46
+ "color": var(--color-primary),
47
+ "border": none,
48
+ ),
49
+ "hover": (
50
+ "color": var(--color-primary-dark),
51
+ ),
52
+ "active": (
53
+ "color": var(--color-primary-dark),
54
+ ),
55
+ ),
56
+ "icon-only": (
57
+ "default": (
58
+ "background": transparent,
59
+ "color": var(--color-primary),
60
+ "border": none,
61
+ ),
62
+ "hover": (
63
+ "color": var(--color-primary-dark),
64
+ ),
65
+ "active": (
66
+ "color": var(--color-primary-dark),
67
+ ),
68
+ ),
69
+ );
70
+
71
+ // ── Developer Override ──
72
+ $button-variants: map.deep-merge($_button-variants-defaults, config.$zeus-button-variants);
@@ -0,0 +1,41 @@
1
+ // ╔══════════════════════════════════════════════════════════════╗
2
+ // ║ ⚡ Zeus CSS — Design System ║
3
+ // ║ ║
4
+ // ║ Design tokens and configuration for design system. ║
5
+ // ╚══════════════════════════════════════════════════════════════╝
6
+
7
+ @use "./core/basic" as *;
8
+ @use "./colors/base-colors" as *;
9
+ @use "./colors/semantic-colors" as *;
10
+ @use "./typography/typography" as *;
11
+ @use "./dimensions/spaces" as *;
12
+ @use "./dimensions/sizes" as *;
13
+ @use "./layout/grid" as *;
14
+ @use "./borders/border-line" as *;
15
+ @use "./borders/border-radius" as *;
16
+ @use "./effects/shadows" as *;
17
+ @use "./effects/z-index" as *;
18
+
19
+ // ╔══════════════════════════════════════════════════════════════╗
20
+ // ║ ⚡ Zeus Design System Master Dictionary ║
21
+ // ║ This is the single source of truth for the recursive ║
22
+ // ║ compiler engine. ║
23
+ // ╚══════════════════════════════════════════════════════════════╝
24
+
25
+ // NOTE: base $zeus-colors ("color" tokens) are NOT listed here — they are
26
+ // emitted exclusively by semantic-colors.scss's generate-semantic-colors()
27
+ // (called directly from render/root.scss), which also derives the -light/
28
+ // -dark/-muted/-inverse/border/surface variants from them. Including them
29
+ // here too would emit --color-primary (etc.) twice in the compiled output.
30
+ $zeus-design-system: (
31
+ "base": $base-colors,
32
+ "size-icon": $icon-size,
33
+ "space": $space,
34
+ "border-radius": $border-radius,
35
+ "border-line": $border-line,
36
+ "col-gap": $column-gaps,
37
+ "padding-outer": $outer-padding,
38
+ "shadow": $shadows,
39
+ "text": $typography,
40
+ "z": $z-index,
41
+ );
@@ -0,0 +1,114 @@
1
+ // ╔══════════════════════════════════════════════════════════════╗
2
+ // ║ ⚡ Zeus CSS — Validate ║
3
+ // ║ ║
4
+ // ║ Design tokens and configuration for validate. ║
5
+ // ╚══════════════════════════════════════════════════════════════╝
6
+
7
+ @use "sass:map";
8
+ @use "sass:meta";
9
+
10
+ // -----------------------------------------------------------------
11
+ // Validate a simple responsive token: (floor, ceil)
12
+ // Used for: spaces, icon-sizes, border-radius, border-line
13
+ // Clamp by default — no fluid flag needed
14
+ // -----------------------------------------------------------------
15
+ @mixin validate-responsive-token($category, $name, $token-map) {
16
+ @if not map.has-key($token-map, $name) {
17
+ @error "[ZEUS Validate] Token '#{$name}' not found in #{$category} map.";
18
+ }
19
+
20
+ $token: map.get($token-map, $name);
21
+
22
+ @if meta.type-of($token) != "map" {
23
+ @error "[ZEUS Validate] #{$category}.#{$name} must be a map, got #{meta.type-of($token)}.";
24
+ }
25
+
26
+ @each $required-key in ("floor", "ceil") {
27
+ @if not map.has-key($token, $required-key) {
28
+ @error "[ZEUS Validate] #{$category}.#{$name} is missing required key '#{$required-key}'. Expected format: (floor: N, ceil: N)";
29
+ }
30
+ }
31
+ }
32
+
33
+ // -----------------------------------------------------------------
34
+ // Validate a typography token
35
+ // Expected: (family, size: (floor, ceil), lh, ls, weight)
36
+ // Clamp by default — no fluid flag needed
37
+ // -----------------------------------------------------------------
38
+ @mixin validate-typography-token($name, $token-map) {
39
+ @if not map.has-key($token-map, $name) {
40
+ @error "[ZEUS Validate] Typography token '#{$name}' not found.";
41
+ }
42
+
43
+ $token: map.get($token-map, $name);
44
+
45
+ @each $required-key in ("family", "size", "lh", "ls", "weight") {
46
+ @if not map.has-key($token, $required-key) {
47
+ @error "[ZEUS Validate] typography.#{$name} is missing key '#{$required-key}'. Expected keys: family, size, lh, ls, weight";
48
+ }
49
+ }
50
+
51
+ // Validate the nested size sub-map
52
+ $size-map: map.get($token, "size");
53
+ @if meta.type-of($size-map) != "map" {
54
+ @error "[ZEUS Validate] typography.#{$name}.size must be a map (floor, ceil), got #{meta.type-of($size-map)}.";
55
+ }
56
+
57
+ @each $size-key in ("floor", "ceil") {
58
+ @if not map.has-key($size-map, $size-key) {
59
+ @error "[ZEUS Validate] typography.#{$name}.size is missing '#{$size-key}'. Expected: (floor: N, ceil: N)";
60
+ }
61
+ }
62
+ }
63
+
64
+ // -----------------------------------------------------------------
65
+ // Validate a button size token
66
+ // Expected: (font: (floor, ceil), py: (floor, ceil), px: (floor, ceil))
67
+ // Clamp by default — no fluid flag needed
68
+ // -----------------------------------------------------------------
69
+ @mixin validate-button-size-token($name, $token-map) {
70
+ @if not map.has-key($token-map, $name) {
71
+ @error "[ZEUS Validate] Button size '#{$name}' not found.";
72
+ }
73
+
74
+ $token: map.get($token-map, $name);
75
+
76
+ @each $prop in ("font", "py", "px") {
77
+ @if not map.has-key($token, $prop) {
78
+ @error "[ZEUS Validate] button-sizes.#{$name} is missing '#{$prop}'. Expected keys: font, py, px";
79
+ }
80
+
81
+ $sub: map.get($token, $prop);
82
+ @if meta.type-of($sub) != "map" {
83
+ @error "[ZEUS Validate] button-sizes.#{$name}.#{$prop} must be a map, got #{meta.type-of($sub)}.";
84
+ }
85
+
86
+ @each $sub-key in ("floor", "ceil") {
87
+ @if not map.has-key($sub, $sub-key) {
88
+ @error "[ZEUS Validate] button-sizes.#{$name}.#{$prop} is missing '#{$sub-key}'. Expected: (floor: N, ceil: N)";
89
+ }
90
+ }
91
+ }
92
+ }
93
+
94
+ // -----------------------------------------------------------------
95
+ // Batch validate: run on entire maps at once
96
+ // Call these in a debug/dev build to catch all errors early
97
+ // -----------------------------------------------------------------
98
+ @mixin validate-all-responsive($category, $token-map) {
99
+ @each $name, $_ in $token-map {
100
+ @include validate-responsive-token($category, $name, $token-map);
101
+ }
102
+ }
103
+
104
+ @mixin validate-all-typography($token-map) {
105
+ @each $name, $_ in $token-map {
106
+ @include validate-typography-token($name, $token-map);
107
+ }
108
+ }
109
+
110
+ @mixin validate-all-button-sizes($token-map) {
111
+ @each $name, $_ in $token-map {
112
+ @include validate-button-size-token($name, $token-map);
113
+ }
114
+ }
@@ -0,0 +1,29 @@
1
+ // ╔══════════════════════════════════════════════════════════════╗
2
+ // ║ ⚡ Zeus CSS — Border Line ║
3
+ // ║ ║
4
+ // ║ Design tokens and configuration for border line. ║
5
+ // ╚══════════════════════════════════════════════════════════════╝
6
+
7
+ @use "sass:map";
8
+ @use "../../../../zeus.config" as config;
9
+ @use "../_validate" as validate;
10
+
11
+ // ╔══════════════════════════════════════════════════════════╗
12
+ // ║ 📐 BORDER WIDTH TOKENS
13
+ // ║
14
+ // ║ Format: "name": (floor: N, ceil: N)
15
+ // ║ Output CSS variable: --border-line-{name}
16
+ // ╚══════════════════════════════════════════════════════════╝
17
+
18
+ // ── Defaults ─────────────────────────────────────────────────
19
+ $_border-line-defaults: (
20
+ "none": (floor: 0, ceil: 0),
21
+ "xs": (floor: 1, ceil: 2),
22
+ "sm": (floor: 1.5, ceil: 3),
23
+ "md": (floor: 2, ceil: 4),
24
+ "lg": (floor: 4, ceil: 8),
25
+ );
26
+
27
+ // ── Developer can override specific keys ──
28
+ $border-line: map.deep-merge($_border-line-defaults, config.$zeus-border-line);
29
+ @include validate.validate-all-responsive("border-line", $border-line);
@@ -0,0 +1,31 @@
1
+ // ╔══════════════════════════════════════════════════════════════╗
2
+ // ║ ⚡ Zeus CSS — Border Radius ║
3
+ // ║ ║
4
+ // ║ Design tokens and configuration for border radius. ║
5
+ // ╚══════════════════════════════════════════════════════════════╝
6
+
7
+ @use "sass:map";
8
+ @use "../../../../zeus.config" as config;
9
+ @use "../_validate" as validate;
10
+
11
+ // ╔══════════════════════════════════════════════════════════╗
12
+ // ║ 📐 BORDER RADIUS TOKENS
13
+ // ║
14
+ // ║ Format: "name": (floor: N, ceil: N)
15
+ // ║ Output CSS variable: --border-radius-{name}
16
+ // ╚══════════════════════════════════════════════════════════╝
17
+
18
+ // ── Defaults ─────────────────────────────────────────────────
19
+ $_border-radius-defaults: (
20
+ "none": (floor: 0, ceil: 0),
21
+ "xs": (floor: 2, ceil: 4),
22
+ "sm": (floor: 8, ceil: 12),
23
+ "md": (floor: 16, ceil: 24),
24
+ "lg": (floor: 20, ceil: 32),
25
+ "xl": (floor: 38, ceil: 64),
26
+ "rounded": (floor: 360, ceil: 360),
27
+ );
28
+
29
+ // ── Developer can override specific keys ──
30
+ $border-radius: map.deep-merge($_border-radius-defaults, config.$zeus-border-radius);
31
+ @include validate.validate-all-responsive("border-radius", $border-radius);
@@ -0,0 +1,32 @@
1
+ // ╔══════════════════════════════════════════════════════════════╗
2
+ // ║ ⚡ Zeus CSS — Sizes ║
3
+ // ║ ║
4
+ // ║ Design tokens and configuration for sizes. ║
5
+ // ╚══════════════════════════════════════════════════════════════╝
6
+
7
+ @use "sass:map";
8
+ @use "../../../../zeus.config" as config;
9
+ @use "../_validate" as validate;
10
+
11
+ // ╔══════════════════════════════════════════════════════════╗
12
+ // ║ 📐 BUTTON SIZES
13
+ // ║
14
+ // ║ Each size defines fluid scaling for:
15
+ // ║ - font (Font Size)
16
+ // ║ - py (Padding Y)
17
+ // ║ - px (Padding X)
18
+ // ╚══════════════════════════════════════════════════════════╝
19
+
20
+ $_button-sizes-defaults: (
21
+ "2xs": ( font: (floor: 11, ceil: 12), py: (floor: 4, ceil: 6), px: (floor: 8, ceil: 12) ),
22
+ "xs": ( font: (floor: 12, ceil: 13), py: (floor: 6, ceil: 8), px: (floor: 12, ceil: 16) ),
23
+ "sm": ( font: (floor: 13, ceil: 14), py: (floor: 8, ceil: 10), px: (floor: 16, ceil: 20) ),
24
+ "md": ( font: (floor: 14, ceil: 16), py: (floor: 10, ceil: 12), px: (floor: 20, ceil: 24) ),
25
+ "lg": ( font: (floor: 16, ceil: 20), py: (floor: 12, ceil: 16), px: (floor: 24, ceil: 32) ),
26
+ "xl": ( font: (floor: 18, ceil: 22), py: (floor: 16, ceil: 20), px: (floor: 32, ceil: 40) ),
27
+ "2xl": ( font: (floor: 20, ceil: 26), py: (floor: 20, ceil: 24), px: (floor: 40, ceil: 48) ),
28
+ );
29
+
30
+ // ── Developer Override ──
31
+ $button-sizes: map.deep-merge($_button-sizes-defaults, config.$zeus-button-sizes);
32
+ @include validate.validate-all-button-sizes($button-sizes);
@@ -0,0 +1,80 @@
1
+ // ╔══════════════════════════════════════════════════════════════╗
2
+ // ║ ⚡ Zeus CSS — Color Derivation ║
3
+ // ║ ║
4
+ // ║ Pure functions for design tokens color derivation. ║
5
+ // ╚══════════════════════════════════════════════════════════════╝
6
+
7
+ // ╔══════════════════════════════════════════════════════════════╗
8
+ // ║ 🎨 Shared Color Derivation Math ║
9
+ // ║ ║
10
+ // ║ Single source of truth for how *-light/*-dark/muted/border ║
11
+ // ║ tokens relate to their base color. Used by BOTH: ║
12
+ // ║ · semantic-colors.scss → the default palette ║
13
+ // ║ · engine/theme-builder.scss → zeus-theme() named themes ║
14
+ // ║ so a named theme's border/muted "weight" always matches the ║
15
+ // ║ default palette's, instead of two independently hand-tuned ║
16
+ // ║ percentages drifting apart. ║
17
+ // ║ ║
18
+ // ║ $base/$fg/$bg accept anything usable inside oklch()/ ║
19
+ // ║ color-mix() — a literal color or a var(--color-*) reference. ║
20
+ // ╚══════════════════════════════════════════════════════════════╝
21
+
22
+ // Picks a readable foreground (near-white or near-dark) for text/icons sitting
23
+ // ON TOP of $base, by switching on the base color's own OKLCH lightness.
24
+ //
25
+ // How the switch works, entirely in CSS so it stays reactive: inside
26
+ // oklch(from …) the `l` channel is available to calc(), so
27
+ // `clamp(0, (0.6 - l) * 1000, 1)` collapses to exactly 0 (base is light →
28
+ // use dark text) or 1 (base is dark → use light text). That 0/1 then
29
+ // interpolates between the framework's own text (0.218) and background
30
+ // (0.976) lightness values, at chroma 0 so the result is neutral.
31
+ //
32
+ // Why CSS and not Sass compile-time math: a consumer can reassign
33
+ // --color-primary at runtime (JS, [data-theme]) and every derived token has
34
+ // to follow. Computing this in Sass would freeze it at build time and break
35
+ // that contract — the same reason *-light/*-dark above are CSS-derived.
36
+ //
37
+ // LIMITATION — this is a best-effort improvement, not a WCAG guarantee.
38
+ // OKLCH lightness is not WCAG relative luminance, so a single threshold
39
+ // cannot clear 4.5:1 for every possible input: a highly saturated green or
40
+ // yellow around l≈0.6 has high luminance in both directions and bottoms out
41
+ // near 3.5:1 whichever foreground is chosen. It picks the *better* of the two
42
+ // options for any color, and all six of the framework's own default colors
43
+ // clear AA comfortably (4.55–7.40:1, asserted by scripts/test-compile.mjs
44
+ // check 8). If you override a brand color, re-run that check.
45
+ @function derive-on-color($base) {
46
+ @return oklch(from #{$base} calc(0.218 + 0.758 * clamp(0, (0.6 - l) * 1000, 1)) 0 h);
47
+ }
48
+
49
+ @function derive-light($base) {
50
+ @return oklch(from #{$base} calc(l + 0.15) c h);
51
+ }
52
+
53
+ @function derive-dark($base) {
54
+ @return oklch(from #{$base} calc(l - 0.15) c h);
55
+ }
56
+
57
+ // Derives the default card/surface background elevation from the page background.
58
+ @function derive-surface($background) {
59
+ @return oklch(from #{$background} calc(l - 0.02) c h);
60
+ }
61
+
62
+ @function derive-muted($foreground, $background) {
63
+ @return color-mix(in oklch, #{$foreground}, #{$background} 50%);
64
+ }
65
+
66
+ @function derive-border($foreground, $background) {
67
+ @return color-mix(in oklch, #{$foreground}, #{$background} 80%);
68
+ }
69
+
70
+ @function derive-border-strong($foreground, $background) {
71
+ @return color-mix(in oklch, #{$foreground}, #{$background} 60%);
72
+ }
73
+
74
+ @function derive-surface-subtle($surface, $foreground) {
75
+ @return color-mix(in oklch, #{$surface}, #{$foreground} 5%);
76
+ }
77
+
78
+ @function derive-warning-subtle($warning, $background) {
79
+ @return color-mix(in oklch, #{$warning}, #{$background} 75%);
80
+ }
@@ -0,0 +1,31 @@
1
+ // ╔══════════════════════════════════════════════════════════════╗
2
+ // ║ ⚡ Zeus CSS — Base Colors ║
3
+ // ║ ║
4
+ // ║ Design tokens and configuration for base colors. ║
5
+ // ╚══════════════════════════════════════════════════════════════╝
6
+
7
+ @use "sass:map";
8
+ @use "../../../../zeus.config" as config;
9
+
10
+ // ╔══════════════════════════════════════════════════════════╗
11
+ // ║ 🎨 BASE COLORS (Static)
12
+ // ║
13
+ // ║ These are the system reference colors. Core UI uses
14
+ // ║ semantic tokens instead of these.
15
+ // ╚══════════════════════════════════════════════════════════╝
16
+
17
+ // ── Defaults ─────────────────────────────────────────────────
18
+ $_base-defaults: (
19
+ "pure-white": oklch(100% 0 0),
20
+ "pure-black": oklch(0% 0 0),
21
+ "pure-gray": oklch(50% 0 0),
22
+
23
+ "system": (
24
+ "success": oklch(65% 0.20 145),
25
+ "warning": oklch(72% 0.18 85),
26
+ "error": oklch(55% 0.25 25),
27
+ ),
28
+ );
29
+
30
+ // ── Developer Override ──
31
+ $base-colors: map.deep-merge($_base-defaults, config.$zeus-base-colors);
@@ -0,0 +1,130 @@
1
+ // ╔══════════════════════════════════════════════════════════════╗
2
+ // ║ ⚡ Zeus CSS — Semantic Colors ║
3
+ // ║ ║
4
+ // ║ Design tokens and configuration for semantic colors. ║
5
+ // ╚══════════════════════════════════════════════════════════════╝
6
+
7
+ @use "sass:map";
8
+ @use "sass:list";
9
+ @use "../../../../zeus.config" as config;
10
+ @use "./color-derivation" as derive;
11
+
12
+ // The full set of $zeus-colors keys this file actually reads (via _c()/_has()
13
+ // below). Anything else is a typo or a key nothing consumes — e.g. "surface-
14
+ // subtle"/"warning-subtle" are always derived and can't be overridden despite
15
+ // looking like the rest of this list. _c()'s fallback-on-missing-key design is
16
+ // intentional for the 5 core colors (a typo'd override is indistinguishable
17
+ // from "not set" without this check), so this warns instead of erroring.
18
+ $_known-color-keys: (
19
+ "primary", "primary-light", "primary-dark",
20
+ "secondary", "secondary-light", "secondary-dark",
21
+ "accent", "accent-light", "accent-dark",
22
+ "text", "text-inverse", "text-muted",
23
+ "background", "surface",
24
+ "border", "border-strong"
25
+ );
26
+ @each $_key in map.keys(config.$zeus-colors) {
27
+ @if not list.index($_known-color-keys, $_key) {
28
+ @warn "[Zeus Color] '#{$_key}' in $zeus-colors is not a recognized token name and will be ignored. Did you mean one of: #{$_known-color-keys}?";
29
+ }
30
+ }
31
+
32
+ // ╔══════════════════════════════════════════════════════════════╗
33
+ // ║ Zeus Semantic Colors — Direct OKLCH Categories ║
34
+ // ╚══════════════════════════════════════════════════════════════╝
35
+
36
+ @function _c($key, $fallback) {
37
+ $val: map.get(config.$zeus-colors, $key);
38
+ @if $val {
39
+ @return $val;
40
+ } @else {
41
+ @return $fallback;
42
+ }
43
+ }
44
+
45
+ // Whether $key is explicitly defined in the developer's $zeus-colors map.
46
+ // Used so derived colors (below) never silently overwrite an explicit value —
47
+ // the pipeline in root-generator.scss already emitted it from the map directly.
48
+ @function _has($key) {
49
+ @return map.has-key(config.$zeus-colors, $key);
50
+ }
51
+
52
+ // ╔══════════════════════════════════════════════════════════════╗
53
+ // ║ Private: emit static set of derived tokens ║
54
+ // ║ from 5 resolved base colors. ║
55
+ // ║ Single source of truth shared with engine/theme-builder.scss. ║
56
+ // ╚══════════════════════════════════════════════════════════════╝
57
+ @mixin _emit-static-color-vars($primary, $secondary, $accent, $text, $bg) {
58
+ --color-primary: #{$primary};
59
+ @if not _has("primary-light") {
60
+ --color-primary-light: #{derive.derive-light("var(--color-primary)")};
61
+ }
62
+ @if not _has("primary-dark") {
63
+ --color-primary-dark: #{derive.derive-dark("var(--color-primary)")};
64
+ }
65
+
66
+ --color-secondary: #{$secondary};
67
+ @if not _has("secondary-light") {
68
+ --color-secondary-light: #{derive.derive-light("var(--color-secondary)")};
69
+ }
70
+ @if not _has("secondary-dark") {
71
+ --color-secondary-dark: #{derive.derive-dark("var(--color-secondary)")};
72
+ }
73
+
74
+ --color-accent: #{$accent};
75
+ @if not _has("accent-light") {
76
+ --color-accent-light: #{derive.derive-light("var(--color-accent)")};
77
+ }
78
+ @if not _has("accent-dark") {
79
+ --color-accent-dark: #{derive.derive-dark("var(--color-accent)")};
80
+ }
81
+
82
+ --color-background: #{$bg};
83
+ @if not _has("surface") {
84
+ --color-surface: #{derive.derive-surface("var(--color-background)")};
85
+ }
86
+
87
+ --color-text: #{$text};
88
+ @if not _has("text-inverse") {
89
+ --color-text-inverse: #{$bg};
90
+ }
91
+
92
+ @if not _has("text-muted") {
93
+ --color-text-muted: #{derive.derive-muted("var(--color-text)", "var(--color-background)")};
94
+ }
95
+ @if not _has("border") {
96
+ --color-border: #{derive.derive-border("var(--color-text)", "var(--color-background)")};
97
+ }
98
+ @if not _has("border-strong") {
99
+ --color-border-strong: #{derive.derive-border-strong("var(--color-text)", "var(--color-background)")};
100
+ }
101
+
102
+ --color-surface-subtle: #{derive.derive-surface-subtle("var(--color-surface)", "var(--color-text)")};
103
+ --color-warning-subtle: #{derive.derive-warning-subtle("var(--base-system-warning)", "var(--color-background)")};
104
+ }
105
+
106
+ // ── CSS Custom Properties ──────────────────────────────────────
107
+ // ╔══════════════════════════════════════════════════════════════╗
108
+ // ║ Semantic Colors Layer ║
109
+ // ║ ║
110
+ // ║ Maps the flat configuration directly to CSS custom variables.║
111
+ // ║ There is no intermediate layer. Colors flow DIRECTLY from ║
112
+ // ║ zeus.config.scss to CSS variables, ensuring optimal perf. ║
113
+ // ╚══════════════════════════════════════════════════════════════╝
114
+ @mixin generate-semantic-colors() {
115
+ // Capture base configurations
116
+ $primary: _c(primary, oklch(50.0% 0.232 259.6));
117
+ $secondary: _c(secondary, oklch(74.7% 0.174 60.6));
118
+ $accent: _c(accent, oklch(52.0% 0.153 164.1));
119
+ $text: _c(text, oklch(21.8% 0.000 0.0));
120
+ $bg: _c(background, oklch(97.6% 0.000 0.0));
121
+
122
+ :root {
123
+ color-scheme: light;
124
+ @include _emit-static-color-vars($primary, $secondary, $accent, $text, $bg);
125
+ }
126
+ }
127
+
128
+ // ── Sass variable (for use inside SCSS logic) ──────────────────
129
+ // Exposes the resolved flat map so other SCSS files can loop over it
130
+ $colors: config.$zeus-colors !default;
@@ -0,0 +1,40 @@
1
+ // ╔══════════════════════════════════════════════════════════════╗
2
+ // ║ ⚡ Zeus CSS — Basic ║
3
+ // ║ ║
4
+ // ║ Design tokens and configuration for basic. ║
5
+ // ╚══════════════════════════════════════════════════════════════╝
6
+
7
+ @use "sass:map";
8
+ @use "../../../../zeus.config" as config;
9
+
10
+ // ╔══════════════════════════════════════════════════════════╗
11
+ // ║ ⚙️ ZEUS CORE — Fluid Scaling & Base Tokens
12
+ // ║
13
+ // ║ Defines the viewport boundaries that drive all fluid
14
+ // ║ calculations (clamp-based sizing, typography, spacing).
15
+ // ║ Every token below can be overridden before @use.
16
+ // ╚══════════════════════════════════════════════════════════╝
17
+
18
+ // ─── Container bounds ───────────────────────────────
19
+ // The container width range: fluid values scale linearly
20
+ // Auto-derive container inner bounds inside the Engine (floor = 375 - 32 = 343, ceil = 1920 - 128 = 1792)
21
+ $_c-floor-calc: map.get(config.$zeus-viewports, "mobile") - (map.get(config.$zeus-viewport-gutter, "mobile") * 2);
22
+ $_c-ceil-calc: map.get(config.$zeus-viewports, "desktop") - (map.get(config.$zeus-viewport-gutter, "desktop") * 2);
23
+
24
+ $_container-bounds-base-defaults: (
25
+ floor: $_c-floor-calc,
26
+ ceil: $_c-ceil-calc,
27
+ );
28
+ $_container-bounds-defaults: map.merge($_container-bounds-base-defaults, config.$zeus-container-bounds);
29
+
30
+ // ── Developer can set $container-bounds BEFORE @use to override ──
31
+ $container-bounds: () !default;
32
+ $container-bounds: map.merge($_container-bounds-defaults, $container-bounds);
33
+
34
+ // ─── Root typographic unit ───────────────────────────────────
35
+ // Reference size for all rem-based calculations.
36
+ $root-font-size: config.$zeus-root-font-size !default;
37
+
38
+ // ─── Global focus ring ───────────────────────────────────────
39
+ // Accessible focus indicator applied system-wide.
40
+ $focus-ring: config.$zeus-focus-ring !default;
@@ -0,0 +1,29 @@
1
+ // ╔══════════════════════════════════════════════════════════════╗
2
+ // ║ ⚡ Zeus CSS — Sizes ║
3
+ // ║ ║
4
+ // ║ Design tokens and configuration for sizes. ║
5
+ // ╚══════════════════════════════════════════════════════════════╝
6
+
7
+ @use "sass:map";
8
+ @use "../../../../zeus.config" as config;
9
+ @use "../_validate" as validate;
10
+
11
+ // ╔══════════════════════════════════════════════════════════╗
12
+ // ║ 📐 ICON SIZES — Edit values here
13
+ // ║
14
+ // ║ Format: "name": (floor: N, ceil: N)
15
+ // ║ Output CSS variable: --size-icon-{name}
16
+ // ╚══════════════════════════════════════════════════════════╝
17
+
18
+ // ── Defaults ─────────────────────────────────────────────────
19
+ $_icon-size-defaults: (
20
+ "xs": (floor: 14, ceil: 18),
21
+ "sm": (floor: 20, ceil: 24),
22
+ "md": (floor: 22, ceil: 32),
23
+ "lg": (floor: 38, ceil: 48),
24
+ "xl": (floor: 48, ceil: 64),
25
+ );
26
+
27
+ // ── Developer can set $icon-size BEFORE @use to override specific keys ──
28
+ $icon-size: map.deep-merge($_icon-size-defaults, config.$zeus-icon-size);
29
+ @include validate.validate-all-responsive("icon-size", $icon-size);