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.
- package/README.md +81 -0
- package/bin/init.js +89 -0
- package/dist/zeus.css +8456 -0
- package/dist/zeus.min.css +1 -0
- package/package.json +44 -0
- package/scss/.stylelintrc.json +41 -0
- package/scss/API.md +168 -0
- package/scss/CHANGELOG.md +281 -0
- package/scss/LICENSE +21 -0
- package/scss/README.md +160 -0
- package/scss/cheatsheet.md +249 -0
- package/scss/dist/zeus.css +8465 -0
- package/scss/dist/zeus.css.map +1 -0
- package/scss/dist/zeus.min.css +1 -0
- package/scss/dist/zeus.min.css.map +1 -0
- package/scss/foundation/core/_api.scss +10 -0
- package/scss/foundation/core/_design.scss +33 -0
- package/scss/foundation/core/_engine.scss +18 -0
- package/scss/foundation/core/buttons/variants.scss +72 -0
- package/scss/foundation/core/design/_design-system.scss +41 -0
- package/scss/foundation/core/design/_validate.scss +114 -0
- package/scss/foundation/core/design/borders/border-line.scss +29 -0
- package/scss/foundation/core/design/borders/border-radius.scss +31 -0
- package/scss/foundation/core/design/buttons/sizes.scss +32 -0
- package/scss/foundation/core/design/colors/_color-derivation.scss +80 -0
- package/scss/foundation/core/design/colors/base-colors.scss +31 -0
- package/scss/foundation/core/design/colors/semantic-colors.scss +130 -0
- package/scss/foundation/core/design/core/basic.scss +40 -0
- package/scss/foundation/core/design/dimensions/sizes.scss +29 -0
- package/scss/foundation/core/design/dimensions/spaces.scss +42 -0
- package/scss/foundation/core/design/effects/_z-index.scss +30 -0
- package/scss/foundation/core/design/effects/shadows.scss +65 -0
- package/scss/foundation/core/design/layout/grid.scss +86 -0
- package/scss/foundation/core/design/typography/typography.scss +435 -0
- package/scss/foundation/core/engine/_fluid-core.scss +54 -0
- package/scss/foundation/core/engine/animations.scss +91 -0
- package/scss/foundation/core/engine/buttons.scss +226 -0
- package/scss/foundation/core/engine/color-api.scss +37 -0
- package/scss/foundation/core/engine/helpers.scss +39 -0
- package/scss/foundation/core/engine/layout.scss +156 -0
- package/scss/foundation/core/engine/responsive.scss +67 -0
- package/scss/foundation/core/engine/shadows.scss +186 -0
- package/scss/foundation/core/engine/shortcuts.scss +30 -0
- package/scss/foundation/core/engine/sizing.scss +49 -0
- package/scss/foundation/core/engine/theme-builder.scss +83 -0
- package/scss/foundation/core/engine/typographics.scss +44 -0
- package/scss/foundation/core/engine/typography-calc.scss +71 -0
- package/scss/foundation/foundation.scss +29 -0
- package/scss/foundation/views/_render.scss +13 -0
- package/scss/foundation/views/components/_alert.scss +103 -0
- package/scss/foundation/views/components/_avatar.scss +84 -0
- package/scss/foundation/views/components/_badge.scss +100 -0
- package/scss/foundation/views/components/_breadcrumb.scss +70 -0
- package/scss/foundation/views/components/_card.scss +117 -0
- package/scss/foundation/views/components/_dropdown.scss +123 -0
- package/scss/foundation/views/components/_form.scss +209 -0
- package/scss/foundation/views/components/_index.scss +20 -0
- package/scss/foundation/views/components/_modal.scss +138 -0
- package/scss/foundation/views/components/_pagination.scss +82 -0
- package/scss/foundation/views/components/_skeleton.scss +69 -0
- package/scss/foundation/views/components/_table.scss +94 -0
- package/scss/foundation/views/components/_tabs.scss +96 -0
- package/scss/foundation/views/components/_toast.scss +139 -0
- package/scss/foundation/views/components/_tooltip.scss +100 -0
- package/scss/foundation/views/patterns/_hero.scss +121 -0
- package/scss/foundation/views/patterns/_index.scss +8 -0
- package/scss/foundation/views/patterns/_sidebar-layout.scss +83 -0
- package/scss/foundation/views/render/_layer-order.scss +11 -0
- package/scss/foundation/views/render/classes/_animations.scss +233 -0
- package/scss/foundation/views/render/classes/_aspect-ratio.scss +17 -0
- package/scss/foundation/views/render/classes/_borders.scss +31 -0
- package/scss/foundation/views/render/classes/_buttons.scss +40 -0
- package/scss/foundation/views/render/classes/_colors.scss +83 -0
- package/scss/foundation/views/render/classes/_compounds.scss +103 -0
- package/scss/foundation/views/render/classes/_containers.scss +20 -0
- package/scss/foundation/views/render/classes/_misc-utils.scss +51 -0
- package/scss/foundation/views/render/classes/_position.scss +56 -0
- package/scss/foundation/views/render/classes/_sections.scss +30 -0
- package/scss/foundation/views/render/classes/_shadows.scss +198 -0
- package/scss/foundation/views/render/classes/_sizes.scss +39 -0
- package/scss/foundation/views/render/classes/_sizing-utils.scss +53 -0
- package/scss/foundation/views/render/classes/_spacing.scss +91 -0
- package/scss/foundation/views/render/classes/_state-variants.scss +47 -0
- package/scss/foundation/views/render/classes/_typography.scss +32 -0
- package/scss/foundation/views/render/classes/_utilities.scss +103 -0
- package/scss/foundation/views/render/classes/_z-index.scss +22 -0
- package/scss/foundation/views/render/classes/flexbox.scss +56 -0
- package/scss/foundation/views/render/classes/grid.scss +195 -0
- package/scss/foundation/views/render/classes.scss +116 -0
- package/scss/foundation/views/render/html-body.scss +54 -0
- package/scss/foundation/views/render/property-registration.scss +77 -0
- package/scss/foundation/views/render/reset.scss +147 -0
- package/scss/foundation/views/render/root-generator.scss +166 -0
- package/scss/foundation/views/render/root.scss +19 -0
- package/scss/foundation/views/render/typography.scss +129 -0
- package/scss/llms.txt +247 -0
- package/scss/package.json +89 -0
- package/scss/scripts/gen-cheatsheet.mjs +178 -0
- package/scss/scripts/gen-tokens.mjs +91 -0
- package/scss/scripts/test-compile.mjs +474 -0
- package/scss/zeus.config.scss +99 -0
- package/scss/zeus.customize.scss +246 -0
- package/scss/zeus.scss +17 -0
- package/scss/zeus.token.sets.example.scss +176 -0
- package/scss/zeus.tokens.json +687 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
// ╔══════════════════════════════════════════════════════════════╗
|
|
2
|
+
// ║ ⚡ Zeus CSS — Shadows ║
|
|
3
|
+
// ║ ║
|
|
4
|
+
// ║ Framework internal engine and mixins for shadows. ║
|
|
5
|
+
// ╚══════════════════════════════════════════════════════════════╝
|
|
6
|
+
|
|
7
|
+
// CSS-Var-First: references the already-emitted --shadow-{key} :root token
|
|
8
|
+
// instead of inlining the raw shadow value at every call site — same
|
|
9
|
+
// pattern as padding()/border-radius() (layout.scss) and text()
|
|
10
|
+
// (typographics.scss). Keeps the value runtime-overridable (JS,
|
|
11
|
+
// [data-theme]) and keeps the literal value in one place instead of
|
|
12
|
+
// repeated in every component that references it.
|
|
13
|
+
@function _shadow-var($key) {
|
|
14
|
+
@return var(--shadow-#{$key});
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// -----------------------------------------------------------------------------
|
|
18
|
+
// APPLY SHADOW MIXIN
|
|
19
|
+
// -----------------------------------------------------------------------------
|
|
20
|
+
// Usage: @include apply-shadow("md");
|
|
21
|
+
@mixin apply-shadow($size: "md") {
|
|
22
|
+
box-shadow: _shadow-var($size);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// -----------------------------------------------------------------------------
|
|
26
|
+
// ELEVATION MIXIN
|
|
27
|
+
// -----------------------------------------------------------------------------
|
|
28
|
+
// Usage: @include elevation(2); // Applies shadow-md
|
|
29
|
+
@mixin elevation($level: 1) {
|
|
30
|
+
@if $level == 0 {
|
|
31
|
+
box-shadow: _shadow-var("none");
|
|
32
|
+
} @else if $level == 1 {
|
|
33
|
+
box-shadow: _shadow-var("sm");
|
|
34
|
+
} @else if $level == 2 {
|
|
35
|
+
box-shadow: _shadow-var("md");
|
|
36
|
+
} @else if $level == 3 {
|
|
37
|
+
box-shadow: _shadow-var("lg");
|
|
38
|
+
} @else if $level == 4 {
|
|
39
|
+
box-shadow: _shadow-var("xl");
|
|
40
|
+
} @else if $level == 5 {
|
|
41
|
+
box-shadow: _shadow-var("2xl");
|
|
42
|
+
} @else {
|
|
43
|
+
@warn "Elevation level #{$level} not found. Using default 'md'.";
|
|
44
|
+
box-shadow: _shadow-var("md");
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// -----------------------------------------------------------------------------
|
|
49
|
+
// HOVER SHADOW MIXIN
|
|
50
|
+
// -----------------------------------------------------------------------------
|
|
51
|
+
// Usage: @include hover-shadow("sm", "lg");
|
|
52
|
+
@mixin hover-shadow($default: "md", $hover: "lg") {
|
|
53
|
+
box-shadow: _shadow-var($default);
|
|
54
|
+
transition: box-shadow 0.3s ease;
|
|
55
|
+
|
|
56
|
+
&:hover {
|
|
57
|
+
box-shadow: _shadow-var($hover);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// -----------------------------------------------------------------------------
|
|
62
|
+
// FOCUS SHADOW MIXIN
|
|
63
|
+
// -----------------------------------------------------------------------------
|
|
64
|
+
// Usage: @include focus-shadow("outline");
|
|
65
|
+
@mixin focus-shadow($shadow: "outline") {
|
|
66
|
+
// :focus-visible (not plain :focus) — outline is only removed when the
|
|
67
|
+
// shadow is actually shown, so keyboard users never lose focus indication.
|
|
68
|
+
// The outline itself is kept, just transparent: invisible in normal
|
|
69
|
+
// rendering (box-shadow is the real affordance), but forced-colors mode
|
|
70
|
+
// paints outlines with a system color regardless of author color, so
|
|
71
|
+
// focus stays visible even when box-shadow (stripped under forced-colors)
|
|
72
|
+
// disappears.
|
|
73
|
+
&:focus-visible {
|
|
74
|
+
box-shadow: _shadow-var($shadow);
|
|
75
|
+
outline: 2px solid transparent;
|
|
76
|
+
outline-offset: 2px;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// -----------------------------------------------------------------------------
|
|
81
|
+
// INTERACTIVE SHADOW MIXIN
|
|
82
|
+
// -----------------------------------------------------------------------------
|
|
83
|
+
// Combines hover and focus states
|
|
84
|
+
// Usage: @include interactive-shadow("md", "lg", "outline");
|
|
85
|
+
@mixin interactive-shadow($default: "md", $hover: "lg", $focus: "outline") {
|
|
86
|
+
box-shadow: _shadow-var($default);
|
|
87
|
+
transition: box-shadow 0.3s ease;
|
|
88
|
+
|
|
89
|
+
&:hover {
|
|
90
|
+
box-shadow: _shadow-var($hover);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&:focus-visible {
|
|
94
|
+
box-shadow: _shadow-var($focus);
|
|
95
|
+
// See focus-shadow() above: transparent, not none — stays invisible
|
|
96
|
+
// normally but forced-colors mode paints it with a system color so
|
|
97
|
+
// focus survives box-shadow being stripped.
|
|
98
|
+
outline: 2px solid transparent;
|
|
99
|
+
outline-offset: 2px;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&:active {
|
|
103
|
+
box-shadow: _shadow-var($default);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// -----------------------------------------------------------------------------
|
|
108
|
+
// CARD SHADOW MIXIN
|
|
109
|
+
// -----------------------------------------------------------------------------
|
|
110
|
+
// Pre-configured for cards with hover effect
|
|
111
|
+
// Usage: @include card-shadow();
|
|
112
|
+
@mixin card-shadow() {
|
|
113
|
+
box-shadow: _shadow-var("card");
|
|
114
|
+
transition: box-shadow 0.3s ease;
|
|
115
|
+
|
|
116
|
+
&:hover {
|
|
117
|
+
box-shadow: _shadow-var("card-hover");
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// -----------------------------------------------------------------------------
|
|
122
|
+
// SEMANTIC SHADOW MIXIN
|
|
123
|
+
// -----------------------------------------------------------------------------
|
|
124
|
+
// Usage: @include semantic-shadow("primary");
|
|
125
|
+
@mixin semantic-shadow($type: "primary") {
|
|
126
|
+
box-shadow: _shadow-var($type);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// -----------------------------------------------------------------------------
|
|
130
|
+
// GLOW EFFECT MIXIN
|
|
131
|
+
// -----------------------------------------------------------------------------
|
|
132
|
+
// Usage: @include glow-effect("primary", 0.5);
|
|
133
|
+
@mixin glow-effect($color: rgba(59, 130, 246, 0.5), $blur: 20px) {
|
|
134
|
+
box-shadow: 0 0 $blur 0 $color;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// -----------------------------------------------------------------------------
|
|
138
|
+
// INNER SHADOW MIXIN
|
|
139
|
+
// -----------------------------------------------------------------------------
|
|
140
|
+
// Usage: @include inner-shadow();
|
|
141
|
+
@mixin inner-shadow($size: "inner") {
|
|
142
|
+
box-shadow: _shadow-var($size);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// -----------------------------------------------------------------------------
|
|
146
|
+
// LAYERED SHADOW MIXIN
|
|
147
|
+
// -----------------------------------------------------------------------------
|
|
148
|
+
// Combines multiple shadows
|
|
149
|
+
// Usage: @include layered-shadow("md", "primary");
|
|
150
|
+
@mixin layered-shadow($shadow1, $shadow2) {
|
|
151
|
+
box-shadow: _shadow-var($shadow1), _shadow-var($shadow2);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// -----------------------------------------------------------------------------
|
|
155
|
+
// CONDITIONAL SHADOW MIXIN
|
|
156
|
+
// -----------------------------------------------------------------------------
|
|
157
|
+
// Applies shadow only on certain states
|
|
158
|
+
// Usage: @include conditional-shadow("hover", "lg");
|
|
159
|
+
@mixin conditional-shadow($state: "hover", $shadow: "md") {
|
|
160
|
+
@if $state == "hover" {
|
|
161
|
+
&:hover {
|
|
162
|
+
box-shadow: _shadow-var($shadow);
|
|
163
|
+
transition: box-shadow 0.3s ease;
|
|
164
|
+
}
|
|
165
|
+
} @else if $state == "focus" {
|
|
166
|
+
&:focus-visible {
|
|
167
|
+
box-shadow: _shadow-var($shadow);
|
|
168
|
+
// See focus-shadow() above: transparent, not none — forced-colors
|
|
169
|
+
// mode paints it with a system color regardless of the author value.
|
|
170
|
+
outline: 2px solid transparent;
|
|
171
|
+
outline-offset: 2px;
|
|
172
|
+
}
|
|
173
|
+
} @else if $state == "active" {
|
|
174
|
+
&:active {
|
|
175
|
+
box-shadow: _shadow-var($shadow);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// -----------------------------------------------------------------------------
|
|
181
|
+
// REMOVE SHADOW MIXIN
|
|
182
|
+
// -----------------------------------------------------------------------------
|
|
183
|
+
// Usage: @include no-shadow();
|
|
184
|
+
@mixin no-shadow() {
|
|
185
|
+
box-shadow: none !important;
|
|
186
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// ╔══════════════════════════════════════════════════════════════╗
|
|
2
|
+
// ║ ⚡ Zeus CSS — Shortcuts ║
|
|
3
|
+
// ║ ║
|
|
4
|
+
// ║ Framework internal engine and mixins for shortcuts. ║
|
|
5
|
+
// ╚══════════════════════════════════════════════════════════════╝
|
|
6
|
+
|
|
7
|
+
@use "./layout" as *;
|
|
8
|
+
@use "./typographics" as *;
|
|
9
|
+
|
|
10
|
+
// ╔══════════════════════════════════════════════════════════════╗
|
|
11
|
+
// ║ ⚡ Zeus Shortcuts — Write less, do more ║
|
|
12
|
+
// ║ ║
|
|
13
|
+
// ║ Full-name mixins remain available. These are opt-in aliases ║
|
|
14
|
+
// ║ for rapid prototyping. ║
|
|
15
|
+
// ║ ║
|
|
16
|
+
// ║ p("lg") → padding: var(--space-lg) ║
|
|
17
|
+
// ║ p("lg", "x") → padding-inline: var(--space-lg) ║
|
|
18
|
+
// ║ m("xl", "top") → margin-top: var(--space-xl) ║
|
|
19
|
+
// ║ t("h3") → font: 600 clamp(...) / 1.25 Manrope ║
|
|
20
|
+
// ║ r("md") → border-radius: var(--border-radius-md) ║
|
|
21
|
+
// ║ sz("lg") → width/height: var(--size-icon-lg) ║
|
|
22
|
+
// ║ g("md") → gap: var(--space-md) ║
|
|
23
|
+
// ╚══════════════════════════════════════════════════════════════╝
|
|
24
|
+
|
|
25
|
+
@mixin p($size, $dir: null) { @include padding($size, $dir); }
|
|
26
|
+
@mixin m($size, $dir: null) { @include margin($size, $dir); }
|
|
27
|
+
@mixin g($size, $dir: null) { @include gap($size, $dir); }
|
|
28
|
+
@mixin r($type) { @include border-radius($type); }
|
|
29
|
+
@mixin t($type) { @include text($type); }
|
|
30
|
+
@mixin sz($type) { @include box-size($type); }
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// ╔══════════════════════════════════════════════════════════════╗
|
|
2
|
+
// ║ ⚡ Zeus CSS — Sizing ║
|
|
3
|
+
// ║ ║
|
|
4
|
+
// ║ Framework internal engine and mixins for sizing. ║
|
|
5
|
+
// ╚══════════════════════════════════════════════════════════════╝
|
|
6
|
+
|
|
7
|
+
@use "sass:math";
|
|
8
|
+
@use "sass:map";
|
|
9
|
+
@use "./fluid-core" as fc;
|
|
10
|
+
@use "../design/core/basic" as *;
|
|
11
|
+
|
|
12
|
+
// ╔══════════════════════════════════════════════════════════════╗
|
|
13
|
+
// ║ 📐 Zeus Sizing Engine — Clamp by Default ║
|
|
14
|
+
// ║ ║
|
|
15
|
+
// ║ Generates CSS clamp() for any (min, max, container) pair. ║
|
|
16
|
+
// ║ Applies responsive fluid scaling to gaps, outer margins, ║
|
|
17
|
+
// ║ ║
|
|
18
|
+
// ║ Output units: px (layout values, not typography) ║
|
|
19
|
+
// ║ Always fluid — no flag needed. If min == max → static. ║
|
|
20
|
+
// ╚══════════════════════════════════════════════════════════════╝
|
|
21
|
+
|
|
22
|
+
// ── Public API ───────────────────────────────────────────────────
|
|
23
|
+
//
|
|
24
|
+
// useclamp-sizing($min, $max, $c-floor?, $c-ceil?, $precision?)
|
|
25
|
+
//
|
|
26
|
+
// Parameters
|
|
27
|
+
// $min — smallest value in px (unitless number), at $c-floor
|
|
28
|
+
// $max — largest value in px (unitless number), at $c-ceil
|
|
29
|
+
// $c-floor — container width where scaling starts (default: 320)
|
|
30
|
+
// $c-ceil — container width where scaling ends (default: 2560)
|
|
31
|
+
// $precision — decimal places in compiled CSS (default: 3)
|
|
32
|
+
//
|
|
33
|
+
// Returns: clamp() string in px. Static #{$min}px only if min == max.
|
|
34
|
+
//
|
|
35
|
+
// Usage:
|
|
36
|
+
// padding: useclamp-sizing(12, 24);
|
|
37
|
+
// gap: useclamp-sizing(8, 16, 320, 1440);
|
|
38
|
+
//
|
|
39
|
+
@function useclamp-sizing($min,
|
|
40
|
+
$max,
|
|
41
|
+
$c-floor: map.get($container-bounds, "floor"),
|
|
42
|
+
$c-ceil: map.get($container-bounds, "ceil"),
|
|
43
|
+
$precision: 1) {
|
|
44
|
+
@if $min ==$max {
|
|
45
|
+
@return #{$min}px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@return fc.zeus-cqi-fluid($min, $max, $c-floor, $c-ceil, "px", $precision);
|
|
49
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// ╔══════════════════════════════════════════════════════════════╗
|
|
2
|
+
// ║ ⚡ Zeus CSS — Theme Builder ║
|
|
3
|
+
// ║ ║
|
|
4
|
+
// ║ Framework internal engine and mixins for theme builder. ║
|
|
5
|
+
// ╚══════════════════════════════════════════════════════════════╝
|
|
6
|
+
|
|
7
|
+
@use "sass:map";
|
|
8
|
+
@use "../design/colors/color-derivation" as derive;
|
|
9
|
+
|
|
10
|
+
// ╔══════════════════════════════════════════════════════════════╗
|
|
11
|
+
// ║ 🎨 Zeus Theme Builder ║
|
|
12
|
+
// ║ ║
|
|
13
|
+
// ║ Create a complete theme in one mixin call. ║
|
|
14
|
+
// ║ Auto-derives the full default-palette token set (including ║
|
|
15
|
+
// ║ --color-surface-subtle / --color-warning-subtle, so `code` ║
|
|
16
|
+
// ║ and `mark` render correctly under the theme too) from just ║
|
|
17
|
+
// ║ 4 required + 1 optional input color. ║
|
|
18
|
+
// ║ ║
|
|
19
|
+
// ║ Usage: ║
|
|
20
|
+
// ║ @include zeus-theme("ocean", ( ║
|
|
21
|
+
// ║ primary: #0077b6, ║
|
|
22
|
+
// ║ secondary: #00b4d8, ║
|
|
23
|
+
// ║ accent: #ff9f1c, // optional ║
|
|
24
|
+
// ║ body: #caf0f8, ║
|
|
25
|
+
// ║ text: #023e8a, ║
|
|
26
|
+
// ║ )); ║
|
|
27
|
+
// ╚══════════════════════════════════════════════════════════════╝
|
|
28
|
+
|
|
29
|
+
@mixin zeus-theme($name, $config) {
|
|
30
|
+
$primary: map.get($config, "primary");
|
|
31
|
+
$secondary: map.get($config, "secondary");
|
|
32
|
+
$accent: map.get($config, "accent");
|
|
33
|
+
$body: map.get($config, "body");
|
|
34
|
+
$text: map.get($config, "text");
|
|
35
|
+
|
|
36
|
+
[data-theme="#{$name}"] {
|
|
37
|
+
// Layer colors using the same derivation math as the default palette
|
|
38
|
+
// (core/design/colors/_color-derivation.scss) — so a named theme's
|
|
39
|
+
// light/dark/muted/border "weight" always matches the default's,
|
|
40
|
+
// instead of two independently hand-tuned percentages drifting apart.
|
|
41
|
+
@if $primary {
|
|
42
|
+
--color-primary: #{$primary};
|
|
43
|
+
--color-primary-light: #{derive.derive-light("var(--color-primary)")};
|
|
44
|
+
--color-primary-dark: #{derive.derive-dark("var(--color-primary)")};
|
|
45
|
+
}
|
|
46
|
+
@if $secondary {
|
|
47
|
+
--color-secondary: #{$secondary};
|
|
48
|
+
--color-secondary-light: #{derive.derive-light("var(--color-secondary)")};
|
|
49
|
+
--color-secondary-dark: #{derive.derive-dark("var(--color-secondary)")};
|
|
50
|
+
}
|
|
51
|
+
@if $accent {
|
|
52
|
+
--color-accent: #{$accent};
|
|
53
|
+
--color-accent-light: #{derive.derive-light("var(--color-accent)")};
|
|
54
|
+
--color-accent-dark: #{derive.derive-dark("var(--color-accent)")};
|
|
55
|
+
}
|
|
56
|
+
@if $body {
|
|
57
|
+
--color-background: #{$body};
|
|
58
|
+
--color-surface: #{derive.derive-surface("var(--color-background)")};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Font colors — auto-derive from text + body
|
|
62
|
+
@if $text and $body {
|
|
63
|
+
--color-text: #{$text};
|
|
64
|
+
--color-text-muted: #{derive.derive-muted("var(--color-text)", "var(--color-background)")};
|
|
65
|
+
--color-text-inverse: #{$body};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Border colors — auto-derive from text + body
|
|
69
|
+
@if $text and $body {
|
|
70
|
+
--color-border-strong: #{derive.derive-border-strong("var(--color-text)", "var(--color-background)")};
|
|
71
|
+
--color-border: #{derive.derive-border("var(--color-text)", "var(--color-background)")};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Subtle surfaces — same tokens :where(code)/:where(mark) rely on in the
|
|
75
|
+
// default palette (render/typography.scss). --base-system-warning is a
|
|
76
|
+
// global token (core/design/colors/base-colors.scss), shared across all
|
|
77
|
+
// themes, not redefined per-theme.
|
|
78
|
+
@if $text and $body {
|
|
79
|
+
--color-surface-subtle: #{derive.derive-surface-subtle("var(--color-surface)", "var(--color-text)")};
|
|
80
|
+
--color-warning-subtle: #{derive.derive-warning-subtle("var(--base-system-warning)", "var(--color-background)")};
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// ╔══════════════════════════════════════════════════════════════╗
|
|
2
|
+
// ║ ⚡ Zeus CSS — Typographics ║
|
|
3
|
+
// ║ ║
|
|
4
|
+
// ║ Framework internal engine and mixins for typographics. ║
|
|
5
|
+
// ╚══════════════════════════════════════════════════════════════╝
|
|
6
|
+
|
|
7
|
+
@use "sass:map";
|
|
8
|
+
@use "./helpers" as *;
|
|
9
|
+
@use "./sizing" as *;
|
|
10
|
+
@use "./typography-calc" as *;
|
|
11
|
+
@use "./responsive" as *;
|
|
12
|
+
@use "../design/typography/typography" as *;
|
|
13
|
+
|
|
14
|
+
// CSS-Var-First typography mixin — v2.1
|
|
15
|
+
// References the :root --text-{type} var instead of recomputing inline.
|
|
16
|
+
// The var is already generated by root-generator.scss.
|
|
17
|
+
@mixin text($type) {
|
|
18
|
+
@if not map.has-key($typography, $type) {
|
|
19
|
+
@error "Font type '#{$type}' not found in $typography map";
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// CSS-Var-First: single reference, computation lives once in :root
|
|
23
|
+
font: var(--text-#{$type});
|
|
24
|
+
|
|
25
|
+
$config: map.get($typography, $type);
|
|
26
|
+
|
|
27
|
+
// Letter-spacing — not part of font shorthand, output separately
|
|
28
|
+
// Fixed: em (proportional to font-size), was incorrectly px in v2.0
|
|
29
|
+
$letter-spacing: map.get($config, "ls");
|
|
30
|
+
@if $letter-spacing and $letter-spacing != 0 {
|
|
31
|
+
letter-spacing: #{$letter-spacing}em;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Role-based auto CSS properties
|
|
35
|
+
$role: map.get($config, "role");
|
|
36
|
+
@if $role == "heading" {
|
|
37
|
+
text-wrap: balance;
|
|
38
|
+
} @else if $role == "body" {
|
|
39
|
+
text-wrap: pretty;
|
|
40
|
+
} @else if $role == "code" {
|
|
41
|
+
font-variant-ligatures: none;
|
|
42
|
+
tab-size: 4;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// ╔══════════════════════════════════════════════════════════════╗
|
|
2
|
+
// ║ ⚡ Zeus CSS — Typography Calc ║
|
|
3
|
+
// ║ ║
|
|
4
|
+
// ║ Framework internal engine and mixins for typography calc. ║
|
|
5
|
+
// ╚══════════════════════════════════════════════════════════════╝
|
|
6
|
+
|
|
7
|
+
@use "sass:map";
|
|
8
|
+
@use "sass:math";
|
|
9
|
+
@use "../design/core/basic" as *;
|
|
10
|
+
@use "../design/typography/typography" as *;
|
|
11
|
+
@use "./fluid-core" as fc;
|
|
12
|
+
|
|
13
|
+
// ╔══════════════════════════════════════════════════════════════╗
|
|
14
|
+
// ║ 🔤 Zeus Fluid Typography Engine ║
|
|
15
|
+
// ║ ║
|
|
16
|
+
// ║ Generates CSS clamp() for fluid type scaling (CQI). ║
|
|
17
|
+
// ║ Container bounds sourced from $container-bounds ║
|
|
18
|
+
// ║ (design/core/basic.scss) — single source of truth. ║
|
|
19
|
+
// ║ ║
|
|
20
|
+
// ║ Output units: rem (typography scales with user font prefs) ║
|
|
21
|
+
// ║ Used by: root-generator.scss → --text-{type} ║
|
|
22
|
+
// ╚══════════════════════════════════════════════════════════════╝
|
|
23
|
+
|
|
24
|
+
// ── Private: px → rem ────────────────────────────────────────────
|
|
25
|
+
// Converts a unitless px value to rem using $root-font-size (basic.scss).
|
|
26
|
+
// Robust if $root-font-size is ever changed from 16px.
|
|
27
|
+
@function _px-to-rem($px, $precision: 2) {
|
|
28
|
+
$base: math.div($root-font-size, 1px);
|
|
29
|
+
@return fc.round-to(math.div($px, $base), $precision);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// ── Public API ───────────────────────────────────────────────────
|
|
33
|
+
//
|
|
34
|
+
// useclamp-typography($typeface, $precision?)
|
|
35
|
+
//
|
|
36
|
+
// Parameters
|
|
37
|
+
// $typeface — key in the $typography token map (e.g. "h1", "body-sm")
|
|
38
|
+
// $precision — decimal places in compiled CSS (default: 1)
|
|
39
|
+
//
|
|
40
|
+
// Returns: clamp() string in rem units (using cqi).
|
|
41
|
+
//
|
|
42
|
+
//
|
|
43
|
+
@function useclamp-typography($typeface, $precision: 1) {
|
|
44
|
+
@if not map.has-key($typography, $typeface) {
|
|
45
|
+
@error "[Zeus] Typography variant '#{$typeface}' not found in $typography map.";
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
$token: map.get($typography, $typeface);
|
|
49
|
+
|
|
50
|
+
@if not map.has-key($token, "size") {
|
|
51
|
+
@error "[Zeus] Typography token '#{$typeface}' is missing a 'size' key.";
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
$size: map.get($token, "size");
|
|
55
|
+
$min-px: map.get($size, "floor");
|
|
56
|
+
$max-px: map.get($size, "ceil");
|
|
57
|
+
|
|
58
|
+
@if $min-px ==$max-px {
|
|
59
|
+
@return #{_px-to-rem($min-px, $precision)}rem;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Convert px tokens to rem, then pass to the shared linear engine
|
|
63
|
+
$min-rem: _px-to-rem($min-px, 2);
|
|
64
|
+
$max-rem: _px-to-rem($max-px, 2);
|
|
65
|
+
|
|
66
|
+
// Convert container bounds to rem so they match the fluid unit scale
|
|
67
|
+
$c-floor: _px-to-rem(map.get($container-bounds, "floor"), 2);
|
|
68
|
+
$c-ceil: _px-to-rem(map.get($container-bounds, "ceil"), 2);
|
|
69
|
+
|
|
70
|
+
@return fc.zeus-cqi-fluid($min-rem, $max-rem, $c-floor, $c-ceil, "rem", 1);
|
|
71
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// ╔══════════════════════════════════════════════════════════════╗
|
|
2
|
+
// ║ ⚡ Zeus CSS — Foundation ║
|
|
3
|
+
// ║ ║
|
|
4
|
+
// ║ Core styles and definitions for foundation. ║
|
|
5
|
+
// ╚══════════════════════════════════════════════════════════════╝
|
|
6
|
+
|
|
7
|
+
// ╔══════════════════════════════════════════════════════════════╗
|
|
8
|
+
// ║ ⚡ Zeus CSS — Main Stylesheet ║
|
|
9
|
+
// ║ ║
|
|
10
|
+
// ║ Full compiled CSS for production. ║
|
|
11
|
+
// ║ Import in root layout or link in HTML. ║
|
|
12
|
+
// ║ ║
|
|
13
|
+
// ║ Unlike zeus.scss (which exports only utilities for ║
|
|
14
|
+
// ║ .module.scss), this file outputs real CSS classes. ║
|
|
15
|
+
// ╚══════════════════════════════════════════════════════════════╝
|
|
16
|
+
|
|
17
|
+
@use "../zeus.config" as config;
|
|
18
|
+
@use "./core/design";
|
|
19
|
+
@use "./core/engine";
|
|
20
|
+
@use "./core/api";
|
|
21
|
+
@use "./views/render";
|
|
22
|
+
@use "./views/components";
|
|
23
|
+
@use "./views/patterns";
|
|
24
|
+
|
|
25
|
+
// The cascade layer order (reset, tokens, base, layout, components,
|
|
26
|
+
// utilities) is established in views/render/_layer-order.scss, forwarded
|
|
27
|
+
// FIRST from views/_render.scss — see that file for why.
|
|
28
|
+
|
|
29
|
+
/* Zeus CSS v#{config.$zeus-version} */
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// ╔══════════════════════════════════════════════════════════════╗
|
|
2
|
+
// ║ ⚡ Zeus CSS — Render ║
|
|
3
|
+
// ║ ║
|
|
4
|
+
// ║ Core styles and definitions for render. ║
|
|
5
|
+
// ╚══════════════════════════════════════════════════════════════╝
|
|
6
|
+
|
|
7
|
+
@forward "./render/layer-order";
|
|
8
|
+
@forward "./render/reset";
|
|
9
|
+
@forward "./render/property-registration";
|
|
10
|
+
@forward "./render/typography";
|
|
11
|
+
@forward "./render/root";
|
|
12
|
+
@forward "./render/html-body";
|
|
13
|
+
@forward "./render/classes";
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
// ╔══════════════════════════════════════════════════════════════╗
|
|
2
|
+
// ║ ⚡ Zeus CSS — Alert ║
|
|
3
|
+
// ║ ║
|
|
4
|
+
// ║ Core structural and visual styles for the alert component. ║
|
|
5
|
+
// ╚══════════════════════════════════════════════════════════════╝
|
|
6
|
+
|
|
7
|
+
@use "../../core/engine" as *;
|
|
8
|
+
@use "../../core/design" as *;
|
|
9
|
+
|
|
10
|
+
// ╔══════════════════════════════════════════════════════════════╗
|
|
11
|
+
// ║ 🔔 Alert Component ║
|
|
12
|
+
// ║ ║
|
|
13
|
+
// ║ Inline status message with a left accent border and tinted ║
|
|
14
|
+
// ║ background. Same color-mix() contrast strategy as .z-badge ║
|
|
15
|
+
// ║ — text is always darkened toward black, independent of the ║
|
|
16
|
+
// ║ base hue's own lightness. ║
|
|
17
|
+
// ║ ║
|
|
18
|
+
// ║ Usage: ║
|
|
19
|
+
// ║ <div class="z-alert z-alert--success" role="alert"> ║
|
|
20
|
+
// ║ <p class="z-alert__title">Saved</p> ║
|
|
21
|
+
// ║ <p class="z-alert__text">Your changes are live.</p> ║
|
|
22
|
+
// ║ <button class="z-alert__close" aria-label="Dismiss">×</button>║
|
|
23
|
+
// ║ </div> ║
|
|
24
|
+
// ╚══════════════════════════════════════════════════════════════╝
|
|
25
|
+
|
|
26
|
+
@layer components {
|
|
27
|
+
// Mixed toward `transparent`, not `--color-surface` — see .z-badge's
|
|
28
|
+
// _badge-variant comment for why (surface's defined-but-zero hue
|
|
29
|
+
// corrupts the circular hue interpolation, verified live).
|
|
30
|
+
@mixin _alert-variant($css-var) {
|
|
31
|
+
background: color-mix(in oklch, var(#{$css-var}) 10%, transparent);
|
|
32
|
+
border-inline-start-color: var(#{$css-var});
|
|
33
|
+
|
|
34
|
+
// Same 55%-toward-black ratio as .z-badge — verified to clear 7.3:1
|
|
35
|
+
// even for the lightest brand hue (accent).
|
|
36
|
+
.z-alert__title {
|
|
37
|
+
color: color-mix(in oklch, var(#{$css-var}) 55%, black);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.z-alert {
|
|
42
|
+
display: flex;
|
|
43
|
+
align-items: flex-start;
|
|
44
|
+
gap: var(--space-sm);
|
|
45
|
+
@include padding("md");
|
|
46
|
+
@include border-radius("sm");
|
|
47
|
+
border: var(--border-line-xs) solid var(--color-border);
|
|
48
|
+
border-inline-start: var(--border-line-md) solid var(--color-border-strong);
|
|
49
|
+
background: var(--color-surface-subtle);
|
|
50
|
+
|
|
51
|
+
&--info { @include _alert-variant(--color-primary); }
|
|
52
|
+
&--success { @include _alert-variant(--base-system-success); }
|
|
53
|
+
&--warning { @include _alert-variant(--base-system-warning); }
|
|
54
|
+
&--error { @include _alert-variant(--base-system-error); }
|
|
55
|
+
|
|
56
|
+
&__icon {
|
|
57
|
+
flex-shrink: 0;
|
|
58
|
+
@include box-size(md);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&__content {
|
|
62
|
+
flex: 1 1 auto;
|
|
63
|
+
min-width: 0;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&__title {
|
|
67
|
+
@include text("body-sm-bold");
|
|
68
|
+
color: var(--color-text);
|
|
69
|
+
margin: 0;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&__text {
|
|
73
|
+
@include text("body-sm");
|
|
74
|
+
color: var(--color-text-muted);
|
|
75
|
+
margin: 0;
|
|
76
|
+
|
|
77
|
+
.z-alert__title + & {
|
|
78
|
+
margin-top: var(--space-3xs);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&__close {
|
|
83
|
+
appearance: none;
|
|
84
|
+
border: none;
|
|
85
|
+
background: transparent;
|
|
86
|
+
flex-shrink: 0;
|
|
87
|
+
@include text("body");
|
|
88
|
+
color: var(--color-text-muted);
|
|
89
|
+
cursor: pointer;
|
|
90
|
+
padding: 0;
|
|
91
|
+
line-height: 1;
|
|
92
|
+
|
|
93
|
+
&:hover {
|
|
94
|
+
color: var(--color-text);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&:focus-visible {
|
|
98
|
+
outline: $focus-ring;
|
|
99
|
+
outline-offset: 2px;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|