kni-cascade 1.1.0 → 1.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kni-cascade",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "description": "KNI Cascade — an opinionated SCSS engine and single source of truth for design scaling.",
5
5
  "main": "scss",
6
6
  "engines": {
package/readme.md CHANGED
@@ -20,7 +20,7 @@ It’s designed for **clarity, scalability, and minimal friction** — a single
20
20
  <td>
21
21
  <ul>
22
22
  <li>Modern, layered structure that fixes inheritance issues</li>
23
- <li>Clear separation of responsibility → <BR><code>00-config → 01-base → 02-components → 03-modules → 04-pages</code></li>
23
+ <li>Clear separation of responsibility → <BR><code>00-sass → 01-base → 02-components → 03-modules → 04-pages</code></li>
24
24
  <li>Config-first system — tokens, mixins, and primitives power everything downstream</li>
25
25
  </ul>
26
26
  </td>
@@ -51,12 +51,12 @@ It’s designed for **clarity, scalability, and minimal friction** — a single
51
51
 
52
52
  ```plaintext
53
53
  scss/
54
- ├── 00-config/ # Tokens, mixins, functions, no CSS output
54
+ ├── 00-sass/ # Settings, Sass vars, mixins, functions, no CSS output
55
55
  ├── 01-base/ # Resets, type, layout, and core utilities
56
- ├── 02-components/ # Reusable UI building blocks
57
- ├── 03-modules/ # Larger composite regions (header, hero, footer)
58
- ├── 04-pages/ # Page-specific overrides
59
- └── styles.scss # Public entry file for final CSS build
56
+ ├── 02-components/ # Globally-available UI elements (header, footer, buttons, etc.)
57
+ ├── 03-modules/ # Page body building blocks
58
+ ├── 04-pages/ # Template- and page-specific styles, intended to imported only into the relevant file
59
+ └── styles.scss # Public entry file for global CSS build
60
60
  ```
61
61
 
62
62
  ---
@@ -92,11 +92,10 @@ By default, **Gulp** runs:
92
92
 
93
93
  ## Design Principles
94
94
 
95
- 1. **Settings-first** – All editable project values live in `_settings.scss`.
96
- 2. **No CSS output in config** – Logic, not styling.
97
- 3. **Token inheritance** – Everything flows from primitives to components.
98
- 4. **Small overrides > big rewrites** – The cascade should always work with you.
99
- 5. **Readable by default** – Comments are documentation.
95
+
96
+ 1. **No CSS output in 00-sass** – Logic, not styling.
97
+ 2. **Small overrides > big rewrites** – The cascade should always work with you.
98
+ 3. **Readable by default** – Comments are documentation.
100
99
 
101
100
  ---
102
101
 
@@ -119,7 +118,8 @@ By default, **Gulp** runs:
119
118
 
120
119
  ## 🪄 Quick Philosophy
121
120
 
122
- > _“If it’s visual, it lives in base.
123
- > If it’s reusable, it lives in components.
124
- > If it’s page-specific, it lives in pages.
125
- > And if it defines how the system works it lives in config.”_
121
+ > If it defines how the system works is a Sass function, mixin or variable, it lives in sass.
122
+ > If it’s a globally-used reset, type, or layout rule, it lives in base.
123
+ > If it’s a globally-used element, it lives in components.
124
+ > If it's a page body building block, it lives in modules.
125
+ > If it’s page-specific, it lives in pages.
@@ -0,0 +1,3 @@
1
+ // ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
2
+ // 🧮 Functions
3
+ // ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
@@ -0,0 +1,11 @@
1
+ // ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
2
+ // ‼️ This directory is reserved for all SCSS functions, mixins and variables.
3
+ // It should not contain any CSS that gets generated, as the intention of it
4
+ // is to provide a clean and importable file that can be used across the
5
+ // project to provide access to shared functions, mixins and variables
6
+ // without generating any CSS.
7
+ // ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
8
+
9
+ @forward 'variables';
10
+ @forward 'functions';
11
+ @forward 'mixins';
@@ -1,6 +1,9 @@
1
- @use 'settings' as *;
2
- @use 'primitives' as *;
3
1
  @use "sass:map";
2
+ @use "./variables" as *;
3
+
4
+ // ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
5
+ // 🎨 Mixins
6
+ // ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
4
7
 
5
8
  // Powers all type-sizing - see settings map
6
9
  @mixin type-scale($token, $mq: $type-scale-breakpoint) {
@@ -109,4 +112,4 @@
109
112
  transform: none !important;
110
113
  }
111
114
  }
112
- }
115
+ }
@@ -1,5 +1,5 @@
1
1
  // ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
2
- // 📄 _settings.scss
2
+ // ⚙️ Variables
3
3
  // Project-level controls and design tokens — the file to edit.
4
4
  // Turn these knobs to adjust site behavior, type scales, or theme values.
5
5
  // ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
@@ -21,27 +21,30 @@ $type-scale: (
21
21
  heading-s: (desktop: 26, mobile: 20),
22
22
  heading-xs: (desktop: 20, mobile: 18),
23
23
  heading-xxs: (desktop: 18, mobile: 16),
24
- body-l: (desktop: 18, mobile: 16),
25
- body-m: (desktop: 16, mobile: 14),
26
- body-s: (desktop: 14, mobile: 12),
27
- body-xs: (desktop: 12, mobile: 11),
28
- body-xxs: (desktop: 11, mobile: 10),
29
- body-xxxs: (desktop: 10, mobile: 10)
24
+ body-l: (desktop: 18, mobile: 16),
25
+ body-m: (desktop: 16, mobile: 14),
26
+ body-s: (desktop: 14, mobile: 12),
27
+ body-xs: (desktop: 12, mobile: 11),
28
+ body-xxs: (desktop: 11, mobile: 10),
29
+ body-xxxs: (desktop: 10, mobile: 10)
30
30
  );
31
31
 
32
- :root {
33
- // defaults
34
- --easing: cubic-bezier(0.23, 1, 0.32, 1); // Michael Jordan Magic Johnson
35
- --border-radius: 5pxv;
32
+ // Colors
33
+ $white: #fff;
34
+ $black: #000;
36
35
 
37
- // default type settings
38
- --font-min-clamp: 11px; // default min-size for all type
39
- --line-height: 1.5; // default line height
40
- --text-wrap: pretty; // default
41
- --letter-spacing: normal; // 0.01em etc - match figma
42
- --type-margin: 15pxv; // Bottom spacing under type elements todo: replace with spacing var
36
+ // Breakpoints for Sassy mqs - see mixins
37
+ $ms: 320 !default; // Mobile small
38
+ $mm: 375 !default; // Mobile medium
39
+ $ml: 500 !default; // Mobile large
40
+ $ts: 600 !default; // Tablet small
41
+ $tm: 768 !default; // Tablet medium
42
+ $tl: 1024 !default; // Tablet large
43
+ $dxs: $tl !default; // Desktop x-small
44
+ $ds: 1280 !default; // Desktop small
45
+ $dm: 1440 !default; // Desktop medium
46
+ $dl: 1600 !default; // Desktop large
47
+ $dxl: 1800 !default; // Desktop x-large
48
+
49
+ $type-scale-breakpoint: $tm !default;
43
50
 
44
- // container settings:
45
- --container-size: 1280pxv;
46
- --mobile-gutters: 5%;
47
- }
@@ -1,4 +1,6 @@
1
1
  /* this is base index */
2
+ @forward 'scaling';
3
+ @forward 'motion';
2
4
  @forward 'reset';
3
5
  @forward 'typography';
4
6
  @forward 'layout';
@@ -1,19 +1,27 @@
1
- @use '../00-config' as *;
1
+ @use '../00-sass' as *;
2
+
3
+ // ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
4
+ // 📐 Layout
5
+ // Media Queries, containers, and other layout-related styles
6
+ // ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
7
+
8
+ // Layout Defaults
9
+ :root {
10
+ --container-size: 1280pxv;
11
+ --mobile-gutters: 5%;
12
+ --border-radius: 5pxv;
13
+ }
2
14
 
3
- // 🧩 Responsive Engine
15
+ // Responsive Engine
4
16
  // -----------------------------------------------------------------------------
5
- // This is our magic "it just works" responsive engine but there are other
6
- // ways to set up a primary container. Todo: show examples
17
+ // This is our magic "it just works" responsive media query but there are other
18
+ // ways to set up a primary container.
7
19
  // |--------------------|-------------------------------------------|-----------
8
20
  // | Mobile (375) | Desktop (1440) | No scale
9
21
  // |--------------------|-------------------------------------------|-----------
10
22
  // | min:320 max:767 | min:768 max:1800 |
11
23
  // |--------------------|-------------------------------------------|-----------
12
24
 
13
- // kill the wp-admin bar
14
-
15
- @include wp-admin-bar;
16
-
17
25
  // Primary Media Query
18
26
  @media (width >= 768px) {
19
27
  :root {
@@ -26,6 +34,10 @@
26
34
  }
27
35
  }
28
36
 
37
+ // kill the wp-admin bar
38
+ @include wp-admin-bar;
39
+
40
+
29
41
  body {
30
42
  min-height: 100vh;
31
43
  }
@@ -0,0 +1,8 @@
1
+ // ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
2
+ // ⏱️ Motion
3
+ // Easing curves, transitions, and animation timing for interactive experiences
4
+ // ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
5
+
6
+ :root {
7
+ --easing: cubic-bezier(0.23, 1, 0.32, 1); // Michael Jordan Magic Johnson
8
+ }
@@ -1,27 +1,10 @@
1
- @use 'settings' as *;
1
+ @use '../00-sass' as *;
2
2
 
3
3
  // ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
4
- // 📄 _primitives.scss
5
- // System-level "physics" of the design system how scaling, pxv units,
6
- // and fluid typography behave under the hood. You normally don’t edit this.
4
+ // 📏 Scaling
5
+ // Responsive engine powering sitewide scaling and pxv unit calculations.
7
6
  // ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
8
7
 
9
- // 🧩 Breakpoints for Sassy mqs - see mixins
10
- // -----------------------------------------------------------------------------
11
- $ms: 320 !default; // Mobile small
12
- $mm: 375 !default; // Mobile medium
13
- $ml: 500 !default; // Mobile large
14
- $ts: 600 !default; // Tablet small
15
- $tm: 768 !default; // Tablet medium
16
- $tl: 1024 !default; // Tablet large
17
- $dxs: $tl !default; // Desktop x-small
18
- $ds: 1280 !default; // Desktop small
19
- $dm: 1440 !default; // Desktop medium
20
- $dl: 1600 !default; // Desktop large
21
- $dxl: 1800 !default; // Desktop x-large
22
-
23
- $type-scale-breakpoint: $tm !default;
24
-
25
8
  :root {
26
9
  // mobile defaults
27
10
  --mobile-basis-w: 375;
@@ -32,12 +15,12 @@ $type-scale-breakpoint: $tm !default;
32
15
  --mobile-squish:0;
33
16
 
34
17
  // Desktop defaults
35
- --desktop-basis-w: 1440; // figma width
36
- --desktop-basis-h: 750; // height at which you want site to scale vertically
37
- --desktop-min: 768;
38
- --desktop-max: 2000;
39
- --desktop-squish: 0.5; // amount to scale height at --desktop-basis
40
- --desktop-floor: 500; // height at which to top scaling vertically
18
+ --desktop-basis-w: 1440; // Figma width
19
+ --desktop-basis-h: 750; // height at which you want site to scale vertically
20
+ --desktop-min: 768; // Desktop starts here
21
+ --desktop-max: 2000; // Desktop ends here
22
+ --desktop-squish: 1; // amount to scale height at --desktop-basis
23
+ --desktop-floor: 500; // height at which to top scaling vertically
41
24
 
42
25
  // default to mobile sizing
43
26
  --active-basis-w: var(--mobile-basis-w);
@@ -53,7 +36,6 @@ $type-scale-breakpoint: $tm !default;
53
36
  // safe vh used in pxv calculations
54
37
  --safe-vh: max(1vh, 1px * var(--active-floor) / 100);
55
38
 
56
-
57
39
  // pxv unit -
58
40
  /* stylelint-disable */
59
41
  @if $enable-pxv {
@@ -69,9 +51,4 @@ $type-scale-breakpoint: $tm !default;
69
51
  // Fluid type primitives
70
52
  --font-max-clamp: 9999px; // no touch
71
53
  --font-size: 16pxv; // fluid-type base font size
72
-
73
- // system font stacks
74
- --font-family-system: system-ui, helvetica,arial, sans-serif;
75
- --font-family-heading: var(--font-family-system);
76
- --font-family-monospace: ui-monospace, sfmono-regular, menlo, monaco, consolas, 'Liberation Mono', 'Courier New', monospace;
77
- }
54
+ }
@@ -1,19 +1,25 @@
1
- @use '../00-config' as *;
1
+ @use '../00-sass' as *;
2
2
 
3
3
  // ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
4
4
  // 📄 _typography.scss
5
5
  // Type system + custom styles
6
6
  // ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
7
7
 
8
- // Toggle fluid-type in settings.scss
9
- @if $enable-fluid-type {
10
- @include fluid-type;
8
+ // Default type settings
9
+ :root {
10
+ --font-family-system: system-ui, helvetica,arial, sans-serif;
11
+ --font-family-heading: var(--font-family-system);
12
+ --font-family-monospace: ui-monospace, sfmono-regular, menlo, monaco, consolas, 'Liberation Mono', 'Courier New', monospace;
13
+ --font-min-clamp: 11px; // default min-size for all type
14
+ --line-height: 1.35; // default line height
15
+ --text-wrap: pretty; // default
16
+ --letter-spacing: normal; // 0.01em etc - match figma
17
+ --type-margin: 15pxv; // Bottom spacing under type elements todo: replace with spacing var
11
18
  }
12
19
 
13
- // edit me
14
- :root {
15
- // --font-family-system: '<project font>';
16
- // --font-family-heading: if headings use different font;
20
+ // Toggle fluid-type in 00-sass/variables
21
+ @if $enable-fluid-type {
22
+ @include fluid-type;
17
23
  }
18
24
 
19
25
  // Set top level rules
@@ -36,7 +42,11 @@ html {
36
42
  }
37
43
 
38
44
  // Make code look like code
39
- code, kbd, samp, pre, tt {
45
+ code,
46
+ kbd,
47
+ samp,
48
+ pre,
49
+ tt {
40
50
  font-family: var(--font-family-monospace);
41
51
  }
42
52
 
@@ -65,19 +75,19 @@ code, kbd, samp, pre, tt {
65
75
  line-height: 1.2; // edit me
66
76
  }
67
77
 
68
- .heading--xl {
78
+ .heading--xl {
69
79
  @include type-scale(heading-xl);
70
80
 
71
81
  --font-min-clamp: 28px;
72
82
  }
73
83
 
74
- .heading--l {
84
+ .heading--l {
75
85
  @include type-scale(heading-l);
76
86
 
77
87
  --font-min-clamp: 24px;
78
88
  }
79
89
 
80
- .heading--m {
90
+ .heading--m {
81
91
  @include type-scale(heading-m);
82
92
 
83
93
  --font-min-clamp: 20px;
@@ -101,9 +111,13 @@ code, kbd, samp, pre, tt {
101
111
  --font-min-clamp: 14px;
102
112
  }
103
113
 
104
- .body--m { @include type-scale(body-m); }
114
+ .body--m {
115
+ @include type-scale(body-m);
116
+ }
105
117
 
106
- .body--s { @include type-scale(body-s);}
118
+ .body--s {
119
+ @include type-scale(body-s);
120
+ }
107
121
 
108
122
  .body--xs {
109
123
  @include type-scale(body-xs);
@@ -155,4 +169,4 @@ code, kbd, samp, pre, tt {
155
169
 
156
170
  .text-right {
157
171
  text-align: right;
158
- }
172
+ }
@@ -1,5 +1,4 @@
1
- $white: #fff;
2
- $black: #000;
1
+ @use "../../00-sass" as *;
3
2
 
4
3
  .color {
5
4
  &--white {
@@ -1,4 +1,4 @@
1
- @use '../../00-config' as *;
1
+ @use '../../00-sass' as *;
2
2
 
3
3
  .flex {
4
4
  display: flex;
@@ -3,4 +3,4 @@
3
3
  @forward 'flex';
4
4
  @forward 'spacing';
5
5
 
6
- /* i'm utitlities */
6
+ /* i'm utilities */
@@ -1 +1,9 @@
1
- /* this is pages index */
1
+ // ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
2
+ // ‼️ This directory is reserved for page- and template-level stylesheets. It
3
+ // should not be used to combine stylesheets into a single file, as the purpose
4
+ // of scoping styles to specific pages or templates is to optimize by allowing
5
+ // them to be loaded only when needed.
6
+ // Files in this directory should typically start with the following line to
7
+ // access functions, mixins and variables from the global Sass config.
8
+ // @use '../00-config' as *;
9
+ // ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
package/scss/styles.scss CHANGED
@@ -1,5 +1,3 @@
1
- @use './00-config' as *;
1
+ @use './00-sass' as *;
2
2
  @use './01-base' as *;
3
3
  @use './02-components' as *;
4
- @use './03-modules' as *;
5
- @use './04-pages' as *;
package/test/styles.scss CHANGED
@@ -1,5 +1,5 @@
1
1
  // @use '../scss/site' as *;
2
- @use '../scss/00-config' as *;
2
+ @use '../scss/00-sass' as *;
3
3
  @use '../scss/01-base' as *;
4
4
  @use '../scss/02-components' as *;
5
5
  @use '../scss/03-modules' as *;
File without changes
@@ -1,4 +0,0 @@
1
- @forward 'settings';
2
- @forward 'primitives';
3
- @forward 'mixins';
4
- @forward 'functions';