zeus-css 1.0.12 → 1.0.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zeus-css",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "⚡ A Premium, Zero-Emission, Fluid-Scaling CSS Framework based on Sass SCSS Engine",
5
5
  "author": "Stavros Lazaris",
6
6
  "license": "MIT",
@@ -17,12 +17,9 @@
17
17
  "bin": {
18
18
  "zeus-css": "bin/init.js"
19
19
  },
20
- "scripts": {
21
- "postinstall": "node ./bin/postinstall.js"
22
- },
23
20
  "exports": {
24
21
  ".": {
25
- "sass": "./scss/zeus.scss",
22
+ "sass": "./scss/foundation/foundation.scss",
26
23
  "css": "./dist/zeus.css",
27
24
  "default": "./dist/zeus.css"
28
25
  },
@@ -37,12 +34,18 @@
37
34
  "./bin/*": "./bin/*"
38
35
  },
39
36
  "files": [
40
- "scss",
37
+ "scss/foundation",
38
+ "scss/zeus.scss",
39
+ "scss/zeus.config.scss",
40
+ "scss/zeus.customize.scss",
41
+ "scss/zeus.token.sets.example.scss",
42
+ "scss/zeus.tokens.json",
41
43
  "dist",
42
- "bin"
44
+ "bin",
45
+ "CHANGELOG.md"
43
46
  ],
44
47
  "peerDependencies": {
45
- "sass": "^1.60.0"
48
+ "sass": "^1.79.0"
46
49
  },
47
50
  "keywords": [
48
51
  "zeus",
@@ -0,0 +1,112 @@
1
+ # Changelog
2
+
3
+ All notable changes to zeus-css are documented in this file.
4
+ Format loosely follows [Keep a Changelog](https://keepachangelog.com/).
5
+
6
+ ## [1.0.13]
7
+
8
+ ### Fixed
9
+
10
+ - **Package tarball no longer ships a stale nested copy of the framework.**
11
+ `scss/dist/*.css` (a 1.0.0-era build with 12 instances of `outline: none`
12
+ instead of the current 7 — an accessibility fix that had already shipped
13
+ in the real `dist/`), the nested `scss/package.json`, `.stylelintrc.json`,
14
+ and dev-only build scripts are no longer included in `files`. Unpacked
15
+ package size drops from carrying a full second copy of the framework to
16
+ just the intended source.
17
+ - **`exports["."].sass` now resolves to `./scss/foundation/foundation.scss`**
18
+ instead of `./scss/zeus.scss`. The latter is an intentional zero-emission
19
+ bridge (four `@forward` statements, no CSS) meant for component
20
+ `.module.scss` files via the `zeus-css/zeus` subpath — it was never meant
21
+ to be the target of the bare `zeus-css` import. `@use "pkg:zeus-css"` (or
22
+ any bundler's `sass` condition resolution) now returns the actual
23
+ framework instead of silently compiling to nothing.
24
+ - Fixed a compile crash (`Invalid index 2 for a list with 1 elements`) when
25
+ `$zeus-breakpoints` is overridden down to a single entry. The breakpoint
26
+ sort in `root-generator.scss` now guards `$n > 1` before entering the
27
+ loop.
28
+ - `<main>` no longer collapses to near-zero width as a flex item. It was
29
+ included (with `body` and `.container`) in the container-query
30
+ `container-type: inline-size` reset, which removes it from normal
31
+ content-based sizing; unlike `body`/`.container`, `<main>` in a flex
32
+ context has no other width source. Removed from that selector, matching
33
+ the reasoning already applied to `.grid`.
34
+ - `[hidden]` can now be overridden. The reset declared
35
+ `display: none !important` inside `@layer reset` — the first layer in
36
+ cascade order — and layer order reverses for `!important` declarations,
37
+ so nothing later (layered or not) could win. The `!important` is gone,
38
+ and the selector is now `:where([hidden]):not([hidden="until-found"])`
39
+ so `hidden="until-found"` content stays reachable by in-page find, per
40
+ the HTML spec's own recommended selector for this rule.
41
+ - Fluid typography no longer rounds to visible 1.6px steps. The shared
42
+ clamp() engine's `$step` defaults to `0.1` in the *output* unit — fine at
43
+ 0.1px for spacing, but 0.1rem (1.6px) for type. Typography now compiles
44
+ with `$step: 0.01` / `$accuracy: 3`, and declared min/max endpoints are
45
+ now reached in practice instead of stopping ~1.6px short.
46
+ - `overflow-wrap: anywhere` removed from the `body` reset. It was declared
47
+ alongside `word-break: break-word`, which already handles overflow
48
+ safely; `anywhere` additionally breaks inside words that don't need it,
49
+ including in narrow columns where it isn't wanted.
50
+ - Added `border-style: solid` to the universal box-sizing reset. Elements
51
+ reset with `border: 0` (`button`, `input`, `textarea`, `select`) stayed
52
+ invisible even after a consumer later added `border-width`/`border-color`,
53
+ because `border-style` defaulted to `none`. Same fix Tailwind's preflight
54
+ uses.
55
+ - `bin/init.js` now exits non-zero on a failed scaffold instead of
56
+ swallowing the error and exiting 0, and responds to `--help`/`-h` with
57
+ usage instead of running the full init routine against the current
58
+ directory.
59
+ - `peerDependencies.sass` raised from `^1.60.0` to `^1.79.0`, matching the
60
+ actual floor required by the relative `oklch(from ...)` color syntax and
61
+ the `pkg:` importer used in the docs.
62
+ - Removed the `postinstall` script (`bin/postinstall.js`) and its
63
+ `package.json` hook. It only printed a discovery hint for
64
+ `npx zeus-css init`, already covered in the README — not worth pnpm 10
65
+ blocking lifecycle scripts by default, or the supply-chain-scanner flags
66
+ a postinstall script draws for no functional benefit.
67
+ - Corrected the README's `@property` claim — coverage is the base semantic
68
+ color palette (5 tokens), not "key tokens" broadly; derived color
69
+ variants, spacing, and typography remain plain custom properties.
70
+ - Removed `body-md`, `body-md-bold`, `body-md-semibold`, and `body-md-medium`
71
+ from the typography token map — they were byte-for-byte duplicates of
72
+ `body`/`body-bold`/`body-semibold`/`body-medium`. `--text-body` is now
73
+ the single source; regenerated `zeus.tokens.json`, `cheatsheet.md`, and
74
+ `llms.txt` (both the `scss/` copies and the package-root mirrors, which
75
+ had drifted out of sync). The two real consumers of `--text-body-md`
76
+ (`FinalHeader.module.scss`, `CtaBlock.module.scss`, both outside this
77
+ package) were migrated to `--text-body` — same value, no visual change.
78
+ - Fixed an unrelated bug found while migrating `CtaBlock.module.scss`:
79
+ `.installBox` set `font-size: var(--text-body)`, but `--text-body` is a
80
+ `font` *shorthand* (weight/size/line-height/family), not a bare size —
81
+ invalid as a `font-size` value, so it silently fell back to inherited.
82
+ Replaced with `font: var(--text-code);`, matching the token its sibling
83
+ widget (`TheZeusHero.module.scss` `.install`) already uses, per the
84
+ file's own "kept in visual sync" comment.
85
+ - Documented that Zeus intentionally ships one color palette with no
86
+ `prefers-color-scheme` / light-dark switching — not a gap, a design
87
+ decision. `zeus-theme()` is for swapping the whole palette (e.g. a
88
+ different brand), not a light/dark toggle. See README Features.
89
+ - Fixed a silent-drop bug in color token emission: explicitly setting a
90
+ derived color key in `$zeus-colors` (e.g. `primary-light`) made
91
+ `semantic-colors.scss` skip emitting it, on the assumption that
92
+ `root-generator.scss`'s generic pipeline would emit it instead — but that
93
+ pipeline deliberately excludes `$zeus-colors`. The variable vanished from
94
+ the compiled CSS entirely; with `$zeus-enable-property-registration`
95
+ left at its default it was masked by `@property`'s `initial-value`
96
+ incidentally supplying the same value, but disabling that flag exposed
97
+ the break directly. `_emit-static-color-vars` now always emits every
98
+ variant, using the explicit override when present and the derived value
99
+ otherwise.
100
+
101
+ ### Known issues (tracked, not in this release)
102
+
103
+ - `round()`/`oklch(from ...)` are used throughout the compiled CSS with no
104
+ `@supports` fallback, so browsers without CSS `round()` support drop the
105
+ affected `clamp()` declarations entirely. Needs a systematic
106
+ progressive-enhancement pass, not a patch-sized fix.
107
+ - Class naming mixes three conventions (`z-*` BEM components, `btn-*` and
108
+ `.container` utilities, both covered by `$zeus-use-prefix`). Decided:
109
+ keep as-is rather than a breaking rename — `$zeus-use-prefix` defaults
110
+ to `false`, so `.container`/`btn-*` are unprefixed unless opted in; this
111
+ is now called out explicitly in `API.md` as a collision risk when
112
+ running alongside another framework.
@@ -54,50 +54,43 @@ $_known-color-keys: (
54
54
  // ║ from 5 resolved base colors. ║
55
55
  // ║ Single source of truth shared with engine/theme-builder.scss. ║
56
56
  // ╚══════════════════════════════════════════════════════════════╝
57
+ // Emits $key either from the developer's explicit $zeus-colors override or
58
+ // from $derived. root-generator.scss's generic token pipeline deliberately
59
+ // excludes $zeus-colors (see _design-system.scss), so this is the only
60
+ // place a variant key ever gets emitted — skipping it on _has($key) (as
61
+ // this used to do, on the assumption something else emitted it) silently
62
+ // dropped the variable from the compiled CSS entirely whenever a developer
63
+ // set it explicitly.
64
+ @function _resolved($key, $derived) {
65
+ @if _has($key) {
66
+ @return _c($key, $derived);
67
+ } @else {
68
+ @return $derived;
69
+ }
70
+ }
71
+
57
72
  @mixin _emit-static-color-vars($primary, $secondary, $accent, $text, $bg) {
58
73
  --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
- }
74
+ --color-primary-light: #{_resolved("primary-light", derive.derive-light("var(--color-primary)"))};
75
+ --color-primary-dark: #{_resolved("primary-dark", derive.derive-dark("var(--color-primary)"))};
65
76
 
66
77
  --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
- }
78
+ --color-secondary-light: #{_resolved("secondary-light", derive.derive-light("var(--color-secondary)"))};
79
+ --color-secondary-dark: #{_resolved("secondary-dark", derive.derive-dark("var(--color-secondary)"))};
73
80
 
74
81
  --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
- }
82
+ --color-accent-light: #{_resolved("accent-light", derive.derive-light("var(--color-accent)"))};
83
+ --color-accent-dark: #{_resolved("accent-dark", derive.derive-dark("var(--color-accent)"))};
81
84
 
82
85
  --color-background: #{$bg};
83
- @if not _has("surface") {
84
- --color-surface: #{derive.derive-surface("var(--color-background)")};
85
- }
86
+ --color-surface: #{_resolved("surface", derive.derive-surface("var(--color-background)"))};
86
87
 
87
88
  --color-text: #{$text};
88
- @if not _has("text-inverse") {
89
- --color-text-inverse: #{$bg};
90
- }
89
+ --color-text-inverse: #{_resolved("text-inverse", $bg)};
91
90
 
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
- }
91
+ --color-text-muted: #{_resolved("text-muted", derive.derive-muted("var(--color-text)", "var(--color-background)"))};
92
+ --color-border: #{_resolved("border", derive.derive-border("var(--color-text)", "var(--color-background)"))};
93
+ --color-border-strong: #{_resolved("border-strong", derive.derive-border-strong("var(--color-text)", "var(--color-background)"))};
101
94
 
102
95
  --color-surface-subtle: #{derive.derive-surface-subtle("var(--color-surface)", "var(--color-text)")};
103
96
  --color-warning-subtle: #{derive.derive-warning-subtle("var(--base-system-warning)", "var(--color-background)")};
@@ -218,15 +218,6 @@ $_typography-defaults: (
218
218
  weight: 400,
219
219
  role: "body",
220
220
  ),
221
- "body-md": (family: "primary",
222
- size: (floor: 16,
223
- ceil: 18,
224
- ),
225
- lh: 1.6,
226
- ls: 0,
227
- weight: 400,
228
- role: "body",
229
- ),
230
221
  "body-bold": (family: "primary",
231
222
  size: (floor: 16,
232
223
  ceil: 18,
@@ -236,15 +227,6 @@ $_typography-defaults: (
236
227
  weight: 700,
237
228
  role: "body",
238
229
  ),
239
- "body-md-bold": (family: "primary",
240
- size: (floor: 16,
241
- ceil: 18,
242
- ),
243
- lh: 1.6,
244
- ls: 0,
245
- weight: 700,
246
- role: "body",
247
- ),
248
230
  "body-semibold": (family: "primary",
249
231
  size: (floor: 16,
250
232
  ceil: 18,
@@ -254,15 +236,6 @@ $_typography-defaults: (
254
236
  weight: 600,
255
237
  role: "body",
256
238
  ),
257
- "body-md-semibold": (family: "primary",
258
- size: (floor: 16,
259
- ceil: 18,
260
- ),
261
- lh: 1.6,
262
- ls: 0,
263
- weight: 600,
264
- role: "body",
265
- ),
266
239
  "body-medium": (family: "primary",
267
240
  size: (floor: 16,
268
241
  ceil: 18,
@@ -272,15 +245,6 @@ $_typography-defaults: (
272
245
  weight: 500,
273
246
  role: "body",
274
247
  ),
275
- "body-md-medium": (family: "primary",
276
- size: (floor: 16,
277
- ceil: 18,
278
- ),
279
- lh: 1.6,
280
- ls: 0,
281
- weight: 500,
282
- role: "body",
283
- ),
284
248
  "body-sm": (family: "primary",
285
249
  size: (floor: 14,
286
250
  ceil: 16,
@@ -67,5 +67,10 @@
67
67
  $c-floor: _px-to-rem(map.get($container-bounds, "floor"), 2);
68
68
  $c-ceil: _px-to-rem(map.get($container-bounds, "ceil"), 2);
69
69
 
70
- @return fc.zeus-cqi-fluid($min-rem, $max-rem, $c-floor, $c-ceil, "rem", 1);
70
+ // $step in rem defaults to 0.1 (fluid-core.scss), i.e. a 1.6px jump at the
71
+ // 16px root — visible banding in type that isn't visible in px-based
72
+ // spacing. A finer step (and matching $accuracy) keeps the rem rounding
73
+ // below the threshold where it reads as a step, and lets endpoints
74
+ // actually reach their declared min/max instead of stopping short.
75
+ @return fc.zeus-cqi-fluid($min-rem, $max-rem, $c-floor, $c-ceil, "rem", 3, 0.01);
71
76
  }
@@ -36,7 +36,7 @@ $_zp: "";
36
36
  // grid inside a narrow column made every token (spacing/borders/icons/
37
37
  // typography) smaller with each level. Use the opt-in .cq class below on
38
38
  // any specific .grid that should size its own contents.
39
- body, main, .#{$_zp}container {
39
+ body, .#{$_zp}container {
40
40
  container-type: inline-size;
41
41
  }
42
42
 
@@ -47,7 +47,6 @@ $_zp: "";
47
47
  body {
48
48
  color: var(--color-text);
49
49
  background-color: var(--color-background);
50
- overflow-wrap: anywhere;
51
50
  word-break: break-word;
52
51
  @include text(body);
53
52
  }
@@ -32,11 +32,19 @@
32
32
  padding: 0;
33
33
  }
34
34
 
35
- // Universal box-sizing
35
+ // Universal box-sizing. border-width: 0 keeps every element invisible by
36
+ // default (the browser's own default border-width, ~3px "medium", would
37
+ // otherwise render on every element the moment border-style is forced to
38
+ // solid below) — border-style: solid then means a later border-width/
39
+ // color pair is visible immediately, without it, elements reset with
40
+ // border: 0 (button, input, textarea, select below) stay invisible even
41
+ // after a consumer adds width/color, since style defaults to none.
36
42
  *,
37
43
  *::before,
38
44
  *::after {
39
45
  box-sizing: border-box;
46
+ border-width: 0;
47
+ border-style: solid;
40
48
  }
41
49
 
42
50
  // Remove default margins
@@ -98,9 +106,11 @@
98
106
  text-decoration-skip-ink: auto;
99
107
  }
100
108
 
101
- // Hidden elements
102
- :where([hidden]) {
103
- display: none !important;
109
+ // Hidden elements. :not([hidden="until-found"]) keeps beforematch content
110
+ // out of display:none so in-page find (ctrl+F) can still reveal it, per
111
+ // the HTML spec's own recommended selector for this rule.
112
+ :where([hidden]):not([hidden="until-found"]) {
113
+ display: none;
104
114
  }
105
115
 
106
116
  // Focus visible
@@ -120,13 +120,15 @@
120
120
  @function _zeus-sorted-breakpoint-keys($breakpoints-map) {
121
121
  $keys: map.keys($breakpoints-map);
122
122
  $n: list.length($keys);
123
- @for $i from 1 through $n - 1 {
124
- @for $j from 1 through $n - $i {
125
- $a: list.nth($keys, $j);
126
- $b: list.nth($keys, $j + 1);
127
- @if map.get($breakpoints-map, $a) > map.get($breakpoints-map, $b) {
128
- $keys: list.set-nth($keys, $j, $b);
129
- $keys: list.set-nth($keys, $j + 1, $a);
123
+ @if $n > 1 {
124
+ @for $i from 1 through $n - 1 {
125
+ @for $j from 1 through $n - $i {
126
+ $a: list.nth($keys, $j);
127
+ $b: list.nth($keys, $j + 1);
128
+ @if map.get($breakpoints-map, $a) > map.get($breakpoints-map, $b) {
129
+ $keys: list.set-nth($keys, $j, $b);
130
+ $keys: list.set-nth($keys, $j + 1, $a);
131
+ }
130
132
  }
131
133
  }
132
134
  }
@@ -55,8 +55,7 @@ $zeus-colors: (
55
55
  // Available Keys:
56
56
  // • Headings: display-xl, display-lg, display-md, h1, h1-light, h2, h2-light,
57
57
  // h3, h3-light, h4, h4-light, h5, h5-light, h6, h6-light
58
- // • Body: body-xl, body-lg, body, body-md, body-bold, body-md-bold,
59
- // body-semibold, body-md-semibold, body-medium, body-md-medium,
58
+ // • Body: body-xl, body-lg, body, body-bold, body-semibold, body-medium,
60
59
  // body-sm, body-sm-bold, body-sm-semibold, body-xs
61
60
  // • UI/Other: label, label-bold, caption, caption-bold, overline,
62
61
  // link, link-bold, button, button-lg, button-sm, code, code-sm
@@ -40,13 +40,9 @@ $zeus-typography: (
40
40
  "body-xl": ( family: "primary", size: (floor: 20, ceil: 24), lh: 1.6, ls: 0, weight: 400, role: "body" ),
41
41
  "body-lg": ( family: "primary", size: (floor: 18, ceil: 20), lh: 1.6, ls: 0, weight: 400, role: "body" ),
42
42
  "body": ( family: "primary", size: (floor: 16, ceil: 18), lh: 1.6, ls: 0, weight: 400, role: "body" ),
43
- "body-md": ( family: "primary", size: (floor: 16, ceil: 18), lh: 1.6, ls: 0, weight: 400, role: "body" ),
44
43
  "body-bold": ( family: "primary", size: (floor: 16, ceil: 18), lh: 1.6, ls: 0, weight: 700, role: "body" ),
45
- "body-md-bold": ( family: "primary", size: (floor: 16, ceil: 18), lh: 1.6, ls: 0, weight: 700, role: "body" ),
46
44
  "body-semibold": ( family: "primary", size: (floor: 16, ceil: 18), lh: 1.6, ls: 0, weight: 600, role: "body" ),
47
- "body-md-semibold": ( family: "primary", size: (floor: 16, ceil: 18), lh: 1.6, ls: 0, weight: 600, role: "body" ),
48
45
  "body-medium": ( family: "primary", size: (floor: 16, ceil: 18), lh: 1.6, ls: 0, weight: 500, role: "body" ),
49
- "body-md-medium": ( family: "primary", size: (floor: 16, ceil: 18), lh: 1.6, ls: 0, weight: 500, role: "body" ),
50
46
  "body-sm": ( family: "primary", size: (floor: 14, ceil: 16), lh: 1.5, ls: 0, weight: 400, role: "body" ),
51
47
  "body-sm-bold": ( family: "primary", size: (floor: 14, ceil: 16), lh: 1.5, ls: 0, weight: 700, role: "body" ),
52
48
  "body-sm-semibold": ( family: "primary", size: (floor: 14, ceil: 16), lh: 1.5, ls: 0, weight: 600, role: "body" ),