kni-cascade 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/.husky/pre-commit +4 -0
- package/.stylelintrc.cjs +38 -0
- package/gulpfile.js +160 -0
- package/package.json +59 -0
- package/pull_request_template.md +3 -0
- package/readme.md +125 -0
- package/scss/00-config/_functions.scss +0 -0
- package/scss/00-config/_index.scss +4 -0
- package/scss/00-config/_mixins.scss +112 -0
- package/scss/00-config/_primitives.scss +53 -0
- package/scss/00-config/_settings.scss +47 -0
- package/scss/01-base/_index.scss +5 -0
- package/scss/01-base/_layout.scss +99 -0
- package/scss/01-base/_reset.scss +83 -0
- package/scss/01-base/_typography.scss +151 -0
- package/scss/01-base/utilities/_dev.scss +0 -0
- package/scss/01-base/utilities/_display.scss +22 -0
- package/scss/01-base/utilities/_flex.scss +124 -0
- package/scss/01-base/utilities/_index.scss +6 -0
- package/scss/01-base/utilities/_spacing.scss +0 -0
- package/scss/02-components/_index.scss +1 -0
- package/scss/03-modules/_index.scss +1 -0
- package/scss/04-pages/_index.scss +1 -0
- package/scss/styles.scss +5 -0
- package/test/index.html +116 -0
- package/test/stress-test.html +577 -0
- package/test/styles.scss +135 -0
package/.stylelintrc.cjs
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
extends: ['stylelint-config-standard-scss'],
|
|
3
|
+
ignoreFiles: [
|
|
4
|
+
'**/*.{js,mjs,jsx,ts,tsx,json,md,mdx}',
|
|
5
|
+
'test/*.{css,css.map}',
|
|
6
|
+
],
|
|
7
|
+
rules: {
|
|
8
|
+
'annotation-no-unknown': [true, { ignoreAnnotations: ['default'] }],
|
|
9
|
+
'scss/at-import-no-partial-leading-underscore': null,
|
|
10
|
+
'custom-property-pattern': null,
|
|
11
|
+
'declaration-block-no-redundant-longhand-properties': null,
|
|
12
|
+
'function-no-unknown': null,
|
|
13
|
+
'function-name-case': null,
|
|
14
|
+
'keyframes-name-pattern': null,
|
|
15
|
+
'no-descending-specificity': null,
|
|
16
|
+
'property-no-vendor-prefix': null,
|
|
17
|
+
'selector-no-vendor-prefix': null,
|
|
18
|
+
'scss/no-global-function-names': null,
|
|
19
|
+
'scss/at-if-no-null': null,
|
|
20
|
+
'unit-no-unknown': [true, { ignoreUnits: ['pxv'] }],
|
|
21
|
+
'media-query-no-invalid': null,
|
|
22
|
+
'media-feature-range-notation': null,
|
|
23
|
+
'no-empty-source': null,
|
|
24
|
+
'max-nesting-depth': 4,
|
|
25
|
+
'declaration-no-important': null,
|
|
26
|
+
'selector-class-pattern': null,
|
|
27
|
+
'selector-id-pattern': null,
|
|
28
|
+
'selector-max-id': 2,
|
|
29
|
+
'scss/dollar-variable-colon-space-after': 'at-least-one-space',
|
|
30
|
+
'scss/dollar-variable-colon-space-before': 'never',
|
|
31
|
+
},
|
|
32
|
+
overrides: [
|
|
33
|
+
{
|
|
34
|
+
files: ['**/*.scss'],
|
|
35
|
+
customSyntax: 'postcss-scss',
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
};
|
package/gulpfile.js
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* π§ KNI Cascade β Gulpfile
|
|
3
|
+
* Local dev / test harness for the Cascade engine.
|
|
4
|
+
*
|
|
5
|
+
* - test/styles.scss is the entry for local testing
|
|
6
|
+
* - test/styles.scss should `@use '../scss/styles' as *;`
|
|
7
|
+
* - Compiles test/styles.scss -> test/styles.css
|
|
8
|
+
* - Applies postcss-pxv
|
|
9
|
+
* - Uses .stylelintrc.cjs for linting (auto-resolved by Stylelint)
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
const gulp = require('gulp');
|
|
13
|
+
const plumber = require('gulp-plumber');
|
|
14
|
+
const gulpSass = require('gulp-dart-sass');
|
|
15
|
+
const sourcemaps = require('gulp-sourcemaps');
|
|
16
|
+
const postcss = require('gulp-postcss');
|
|
17
|
+
const browserSync = require('browser-sync').create();
|
|
18
|
+
const { exec } = require('child_process');
|
|
19
|
+
const colors = require('ansi-colors');
|
|
20
|
+
const path = require('path');
|
|
21
|
+
const postcssPxv = require('postcss-pxv');
|
|
22
|
+
|
|
23
|
+
// --------------------------
|
|
24
|
+
// π Paths (engine-local)
|
|
25
|
+
// --------------------------
|
|
26
|
+
const paths = {
|
|
27
|
+
scssSrc: path.resolve(__dirname, 'scss'),
|
|
28
|
+
entry: path.resolve(__dirname, 'test/styles.scss'),
|
|
29
|
+
dist: path.resolve(__dirname, 'test'),
|
|
30
|
+
cssOutput: 'styles.css',
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const sassSrcFile = paths.entry;
|
|
34
|
+
const sassOutDir = paths.dist;
|
|
35
|
+
|
|
36
|
+
const sassWatchDir = [
|
|
37
|
+
path.join(paths.scssSrc, '**/*.scss'),
|
|
38
|
+
path.resolve(__dirname, 'test/**/*.scss'),
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
const htmlWatchDir = './test/**/*.html';
|
|
42
|
+
|
|
43
|
+
// --------------------------
|
|
44
|
+
// π Lint SCSS (non-blocking)
|
|
45
|
+
// --------------------------
|
|
46
|
+
gulp.task('lint-css-fix', function (done) {
|
|
47
|
+
const lintCmd = [
|
|
48
|
+
'npx stylelint',
|
|
49
|
+
`"${paths.scssSrc}/**/*.scss"`,
|
|
50
|
+
'"test/**/*.scss"',
|
|
51
|
+
'--fix',
|
|
52
|
+
'--formatter string',
|
|
53
|
+
].join(' ');
|
|
54
|
+
|
|
55
|
+
exec(lintCmd, function (err, stdout, stderr) {
|
|
56
|
+
if (stdout) {
|
|
57
|
+
const coloredOutput = stdout
|
|
58
|
+
.replace(/β/g, colors.red('β'))
|
|
59
|
+
.replace(/β οΈ/g, colors.yellow('β οΈ'))
|
|
60
|
+
.replace(/\.scss/g, colors.cyan('.scss'))
|
|
61
|
+
.replace(/\(\S+\)/g, (match) => colors.dim(match));
|
|
62
|
+
console.log(coloredOutput);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (stderr) console.error(colors.red(stderr));
|
|
66
|
+
|
|
67
|
+
if (err) {
|
|
68
|
+
console.log(
|
|
69
|
+
colors.yellow(
|
|
70
|
+
'β οΈ Stylelint reported/fixed issues (non-blocking for build)',
|
|
71
|
+
),
|
|
72
|
+
);
|
|
73
|
+
} else {
|
|
74
|
+
console.log(
|
|
75
|
+
colors.green(
|
|
76
|
+
'β
Stylelint clean β all formatting issues resolved',
|
|
77
|
+
),
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
done();
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
// --------------------------
|
|
86
|
+
// π§© Build SCSS β CSS
|
|
87
|
+
// --------------------------
|
|
88
|
+
gulp.task('build-sass', async function () {
|
|
89
|
+
const postcssPlugins = [
|
|
90
|
+
postcssPxv({
|
|
91
|
+
writeVars: false,
|
|
92
|
+
}),
|
|
93
|
+
];
|
|
94
|
+
|
|
95
|
+
return await gulp
|
|
96
|
+
.src(sassSrcFile)
|
|
97
|
+
.pipe(sourcemaps.init())
|
|
98
|
+
.pipe(plumber())
|
|
99
|
+
.pipe(
|
|
100
|
+
gulpSass({ outputStyle: 'expanded' }).on(
|
|
101
|
+
'error',
|
|
102
|
+
gulpSass.logError,
|
|
103
|
+
),
|
|
104
|
+
)
|
|
105
|
+
.pipe(postcss(postcssPlugins))
|
|
106
|
+
.pipe(
|
|
107
|
+
sourcemaps.write('./', {
|
|
108
|
+
includeContent: true,
|
|
109
|
+
sourceRoot: '../scss',
|
|
110
|
+
}),
|
|
111
|
+
)
|
|
112
|
+
.pipe(gulp.dest(sassOutDir))
|
|
113
|
+
.pipe(browserSync.stream())
|
|
114
|
+
.on('end', () => {
|
|
115
|
+
console.log(
|
|
116
|
+
colors.green(
|
|
117
|
+
`β
Built test/styles.scss β ${path.join(
|
|
118
|
+
sassOutDir,
|
|
119
|
+
paths.cssOutput,
|
|
120
|
+
)}`,
|
|
121
|
+
),
|
|
122
|
+
);
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
// --------------------------
|
|
127
|
+
// βοΈ Serve + Watch (local dev)
|
|
128
|
+
// --------------------------
|
|
129
|
+
gulp.task(
|
|
130
|
+
'serve',
|
|
131
|
+
gulp.series('lint-css-fix', 'build-sass', function () {
|
|
132
|
+
browserSync.init({
|
|
133
|
+
server: { baseDir: './test' },
|
|
134
|
+
open: false,
|
|
135
|
+
notify: false,
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
gulp
|
|
139
|
+
.watch(sassWatchDir)
|
|
140
|
+
.on('change', (changedFile) => {
|
|
141
|
+
console.log(
|
|
142
|
+
colors.cyan(
|
|
143
|
+
`π File changed: ${path.relative(
|
|
144
|
+
__dirname,
|
|
145
|
+
changedFile,
|
|
146
|
+
)}`,
|
|
147
|
+
),
|
|
148
|
+
);
|
|
149
|
+
})
|
|
150
|
+
.on('change', gulp.series('lint-css-fix', 'build-sass'));
|
|
151
|
+
|
|
152
|
+
gulp.watch(htmlWatchDir).on('change', browserSync.reload);
|
|
153
|
+
}),
|
|
154
|
+
);
|
|
155
|
+
|
|
156
|
+
// --------------------------
|
|
157
|
+
// π― Tasks
|
|
158
|
+
// --------------------------
|
|
159
|
+
gulp.task('build', gulp.series('lint-css-fix', 'build-sass'));
|
|
160
|
+
gulp.task('default', gulp.series('serve'));
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "kni-cascade",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "KNI Cascade β an opinionated SCSS engine and single source of truth for design scaling.",
|
|
5
|
+
"main": "scss",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": ">=18 <=22",
|
|
8
|
+
"npm": ">=8 <=10"
|
|
9
|
+
},
|
|
10
|
+
"directories": {
|
|
11
|
+
"test": "test"
|
|
12
|
+
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "npm run gulp-build",
|
|
15
|
+
"deploy": "npm run stylelint && npm run build",
|
|
16
|
+
"gulp": "gulp",
|
|
17
|
+
"gulp-build": "gulp build-sass",
|
|
18
|
+
"http-server": "http-server",
|
|
19
|
+
"serve": "cd test && npm run http-server",
|
|
20
|
+
"stylelint": "npx stylelint \"**/*.{css,sass,scss}\"",
|
|
21
|
+
"prepare": "husky install && npm run husky:init",
|
|
22
|
+
"husky:init": "test -f .husky/pre-commit || npm run husky:create",
|
|
23
|
+
"husky:create": "npx husky add .husky/pre-commit \"npx lint-staged || { echo 'Commit failed: lint-staged errors'; exit 1; }\" && chmod +x .husky/pre-commit",
|
|
24
|
+
"prepublishOnly": "npm install && npm run build",
|
|
25
|
+
"postinstall": "echo '\nβ
KNI Cascade ready β Husky & lint-staged configured!\n'"
|
|
26
|
+
},
|
|
27
|
+
"author": "Daniel Box",
|
|
28
|
+
"license": "ISC",
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"gulp": "^4.0.2",
|
|
31
|
+
"gulp-purge-sourcemaps": "^1.0.0",
|
|
32
|
+
"gulp-rename": "^2.0.0",
|
|
33
|
+
"postcss-pxv": "^2.0.0"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"browser-sync": "^3.0.4",
|
|
37
|
+
"caniuse-lite": "^1.0.30001746",
|
|
38
|
+
"gulp-autoprefixer": "^8.0.0",
|
|
39
|
+
"gulp-dart-sass": "^1.1.0",
|
|
40
|
+
"gulp-insert": "^0.5.0",
|
|
41
|
+
"gulp-plumber": "^1.2.1",
|
|
42
|
+
"gulp-postcss": "^9.0.1",
|
|
43
|
+
"gulp-sourcemaps": "^3.0.0",
|
|
44
|
+
"http-server": "^14.1.1",
|
|
45
|
+
"husky": "^8.0.3",
|
|
46
|
+
"lint-staged": "^13.0.3",
|
|
47
|
+
"postcss": "^8.4.28",
|
|
48
|
+
"sass": "^1.69.5",
|
|
49
|
+
"stylelint": "^16.25.0",
|
|
50
|
+
"stylelint-config-standard": "^36.0.1",
|
|
51
|
+
"stylelint-config-standard-scss": "^14.0.0",
|
|
52
|
+
"stylelint-scss": "^6.2.1"
|
|
53
|
+
},
|
|
54
|
+
"lint-staged": {
|
|
55
|
+
"*.{scss,css}": [
|
|
56
|
+
"stylelint --fix"
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# KNI Cascade
|
|
2
|
+
|
|
3
|
+
A modern front-end architecture creating a single source of truth for all our CSS β across **WordPress**, **React**, **static**, or any future builds.
|
|
4
|
+
|
|
5
|
+
KNI Cascade unifies structure, tooling, and logic into a maintainable, portable system for all front-end projects.
|
|
6
|
+
Itβs designed for **clarity, scalability, and minimal friction** β a single shared foundation that powers every KNI build.
|
|
7
|
+
|
|
8
|
+
## What We Package
|
|
9
|
+
|
|
10
|
+
<table>
|
|
11
|
+
<thead>
|
|
12
|
+
<tr>
|
|
13
|
+
<th>Category</th>
|
|
14
|
+
<th>Description</th>
|
|
15
|
+
</tr>
|
|
16
|
+
</thead>
|
|
17
|
+
<tbody>
|
|
18
|
+
<tr>
|
|
19
|
+
<td><strong>SCSS Boilerplate</strong></td>
|
|
20
|
+
<td>
|
|
21
|
+
<ul>
|
|
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>
|
|
24
|
+
<li>Config-first system β tokens, mixins, and primitives power everything downstream</li>
|
|
25
|
+
</ul>
|
|
26
|
+
</td>
|
|
27
|
+
</tr>
|
|
28
|
+
<tr>
|
|
29
|
+
<td><strong>Sass (SCSS)</strong></td>
|
|
30
|
+
<td>
|
|
31
|
+
<ul>
|
|
32
|
+
<li>Clean, familiar syntax and developer experience</li>
|
|
33
|
+
<li>Zero CSS output from config layer ensures predictable, isolated overrides</li>
|
|
34
|
+
</ul>
|
|
35
|
+
</td>
|
|
36
|
+
</tr>
|
|
37
|
+
<tr>
|
|
38
|
+
<td><strong>PostCSS PXV</strong></td>
|
|
39
|
+
<td>Our custom viewport unit plugin
|
|
40
|
+
</td>
|
|
41
|
+
</tr>
|
|
42
|
+
<tr>
|
|
43
|
+
<td><strong>Stylelint config</strong></td>
|
|
44
|
+
<td>Centralized configs for Stylelint
|
|
45
|
+
</td>
|
|
46
|
+
</tr>
|
|
47
|
+
</tbody>
|
|
48
|
+
</table>
|
|
49
|
+
|
|
50
|
+
## Folder Structure
|
|
51
|
+
|
|
52
|
+
```plaintext
|
|
53
|
+
scss/
|
|
54
|
+
βββ 00-config/ # Tokens, mixins, functions, no CSS output
|
|
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
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## π§© Core Features
|
|
65
|
+
|
|
66
|
+
- **Fluid Typography** β Scales seamlessly across breakpoints using `$type-scale` maps
|
|
67
|
+
- **Viewport-Based Units (`pxv`)** β Uniform responsive sizing with fallback support
|
|
68
|
+
- **Token-Driven Architecture** β Edit `_settings.scss` to update a project globally
|
|
69
|
+
- **Predictable Cascade** β Each layer builds safely on the one before it
|
|
70
|
+
- **Framework-Agnostic** β Single source of truth across any kni boilerplate
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## βοΈ Local Build Setup
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
# install dependencies
|
|
78
|
+
npm install
|
|
79
|
+
|
|
80
|
+
# run local dev build
|
|
81
|
+
npx gulp
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
By default, **Gulp** runs:
|
|
85
|
+
|
|
86
|
+
- `sass` β compile SCSS β CSS
|
|
87
|
+
- `postcss` β apply pxv
|
|
88
|
+
- `stylelint` β lint & auto-fix code style
|
|
89
|
+
- `browsersync` β live-reload for local development
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Design Principles
|
|
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.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## π§° Requirements
|
|
104
|
+
|
|
105
|
+
- Node v18+
|
|
106
|
+
- npm or pnpm
|
|
107
|
+
- Gulp CLI (global)
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## π§βπ» Contributing
|
|
112
|
+
|
|
113
|
+
1. Clone this repo
|
|
114
|
+
2. Create a new branch
|
|
115
|
+
3. Run `npx gulp` and make your changes
|
|
116
|
+
4. Submit a PR with a clear summary
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## πͺ Quick Philosophy
|
|
121
|
+
|
|
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.β_
|
|
File without changes
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
@use 'settings' as *;
|
|
2
|
+
@use 'primitives' as *;
|
|
3
|
+
@use "sass:map";
|
|
4
|
+
|
|
5
|
+
// Powers all type-sizing - see settings map
|
|
6
|
+
@mixin type-scale($token, $mq: $type-scale-breakpoint) {
|
|
7
|
+
$scale: map.get($type-scale, $token);
|
|
8
|
+
|
|
9
|
+
@if $scale == null {
|
|
10
|
+
@warn "β οΈ Unknown token: #{$token}.";
|
|
11
|
+
} @else {
|
|
12
|
+
$desktop-size: map.get($scale, desktop);
|
|
13
|
+
$mobile-size: map.get($scale, mobile);
|
|
14
|
+
|
|
15
|
+
--font-size: #{$mobile-size}pxv;
|
|
16
|
+
|
|
17
|
+
@media (min-width: #{$mq}px) {
|
|
18
|
+
--font-size: #{$desktop-size}pxv;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Fluid type - no edit
|
|
24
|
+
@mixin fluid-type {
|
|
25
|
+
:where(*, *::before, *::after) {
|
|
26
|
+
font-size: clamp(var(--font-min-clamp), var(--font-size), var(--font-max-clamp));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@mixin touch-device {
|
|
31
|
+
@media (hover: none) {
|
|
32
|
+
@content;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Breakpoint mixins used across layout - add your own
|
|
37
|
+
@mixin sm {
|
|
38
|
+
@media (max-width: #{$tm - 1}px) {
|
|
39
|
+
@content;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@mixin lg {
|
|
44
|
+
@media (min-width: #{$tm}px) {
|
|
45
|
+
@content;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@mixin max {
|
|
50
|
+
@media (min-width: #{$desktop-max}px) {
|
|
51
|
+
@content;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@mixin screen-reader-only {
|
|
56
|
+
position: absolute;
|
|
57
|
+
overflow: hidden;
|
|
58
|
+
top: auto;
|
|
59
|
+
left: -10000px;
|
|
60
|
+
clip: rect(1px, 1px, 1px, 1px);
|
|
61
|
+
clip-path: inset(50%);
|
|
62
|
+
width: 1px;
|
|
63
|
+
height: 1px;
|
|
64
|
+
margin: -1px;
|
|
65
|
+
padding: 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@mixin focus {
|
|
69
|
+
&:focus,
|
|
70
|
+
> *:focus {
|
|
71
|
+
outline: none;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&:focus > * {
|
|
75
|
+
box-shadow: 0 0 0 2px #0061c7;
|
|
76
|
+
border-radius: 2px;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@mixin no-focus {
|
|
81
|
+
&:focus,
|
|
82
|
+
> *:focus {
|
|
83
|
+
outline: none;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&:focus > * {
|
|
87
|
+
box-shadow: none;
|
|
88
|
+
border-radius: 0;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@mixin abs-full {
|
|
93
|
+
position: absolute;
|
|
94
|
+
top: 0;
|
|
95
|
+
left: 0;
|
|
96
|
+
width: 100%;
|
|
97
|
+
height: 100%;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@mixin wp-admin-bar {
|
|
101
|
+
#wpadminbar {
|
|
102
|
+
position: fixed !important;
|
|
103
|
+
opacity: 0.3 !important;
|
|
104
|
+
transition: transform 0.3s, opacity 0.3s;
|
|
105
|
+
transform: translateY(-80%) !important;
|
|
106
|
+
|
|
107
|
+
&:hover {
|
|
108
|
+
opacity: 1 !important;
|
|
109
|
+
transform: none !important;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
@use 'settings' as *;
|
|
2
|
+
|
|
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.
|
|
7
|
+
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
8
|
+
|
|
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
|
+
:root {
|
|
26
|
+
// pxv unit primitives
|
|
27
|
+
--site-min: var(--mobile-min);
|
|
28
|
+
--site-basis: var(--mobile-basis);
|
|
29
|
+
--site-max: var(--mobile-max);
|
|
30
|
+
|
|
31
|
+
// pxv settings - Match figma
|
|
32
|
+
--mobile-min: 0;
|
|
33
|
+
--mobile-basis: 375; // Figma mobile
|
|
34
|
+
--mobile-max: 767;
|
|
35
|
+
--desktop-min: 768;
|
|
36
|
+
--desktop-basis: 1440; // Figma desktop
|
|
37
|
+
--desktop-max: #{$desktop-max}; // Edit this in settings
|
|
38
|
+
|
|
39
|
+
// pxv unit
|
|
40
|
+
@if $enable-pxv {
|
|
41
|
+
--pxv-unit: clamp(calc(1px * var(--site-min) / var(--site-basis)), calc((100 / var(--site-basis)) * 1vw), calc(1px * var(--site-max) / var(--site-basis)));
|
|
42
|
+
} @else {
|
|
43
|
+
--pxv-unit: 1px; // effectively disables fluid scaling
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Fluid type primitives
|
|
47
|
+
--font-max-clamp: 9999px; // no touch
|
|
48
|
+
--font-size: 16pxv; // fluid-type base font size
|
|
49
|
+
|
|
50
|
+
// system font stacks
|
|
51
|
+
--font-family-system: system-ui, helvetica, arial, sans-serif;
|
|
52
|
+
--font-family-monospace: ui-monospace, sfmono-regular, menlo, monaco, consolas, 'Liberation Mono', 'Courier New', monospace;
|
|
53
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
2
|
+
// π _settings.scss
|
|
3
|
+
// Project-level controls and design tokens β the file to edit.
|
|
4
|
+
// Turn these knobs to adjust site behavior, type scales, or theme values.
|
|
5
|
+
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
6
|
+
|
|
7
|
+
// Where should the site stop scaling?
|
|
8
|
+
$desktop-max: 1600;
|
|
9
|
+
|
|
10
|
+
// Scale everything
|
|
11
|
+
$enable-fluid-type: true !default;
|
|
12
|
+
$enable-pxv: true !default;
|
|
13
|
+
|
|
14
|
+
// Type scale map
|
|
15
|
+
// Note: these values exist in Figma vars, edit per project. Add any as needed!!
|
|
16
|
+
$type-scale: (
|
|
17
|
+
heading-xxl: (desktop: 60, mobile: 34),
|
|
18
|
+
heading-xl: (desktop: 48, mobile: 30),
|
|
19
|
+
heading-l: (desktop: 38, mobile: 26),
|
|
20
|
+
heading-m: (desktop: 32, mobile: 22),
|
|
21
|
+
heading-s: (desktop: 26, mobile: 20),
|
|
22
|
+
heading-xs: (desktop: 20, mobile: 18),
|
|
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)
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
:root {
|
|
33
|
+
// defaults
|
|
34
|
+
--easing: cubic-bezier(0.23, 1, 0.32, 1); // Michael Jordan Magic Johnson
|
|
35
|
+
--border-radius: 5pxv;
|
|
36
|
+
|
|
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
|
|
43
|
+
|
|
44
|
+
// container settings:
|
|
45
|
+
--container-size: 1280pxv;
|
|
46
|
+
--mobile-gutters: 5%;
|
|
47
|
+
}
|