nightcss 0.0.0-stage → 0.1.0-alpha.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/LICENSE +21 -0
- package/README.md +292 -2
- package/README.ru.md +293 -0
- package/dist/base.css +158 -0
- package/dist/base.min.css +1 -0
- package/dist/layout.css +185 -0
- package/dist/layout.min.css +1 -0
- package/dist/nightcss.css +1206 -0
- package/dist/nightcss.min.css +1 -0
- package/dist/reset.css +59 -0
- package/dist/reset.min.css +1 -0
- package/dist/themes/dark.css +8 -0
- package/dist/themes/dark.min.css +1 -0
- package/dist/themes/light.css +8 -0
- package/dist/themes/light.min.css +1 -0
- package/dist/tokens.css +161 -0
- package/dist/tokens.min.css +1 -0
- package/dist/utilities.css +644 -0
- package/dist/utilities.min.css +1 -0
- package/package.json +65 -4
- package/src/scss/_functions.scss +136 -0
- package/src/scss/_mixins.scss +90 -0
- package/src/scss/_tokens.scss +148 -0
- package/src/scss/index.scss +21 -0
package/package.json
CHANGED
|
@@ -1,6 +1,67 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nightcss",
|
|
3
|
-
"version": "0.0.0
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0-alpha.0",
|
|
4
|
+
"description": "A zero-build CSS foundation: layers, design tokens, reset, utilities, and layout primitives.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "nightrunner91",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/nightrunner91/nightcss.git"
|
|
11
|
+
},
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"style": "./dist/nightcss.css",
|
|
15
|
+
"default": "./dist/nightcss.css"
|
|
16
|
+
},
|
|
17
|
+
"./reset": "./dist/reset.css",
|
|
18
|
+
"./tokens": "./dist/tokens.css",
|
|
19
|
+
"./base": "./dist/base.css",
|
|
20
|
+
"./layout": "./dist/layout.css",
|
|
21
|
+
"./utilities": "./dist/utilities.css",
|
|
22
|
+
"./themes/light": "./dist/themes/light.css",
|
|
23
|
+
"./themes/dark": "./dist/themes/dark.css",
|
|
24
|
+
"./scss": {
|
|
25
|
+
"sass": "./src/scss/index.scss"
|
|
26
|
+
},
|
|
27
|
+
"./package.json": "./package.json"
|
|
28
|
+
},
|
|
29
|
+
"style": "./dist/nightcss.css",
|
|
30
|
+
"sideEffects": [
|
|
31
|
+
"**/*.css",
|
|
32
|
+
"**/*.scss"
|
|
33
|
+
],
|
|
34
|
+
"files": [
|
|
35
|
+
"dist",
|
|
36
|
+
"src/scss",
|
|
37
|
+
"LICENSE",
|
|
38
|
+
"README.md",
|
|
39
|
+
"README.ru.md"
|
|
40
|
+
],
|
|
41
|
+
"scripts": {
|
|
42
|
+
"build": "node scripts/build.mjs",
|
|
43
|
+
"prepublishOnly": "npm run build && npm test",
|
|
44
|
+
"lint": "stylelint \"src/**/*.css\"",
|
|
45
|
+
"test": "node tests/size.mjs && node tests/layer-order.mjs && node tests/scss.mjs",
|
|
46
|
+
"test:size": "node tests/size.mjs",
|
|
47
|
+
"test:layers": "node tests/layer-order.mjs",
|
|
48
|
+
"test:scss": "node tests/scss.mjs"
|
|
49
|
+
},
|
|
50
|
+
"keywords": [
|
|
51
|
+
"css",
|
|
52
|
+
"design-tokens",
|
|
53
|
+
"css-foundation",
|
|
54
|
+
"zero-build",
|
|
55
|
+
"css-layers",
|
|
56
|
+
"utilities"
|
|
57
|
+
],
|
|
58
|
+
"engines": {
|
|
59
|
+
"node": ">=18"
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"lightningcss": "^1.29.0",
|
|
63
|
+
"sass": "^1.108.2",
|
|
64
|
+
"stylelint": "^18.1.0",
|
|
65
|
+
"stylelint-config-standard": "^41.1.0"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
// NightCSS — Sass functions.
|
|
2
|
+
//
|
|
3
|
+
// Token accessors emit `var(--nc-*, <fallback>)`: the fallback (the literal
|
|
4
|
+
// value from `_tokens.scss`) keeps the output valid on its own, while the
|
|
5
|
+
// custom property keeps it themeable at runtime. Color helpers emit
|
|
6
|
+
// `color-mix(in oklch, ...)` instead of a precomputed shade matrix.
|
|
7
|
+
|
|
8
|
+
@use 'sass:list';
|
|
9
|
+
@use 'sass:map';
|
|
10
|
+
@use 'tokens';
|
|
11
|
+
|
|
12
|
+
// Wrap a token name and its fallback into a runtime reference.
|
|
13
|
+
// `$token` is everything after `--nc-`, e.g. `space-4` or `accent`.
|
|
14
|
+
@function _nc-var($token, $fallback) {
|
|
15
|
+
@return var(--nc-#{$token}, #{$fallback});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Look a key up in a token map and fail loudly on typos.
|
|
19
|
+
@function _nc-get($map, $key, $label) {
|
|
20
|
+
$value: map.get($map, $key);
|
|
21
|
+
@if $value == null {
|
|
22
|
+
@error 'Unknown #{$label} token "#{$key}".';
|
|
23
|
+
}
|
|
24
|
+
@return $value;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// --- Spacing -------------------------------------------------------------
|
|
28
|
+
|
|
29
|
+
// One to four space tokens, space-separated (mirrors the classic `spacer()`):
|
|
30
|
+
// padding: nc-space(4); // -> var(--nc-space-4, 1rem)
|
|
31
|
+
// margin: nc-space(4, 8); // -> var(--nc-space-4, 1rem) var(--nc-space-8, 2rem)
|
|
32
|
+
@function nc-space($keys...) {
|
|
33
|
+
$result: ();
|
|
34
|
+
@each $key in $keys {
|
|
35
|
+
$value: _nc-get(tokens.$nc-space, $key, 'space');
|
|
36
|
+
$result: list.append($result, _nc-var('space-#{$key}', $value), $separator: space);
|
|
37
|
+
}
|
|
38
|
+
@return $result;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// --- Typography ----------------------------------------------------------
|
|
42
|
+
|
|
43
|
+
@function nc-text($key) {
|
|
44
|
+
$value: _nc-get(tokens.$nc-text, $key, 'text');
|
|
45
|
+
@return _nc-var('text-#{$key}', $value);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@function nc-leading($key) {
|
|
49
|
+
$value: _nc-get(tokens.$nc-leading, $key, 'leading');
|
|
50
|
+
@return _nc-var('leading-#{$key}', $value);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@function nc-tracking($key) {
|
|
54
|
+
$value: _nc-get(tokens.$nc-tracking, $key, 'tracking');
|
|
55
|
+
@return _nc-var('tracking-#{$key}', $value);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@function nc-weight($key) {
|
|
59
|
+
$value: _nc-get(tokens.$nc-weight, $key, 'weight');
|
|
60
|
+
@return _nc-var('weight-#{$key}', $value);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@function nc-font($key) {
|
|
64
|
+
$value: _nc-get(tokens.$nc-font, $key, 'font');
|
|
65
|
+
@return _nc-var('font-#{$key}', $value);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// --- Surfaces & effects ---------------------------------------------------
|
|
69
|
+
|
|
70
|
+
@function nc-radius($key) {
|
|
71
|
+
$value: _nc-get(tokens.$nc-radius, $key, 'radius');
|
|
72
|
+
@return _nc-var('radius-#{$key}', $value);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@function nc-shadow($key) {
|
|
76
|
+
$value: _nc-get(tokens.$nc-shadow, $key, 'shadow');
|
|
77
|
+
@return _nc-var('shadow-#{$key}', $value);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@function nc-z($key) {
|
|
81
|
+
$value: _nc-get(tokens.$nc-z, $key, 'z-index');
|
|
82
|
+
@return _nc-var('z-#{$key}', $value);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// --- Motion ---------------------------------------------------------------
|
|
86
|
+
|
|
87
|
+
@function nc-duration($key) {
|
|
88
|
+
$value: _nc-get(tokens.$nc-duration, $key, 'duration');
|
|
89
|
+
@return _nc-var('duration-#{$key}', $value);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@function nc-ease($key) {
|
|
93
|
+
$value: _nc-get(tokens.$nc-ease, $key, 'ease');
|
|
94
|
+
@return _nc-var('ease-#{$key}', $value);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Compose a full transition from motion tokens:
|
|
98
|
+
// transition: nc-transition(transform, base, emphasized);
|
|
99
|
+
@function nc-transition($property, $duration: 'base', $ease: 'standard', $delay: null) {
|
|
100
|
+
$duration-value: _nc-get(tokens.$nc-duration, $duration, 'duration');
|
|
101
|
+
$ease-value: _nc-get(tokens.$nc-ease, $ease, 'ease');
|
|
102
|
+
|
|
103
|
+
$result: #{$property} var(--nc-duration-#{$duration}, #{$duration-value}) var(--nc-ease-#{$ease}, #{$ease-value});
|
|
104
|
+
@if $delay {
|
|
105
|
+
$result: #{$result} #{$delay};
|
|
106
|
+
}
|
|
107
|
+
@return $result;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// --- Color ----------------------------------------------------------------
|
|
111
|
+
|
|
112
|
+
@function nc-color($key) {
|
|
113
|
+
$value: _nc-get(tokens.$nc-color, $key, 'color');
|
|
114
|
+
@return _nc-var('#{$key}', $value);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Mix two colors in oklch at runtime — replaces a precomputed light/dark/sat/
|
|
118
|
+
// desat matrix with a single `color-mix()` call.
|
|
119
|
+
@function nc-mix($color-a, $color-b, $weight: 50%) {
|
|
120
|
+
@return color-mix(in oklch, #{$color-a} #{$weight}, #{$color-b});
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
@function nc-tint($color, $weight: 10%) {
|
|
124
|
+
@return nc-mix($color, white, $weight);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
@function nc-shade($color, $weight: 10%) {
|
|
128
|
+
@return nc-mix($color, black, $weight);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// --- Breakpoints ----------------------------------------------------------
|
|
132
|
+
|
|
133
|
+
// Media queries cannot use custom properties, so return the literal value.
|
|
134
|
+
@function nc-breakpoint($key) {
|
|
135
|
+
@return _nc-get(tokens.$nc-breakpoints, $key, 'breakpoint');
|
|
136
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// NightCSS — Sass mixins.
|
|
2
|
+
//
|
|
3
|
+
// The legacy flex-grid mixins (`container`/`row`/`col`/`offset`/`order`) are
|
|
4
|
+
// intentionally gone: NightCSS uses native CSS Grid via the layout primitives
|
|
5
|
+
// instead. What remains are the small, framework-agnostic helpers, modernized
|
|
6
|
+
// (no `!important`, `@use`/`@forward`, logical, reduced-motion friendly).
|
|
7
|
+
|
|
8
|
+
@use 'sass:map';
|
|
9
|
+
@use 'tokens';
|
|
10
|
+
|
|
11
|
+
// --- Breakpoint helpers ---------------------------------------------------
|
|
12
|
+
|
|
13
|
+
// Legacy `$sm-up` / `$sm-md` media strings, rebuilt as content mixins.
|
|
14
|
+
// @include nc-media-up('md') { … }
|
|
15
|
+
@mixin nc-media-up($breakpoint) {
|
|
16
|
+
$value: map.get(tokens.$nc-breakpoints, $breakpoint);
|
|
17
|
+
@if $value == null {
|
|
18
|
+
@error 'Unknown breakpoint "#{$breakpoint}".';
|
|
19
|
+
}
|
|
20
|
+
@media (min-width: #{$value}) {
|
|
21
|
+
@content;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@mixin nc-media-down($breakpoint) {
|
|
26
|
+
$value: map.get(tokens.$nc-breakpoints, $breakpoint);
|
|
27
|
+
@if $value == null {
|
|
28
|
+
@error 'Unknown breakpoint "#{$breakpoint}".';
|
|
29
|
+
}
|
|
30
|
+
@media (max-width: #{$value}) {
|
|
31
|
+
@content;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@mixin nc-media-between($min, $max) {
|
|
36
|
+
$min-value: map.get(tokens.$nc-breakpoints, $min);
|
|
37
|
+
$max-value: map.get(tokens.$nc-breakpoints, $max);
|
|
38
|
+
@if $min-value == null or $max-value == null {
|
|
39
|
+
@error 'Unknown breakpoint in "#{$min}" / "#{$max}".';
|
|
40
|
+
}
|
|
41
|
+
@media (min-width: #{$min-value}) and (max-width: #{$max-value}) {
|
|
42
|
+
@content;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// --- Typography -----------------------------------------------------------
|
|
47
|
+
|
|
48
|
+
// Load a font with a modern, self-hosted stack (woff2 + woff, font-display: swap).
|
|
49
|
+
// @include font-face('Roboto', 'roboto-regular', 400, normal, '../fonts/roboto/');
|
|
50
|
+
@mixin font-face($name, $file, $weight: normal, $style: normal, $path: '../assets/fonts/') {
|
|
51
|
+
@font-face {
|
|
52
|
+
font-family: $name;
|
|
53
|
+
font-style: $style;
|
|
54
|
+
font-weight: $weight;
|
|
55
|
+
font-display: swap;
|
|
56
|
+
src: url('#{$path}#{$file}.woff2') format('woff2'),
|
|
57
|
+
url('#{$path}#{$file}.woff') format('woff');
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// --- Sizing ---------------------------------------------------------------
|
|
62
|
+
|
|
63
|
+
// Fix an element (typically an SVG icon) to exact dimensions, immune to flex
|
|
64
|
+
// compression/stretching. Same as the legacy mixin, minus the `!important`.
|
|
65
|
+
// @include icon-size(24px); // square
|
|
66
|
+
// @include icon-size(18px, 34px);
|
|
67
|
+
@mixin icon-size($width, $height: null) {
|
|
68
|
+
@if $height == null {
|
|
69
|
+
$height: $width;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
width: $width;
|
|
73
|
+
min-width: $width;
|
|
74
|
+
max-width: $width;
|
|
75
|
+
height: $height;
|
|
76
|
+
min-height: $height;
|
|
77
|
+
max-height: $height;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// --- Text ----------------------------------------------------------------
|
|
81
|
+
|
|
82
|
+
// Truncate a single line of text with an ellipsis.
|
|
83
|
+
// @include text-truncate(240px);
|
|
84
|
+
@mixin text-truncate($max-width) {
|
|
85
|
+
display: inline-block;
|
|
86
|
+
max-width: $max-width;
|
|
87
|
+
overflow: hidden;
|
|
88
|
+
text-overflow: ellipsis;
|
|
89
|
+
white-space: nowrap;
|
|
90
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
// NightCSS — Sass design tokens.
|
|
2
|
+
//
|
|
3
|
+
// These maps mirror the `--nc-*` custom properties emitted in `dist/tokens.css`
|
|
4
|
+
// and are the compile-time view of the same design scales. Every map is marked
|
|
5
|
+
// `!default` so a project can override values before `@use`:
|
|
6
|
+
//
|
|
7
|
+
// @use 'nightcss/scss' with (
|
|
8
|
+
// $nc-space: map.merge(nightcss.$nc-space, (4: 1.25rem)),
|
|
9
|
+
// );
|
|
10
|
+
//
|
|
11
|
+
// The accessor functions in `_functions.scss` read these maps and emit
|
|
12
|
+
// `var(--nc-*, <fallback>)`, so CSS produced through them stays runtime-
|
|
13
|
+
// themeable while remaining valid on its own.
|
|
14
|
+
|
|
15
|
+
// Breakpoints — media queries cannot read custom properties, so these are the
|
|
16
|
+
// single source of truth for the layout primitives and `nc-media-*` mixins.
|
|
17
|
+
$nc-breakpoints: (
|
|
18
|
+
'sm': 640px,
|
|
19
|
+
'md': 768px,
|
|
20
|
+
'lg': 1024px,
|
|
21
|
+
'xl': 1280px,
|
|
22
|
+
'2xl': 1536px,
|
|
23
|
+
) !default;
|
|
24
|
+
|
|
25
|
+
// Spacing — 0..24, 4px steps.
|
|
26
|
+
$nc-space: (
|
|
27
|
+
0: 0,
|
|
28
|
+
1: 0.25rem,
|
|
29
|
+
2: 0.5rem,
|
|
30
|
+
3: 0.75rem,
|
|
31
|
+
4: 1rem,
|
|
32
|
+
5: 1.25rem,
|
|
33
|
+
6: 1.5rem,
|
|
34
|
+
7: 1.75rem,
|
|
35
|
+
8: 2rem,
|
|
36
|
+
9: 2.25rem,
|
|
37
|
+
10: 2.5rem,
|
|
38
|
+
11: 2.75rem,
|
|
39
|
+
12: 3rem,
|
|
40
|
+
13: 3.25rem,
|
|
41
|
+
14: 3.5rem,
|
|
42
|
+
15: 3.75rem,
|
|
43
|
+
16: 4rem,
|
|
44
|
+
17: 4.25rem,
|
|
45
|
+
18: 4.5rem,
|
|
46
|
+
19: 4.75rem,
|
|
47
|
+
20: 5rem,
|
|
48
|
+
21: 5.25rem,
|
|
49
|
+
22: 5.5rem,
|
|
50
|
+
23: 5.75rem,
|
|
51
|
+
24: 6rem,
|
|
52
|
+
) !default;
|
|
53
|
+
|
|
54
|
+
// Font families.
|
|
55
|
+
$nc-font: (
|
|
56
|
+
'sans': 'system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
|
|
57
|
+
'mono': 'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace',
|
|
58
|
+
) !default;
|
|
59
|
+
|
|
60
|
+
// Type scale — fluid `clamp()` so it scales with the viewport.
|
|
61
|
+
$nc-text: (
|
|
62
|
+
'xs': 'clamp(0.75rem, 0.7rem + 0.25vw, 0.8125rem)',
|
|
63
|
+
'sm': 'clamp(0.875rem, 0.83rem + 0.2vw, 0.9375rem)',
|
|
64
|
+
'base': 'clamp(1rem, 0.95rem + 0.25vw, 1.0625rem)',
|
|
65
|
+
'lg': 'clamp(1.125rem, 1.05rem + 0.4vw, 1.25rem)',
|
|
66
|
+
'xl': 'clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem)',
|
|
67
|
+
'2xl': 'clamp(1.5rem, 1.25rem + 1.25vw, 1.875rem)',
|
|
68
|
+
'3xl': 'clamp(1.875rem, 1.5rem + 1.9vw, 2.5rem)',
|
|
69
|
+
'4xl': 'clamp(2.25rem, 1.7rem + 2.75vw, 3.25rem)',
|
|
70
|
+
) !default;
|
|
71
|
+
|
|
72
|
+
$nc-leading: (
|
|
73
|
+
'none': 1,
|
|
74
|
+
'tight': 1.25,
|
|
75
|
+
'snug': 1.375,
|
|
76
|
+
'normal': 1.5,
|
|
77
|
+
'relaxed': 1.625,
|
|
78
|
+
'loose': 2,
|
|
79
|
+
) !default;
|
|
80
|
+
|
|
81
|
+
$nc-tracking: (
|
|
82
|
+
'tighter': -0.05em,
|
|
83
|
+
'tight': -0.025em,
|
|
84
|
+
'normal': 0,
|
|
85
|
+
'wide': 0.025em,
|
|
86
|
+
'wider': 0.05em,
|
|
87
|
+
'widest': 0.1em,
|
|
88
|
+
) !default;
|
|
89
|
+
|
|
90
|
+
$nc-weight: (
|
|
91
|
+
'normal': 400,
|
|
92
|
+
'medium': 500,
|
|
93
|
+
'semibold': 600,
|
|
94
|
+
'bold': 700,
|
|
95
|
+
) !default;
|
|
96
|
+
|
|
97
|
+
// Border radius.
|
|
98
|
+
$nc-radius: (
|
|
99
|
+
'none': 0,
|
|
100
|
+
'sm': 0.25rem,
|
|
101
|
+
'md': 0.5rem,
|
|
102
|
+
'lg': 1rem,
|
|
103
|
+
'xl': 1.5rem,
|
|
104
|
+
'full': 9999px,
|
|
105
|
+
) !default;
|
|
106
|
+
|
|
107
|
+
// Elevation shadows.
|
|
108
|
+
$nc-shadow: (
|
|
109
|
+
'xs': '0 1px 2px rgb(0 0 0 / 0.05)',
|
|
110
|
+
'sm': '0 1px 3px rgb(0 0 0 / 0.1), 0 1px 2px rgb(0 0 0 / 0.06)',
|
|
111
|
+
'md': '0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)',
|
|
112
|
+
'lg': '0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)',
|
|
113
|
+
) !default;
|
|
114
|
+
|
|
115
|
+
// Motion.
|
|
116
|
+
$nc-duration: (
|
|
117
|
+
'fast': 150ms,
|
|
118
|
+
'base': 250ms,
|
|
119
|
+
'slow': 400ms,
|
|
120
|
+
) !default;
|
|
121
|
+
|
|
122
|
+
$nc-ease: (
|
|
123
|
+
'standard': 'cubic-bezier(0.4, 0, 0.2, 1)',
|
|
124
|
+
'emphasized': 'cubic-bezier(0, 0, 0.2, 1)',
|
|
125
|
+
) !default;
|
|
126
|
+
|
|
127
|
+
// Z-index.
|
|
128
|
+
$nc-z: (
|
|
129
|
+
'base': 0,
|
|
130
|
+
'dropdown': 1000,
|
|
131
|
+
'sticky': 1020,
|
|
132
|
+
'overlay': 1040,
|
|
133
|
+
'modal': 1060,
|
|
134
|
+
'toast': 1080,
|
|
135
|
+
) !default;
|
|
136
|
+
|
|
137
|
+
// Semantic color — light-dark() lets a single token express both palettes.
|
|
138
|
+
// The key doubles as the `--nc-*` suffix (e.g. `accent` -> `--nc-accent`).
|
|
139
|
+
$nc-color: (
|
|
140
|
+
'accent': 'light-dark(oklch(52% 0.13 168), oklch(72% 0.12 168))',
|
|
141
|
+
'accent-contrast': 'light-dark(oklch(100% 0 0), oklch(16% 0.02 168))',
|
|
142
|
+
'surface': 'light-dark(oklch(100% 0 0), oklch(19% 0 0))',
|
|
143
|
+
'surface-raised': 'light-dark(oklch(97% 0 0), oklch(25% 0 0))',
|
|
144
|
+
'text': 'light-dark(oklch(24% 0 0), oklch(95% 0 0))',
|
|
145
|
+
'text-muted': 'light-dark(oklch(47% 0 0), oklch(72% 0 0))',
|
|
146
|
+
'border': 'light-dark(oklch(90% 0 0), oklch(33% 0 0))',
|
|
147
|
+
'ring': 'var(--nc-accent)',
|
|
148
|
+
) !default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// NightCSS — Sass subpackage entry point.
|
|
2
|
+
//
|
|
3
|
+
// Usage (Dart Sass, module system):
|
|
4
|
+
//
|
|
5
|
+
// @use 'nightcss/scss' as nc;
|
|
6
|
+
//
|
|
7
|
+
// .card {
|
|
8
|
+
// padding: nc.nc-space(4);
|
|
9
|
+
// border-radius: nc.nc-radius('md');
|
|
10
|
+
// box-shadow: nc.nc-shadow('md');
|
|
11
|
+
// color: nc.nc-color('text');
|
|
12
|
+
// background: nc.nc-tint(nc.nc-color('accent'), 92%);
|
|
13
|
+
// }
|
|
14
|
+
//
|
|
15
|
+
// The token maps are re-exported too, for compile-time access and math:
|
|
16
|
+
//
|
|
17
|
+
// map.get(nc.$nc-space, 4) // -> 1rem
|
|
18
|
+
|
|
19
|
+
@forward 'tokens';
|
|
20
|
+
@forward 'functions';
|
|
21
|
+
@forward 'mixins';
|