katanakit-js 6.2.0 → 6.6.1
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 +11 -3
- package/dist/adapters/better-auth/better-auth.service.d.ts +83 -0
- package/dist/adapters/better-auth/better-auth.service.d.ts.map +1 -0
- package/dist/adapters/better-auth/better-auth.service.js +110 -0
- package/dist/adapters/better-auth/better-auth.service.js.map +1 -0
- package/dist/adapters/better-auth/client.d.ts +51 -0
- package/dist/adapters/better-auth/client.d.ts.map +1 -0
- package/dist/adapters/better-auth/client.js +67 -0
- package/dist/adapters/better-auth/client.js.map +1 -0
- package/dist/adapters/better-auth/index.d.ts +3 -0
- package/dist/adapters/better-auth/index.d.ts.map +1 -0
- package/dist/adapters/better-auth/index.js +3 -0
- package/dist/adapters/better-auth/index.js.map +1 -0
- package/dist/adapters/express/server.d.ts +133 -1
- package/dist/adapters/express/server.d.ts.map +1 -1
- package/dist/adapters/express/server.js +199 -97
- package/dist/adapters/express/server.js.map +1 -1
- package/dist/adapters/index.d.ts +2 -0
- package/dist/adapters/index.d.ts.map +1 -1
- package/dist/adapters/index.js +2 -0
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/insforge/insforge.service.d.ts +139 -4
- package/dist/adapters/insforge/insforge.service.d.ts.map +1 -1
- package/dist/adapters/insforge/insforge.service.js +383 -213
- package/dist/adapters/insforge/insforge.service.js.map +1 -1
- package/dist/adapters/notion/notion.service.d.ts +130 -144
- package/dist/adapters/notion/notion.service.d.ts.map +1 -1
- package/dist/adapters/notion/notion.service.js +330 -341
- package/dist/adapters/notion/notion.service.js.map +1 -1
- package/dist/adapters/photoswipe/index.d.ts +2 -0
- package/dist/adapters/photoswipe/index.d.ts.map +1 -0
- package/dist/adapters/photoswipe/index.js +2 -0
- package/dist/adapters/photoswipe/index.js.map +1 -0
- package/dist/adapters/photoswipe/photoswipe.service.d.ts +99 -0
- package/dist/adapters/photoswipe/photoswipe.service.d.ts.map +1 -0
- package/dist/adapters/photoswipe/photoswipe.service.js +150 -0
- package/dist/adapters/photoswipe/photoswipe.service.js.map +1 -0
- package/dist/adapters/telegram/telegram.service.d.ts +82 -13
- package/dist/adapters/telegram/telegram.service.d.ts.map +1 -1
- package/dist/adapters/telegram/telegram.service.js +133 -55
- package/dist/adapters/telegram/telegram.service.js.map +1 -1
- package/dist/adapters/wordpress/wordpress.service.d.ts +181 -110
- package/dist/adapters/wordpress/wordpress.service.d.ts.map +1 -1
- package/dist/adapters/wordpress/wordpress.service.js +556 -465
- package/dist/adapters/wordpress/wordpress.service.js.map +1 -1
- package/dist/config/seo.service.d.ts +1 -1
- package/dist/config/seo.service.d.ts.map +1 -1
- package/dist/config/seo.service.js +1 -1
- package/dist/config/seo.service.js.map +1 -1
- package/dist/core/services/access.service.d.ts +167 -4
- package/dist/core/services/access.service.d.ts.map +1 -1
- package/dist/core/services/access.service.js +241 -31
- package/dist/core/services/access.service.js.map +1 -1
- package/dist/core/services/agent.service.d.ts +182 -27
- package/dist/core/services/agent.service.d.ts.map +1 -1
- package/dist/core/services/agent.service.js +296 -164
- package/dist/core/services/agent.service.js.map +1 -1
- package/dist/core/services/assistant.service.d.ts +96 -5
- package/dist/core/services/assistant.service.d.ts.map +1 -1
- package/dist/core/services/assistant.service.js +171 -66
- package/dist/core/services/assistant.service.js.map +1 -1
- package/dist/core/services/dates.service.d.ts +183 -11
- package/dist/core/services/dates.service.d.ts.map +1 -1
- package/dist/core/services/dates.service.js +256 -57
- package/dist/core/services/dates.service.js.map +1 -1
- package/dist/core/services/http.service.d.ts +172 -133
- package/dist/core/services/http.service.d.ts.map +1 -1
- package/dist/core/services/http.service.js +367 -310
- package/dist/core/services/http.service.js.map +1 -1
- package/dist/core/services/logger.service.d.ts +96 -34
- package/dist/core/services/logger.service.d.ts.map +1 -1
- package/dist/core/services/logger.service.js +128 -41
- package/dist/core/services/logger.service.js.map +1 -1
- package/dist/core/services/query.service.d.ts +101 -0
- package/dist/core/services/query.service.d.ts.map +1 -1
- package/dist/core/services/query.service.js +131 -14
- package/dist/core/services/query.service.js.map +1 -1
- package/dist/core/services/utils.service.d.ts +286 -131
- package/dist/core/services/utils.service.d.ts.map +1 -1
- package/dist/core/services/utils.service.js +417 -227
- package/dist/core/services/utils.service.js.map +1 -1
- package/dist/core/services/validation.service.d.ts +48 -3
- package/dist/core/services/validation.service.d.ts.map +1 -1
- package/dist/core/services/validation.service.js +75 -23
- package/dist/core/services/validation.service.js.map +1 -1
- package/dist/infrastructure/decorators/cache.decorator.d.ts +53 -0
- package/dist/infrastructure/decorators/cache.decorator.d.ts.map +1 -0
- package/dist/infrastructure/decorators/cache.decorator.js +47 -0
- package/dist/infrastructure/decorators/cache.decorator.js.map +1 -0
- package/dist/infrastructure/decorators/index.d.ts +4 -0
- package/dist/infrastructure/decorators/index.d.ts.map +1 -0
- package/dist/infrastructure/decorators/index.js +4 -0
- package/dist/infrastructure/decorators/index.js.map +1 -0
- package/dist/infrastructure/decorators/logger.decorator.d.ts +38 -0
- package/dist/infrastructure/decorators/logger.decorator.d.ts.map +1 -0
- package/dist/infrastructure/decorators/logger.decorator.js +66 -0
- package/dist/infrastructure/decorators/logger.decorator.js.map +1 -0
- package/dist/infrastructure/decorators/retry.decorator.d.ts +37 -0
- package/dist/infrastructure/decorators/retry.decorator.d.ts.map +1 -0
- package/dist/infrastructure/decorators/retry.decorator.js +54 -0
- package/dist/infrastructure/decorators/retry.decorator.js.map +1 -0
- package/dist/infrastructure/index.d.ts +1 -0
- package/dist/infrastructure/index.d.ts.map +1 -1
- package/dist/infrastructure/index.js +1 -0
- package/dist/infrastructure/index.js.map +1 -1
- package/dist/styles.css +2 -0
- package/package.json +49 -14
- package/scss/_flags.scss +179 -0
- package/scss/_functions.scss +168 -0
- package/scss/_mixins.scss +658 -0
- package/scss/_reset.scss +275 -0
- package/scss/_utilities.scss +449 -0
- package/scss/_variables.scss +539 -0
- package/scss/components/_index.scss +50 -0
- package/scss/demo.scss +12 -0
- package/scss/main.scss +56 -0
|
@@ -0,0 +1,539 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// _variables.scss
|
|
3
|
+
// Design tokens, color palettes and CSS custom-property
|
|
4
|
+
// generators. This module is the single source of truth for the
|
|
5
|
+
// framework palette and tokens.
|
|
6
|
+
//
|
|
7
|
+
// All maps are flagged with !default: define your own value
|
|
8
|
+
// before @use-ing this module to override them.
|
|
9
|
+
// ============================================================
|
|
10
|
+
@use "sass:map";
|
|
11
|
+
@use "sass:list";
|
|
12
|
+
@use "sass:meta";
|
|
13
|
+
@use "sass:color";
|
|
14
|
+
|
|
15
|
+
// ============================================
|
|
16
|
+
// TOKEN MAPS
|
|
17
|
+
// Sass maps that store the framework design tokens. Keys become
|
|
18
|
+
// the class/custom-property suffixes (e.g. "sm" → --shadow-sm).
|
|
19
|
+
// ============================================
|
|
20
|
+
|
|
21
|
+
// Named font stacks: key = token name, value = CSS font-family list.
|
|
22
|
+
$font-families: (
|
|
23
|
+
"sans-serif": (ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif),
|
|
24
|
+
"serif": ("Times New Roman", Trebuchet, Geneva, serif),
|
|
25
|
+
"mono": (monospace)
|
|
26
|
+
) !default;
|
|
27
|
+
|
|
28
|
+
// Box-shadow presets (Tailwind-style). Single values are plain
|
|
29
|
+
// shadows; lists combine multiple shadows separated by commas.
|
|
30
|
+
$shadow-sizes: (
|
|
31
|
+
"default": (0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)),
|
|
32
|
+
"sm": 0 1px 2px 0 rgb(0 0 0 / 0.05),
|
|
33
|
+
"md": (0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)),
|
|
34
|
+
"lg": (0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)),
|
|
35
|
+
"xl": (0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)),
|
|
36
|
+
"2xl": 0 25px 50px -12px rgb(0 0 0 / 0.25),
|
|
37
|
+
"inner": inset 0 2px 4px 0 rgb(0 0 0 / 0.05)
|
|
38
|
+
) !default;
|
|
39
|
+
|
|
40
|
+
// Max-width presets for container-like components.
|
|
41
|
+
$container-sizes: (
|
|
42
|
+
"sm": 24rem, "md": 28rem, "lg": 32rem, "xl": 36rem,
|
|
43
|
+
"2xl": 42rem, "3xl": 48rem, "4xl": 56rem, "5xl": 64rem, "6xl": 72rem
|
|
44
|
+
) !default;
|
|
45
|
+
|
|
46
|
+
// Screen breakpoints (min-width values). Mirrored in _mixins.scss.
|
|
47
|
+
$breakpoint-sizes: (
|
|
48
|
+
"xs": 0, "sm": 640px, "md": 768px, "lg": 1024px,
|
|
49
|
+
"xl": 1280px, "2xl": 1536px, "3xl": 1920px
|
|
50
|
+
) !default;
|
|
51
|
+
|
|
52
|
+
// Classic spacing scale used for the --spacing-* custom properties.
|
|
53
|
+
$spacing-scale: (
|
|
54
|
+
"0": 0, "1": 0.25rem, "2": 0.5rem, "3": 0.75rem, "4": 1rem,
|
|
55
|
+
"5": 1.25rem, "6": 1.5rem, "8": 2rem, "10": 2.5rem, "12": 3rem,
|
|
56
|
+
"16": 4rem, "20": 5rem, "24": 6rem, "32": 8rem
|
|
57
|
+
) !default;
|
|
58
|
+
|
|
59
|
+
// Full spacing scale — single source of truth for the .p-*/.m-*/.gap-*
|
|
60
|
+
// utility classes (_utilities.scss) and for the @apply registry
|
|
61
|
+
// (_mixins.scss). Fractions use kebab notation: p-05, p-1-5…
|
|
62
|
+
$spacing-map: (
|
|
63
|
+
"0": 0, "05": 0.125rem, "base": 1px, "1": 0.25rem, "1-5": 0.375rem,
|
|
64
|
+
"2": 0.5rem, "2-5": 0.625rem, "3": 0.75rem, "3-5": 0.875rem, "4": 1rem,
|
|
65
|
+
"5": 1.25rem, "6": 1.5rem, "7": 1.75rem, "8": 2rem, "9": 2.25rem,
|
|
66
|
+
"10": 2.5rem, "11": 2.75rem, "12": 3rem, "14": 3.5rem, "16": 4rem,
|
|
67
|
+
"20": 5rem, "24": 6rem, "28": 7rem, "32": 8rem, "36": 9rem, "40": 10rem,
|
|
68
|
+
"44": 11rem, "48": 12rem, "52": 13rem, "56": 14rem, "60": 15rem, "64": 16rem,
|
|
69
|
+
"72": 18rem, "80": 20rem, "96": 24rem
|
|
70
|
+
) !default;
|
|
71
|
+
|
|
72
|
+
// Border-radius presets; "full" produces a pill/circle shape.
|
|
73
|
+
$radius: (
|
|
74
|
+
"default": 0.25rem, "sm": 0.125rem, "md": 0.375rem, "lg": 0.5rem,
|
|
75
|
+
"xl": 0.75rem, "2xl": 1rem, "3xl": 1.5rem, "full": 9999px
|
|
76
|
+
) !default;
|
|
77
|
+
|
|
78
|
+
// Z-index scale, from plain numbers to named layers (dropdown…tooltip).
|
|
79
|
+
$z-layers: (
|
|
80
|
+
"auto": auto, "0": 0, "10": 10, "20": 20, "30": 30,
|
|
81
|
+
"40": 40, "50": 50, "dropdown": 1000, "sticky": 1020,
|
|
82
|
+
"fixed": 1030, "modal": 1040, "popover": 1050, "tooltip": 1060
|
|
83
|
+
) !default;
|
|
84
|
+
|
|
85
|
+
// Transition durations keyed by milliseconds.
|
|
86
|
+
$transition-durations: (
|
|
87
|
+
"75": 75ms, "100": 100ms, "150": 150ms, "200": 200ms,
|
|
88
|
+
"300": 300ms, "500": 500ms, "700": 700ms, "1000": 1000ms
|
|
89
|
+
) !default;
|
|
90
|
+
|
|
91
|
+
// Transition timing functions. Keys are used as .ease-* suffixes.
|
|
92
|
+
$transition-easings: (
|
|
93
|
+
"linear": linear, "in": cubic-bezier(0.4, 0, 1, 1),
|
|
94
|
+
"out": cubic-bezier(0, 0, 0.2, 1), "in-out": cubic-bezier(0.4, 0, 0.2, 1)
|
|
95
|
+
) !default;
|
|
96
|
+
|
|
97
|
+
// ============================================
|
|
98
|
+
// TOKEN ACCESS FUNCTIONS
|
|
99
|
+
// Typed getters for the token maps. Each one errors out with the
|
|
100
|
+
// list of valid keys when given an unknown key, catching typos
|
|
101
|
+
// at compile time.
|
|
102
|
+
// ============================================
|
|
103
|
+
|
|
104
|
+
// Returns the font stack for a key of $font-families.
|
|
105
|
+
@function font-family($name) {
|
|
106
|
+
@if not map.has-key($font-families, $name) {
|
|
107
|
+
@error "font-family(): '#{$name}' no existe. Use: #{map.keys($font-families)}.";
|
|
108
|
+
}
|
|
109
|
+
@return map.get($font-families, $name);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// Returns the box-shadow preset for $size ("default", "sm", "md"…).
|
|
113
|
+
@function shadow($size: "default") {
|
|
114
|
+
@if not map.has-key($shadow-sizes, $size) {
|
|
115
|
+
@error "shadow(): '#{$size}' no existe. Use: #{map.keys($shadow-sizes)}.";
|
|
116
|
+
}
|
|
117
|
+
@return map.get($shadow-sizes, $size);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Returns the container max-width for $size ("sm"…"6xl").
|
|
121
|
+
@function container($size) {
|
|
122
|
+
@if not map.has-key($container-sizes, $size) {
|
|
123
|
+
@error "container(): '#{$size}' no existe. Use: #{map.keys($container-sizes)}.";
|
|
124
|
+
}
|
|
125
|
+
@return map.get($container-sizes, $size);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// Returns the pixel width for a breakpoint name ("xs"…"3xl").
|
|
129
|
+
@function breakpoint($name) {
|
|
130
|
+
@if not map.has-key($breakpoint-sizes, $name) {
|
|
131
|
+
@error "breakpoint(): '#{$name}' no existe. Use: #{map.keys($breakpoint-sizes)}.";
|
|
132
|
+
}
|
|
133
|
+
@return map.get($breakpoint-sizes, $name);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// Returns a value from $spacing-scale. Accepts a string key ("4")
|
|
137
|
+
// or a number (4), which is converted to its key form.
|
|
138
|
+
@function spacing($size) {
|
|
139
|
+
@if meta.type-of($size) == "number" { $size: "#{$size}"; }
|
|
140
|
+
@if not map.has-key($spacing-scale, $size) {
|
|
141
|
+
@error "spacing(): '#{$size}' no existe. Use: #{map.keys($spacing-scale)}.";
|
|
142
|
+
}
|
|
143
|
+
@return map.get($spacing-scale, $size);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// Returns the border-radius preset for $size.
|
|
147
|
+
@function radius($size: "default") {
|
|
148
|
+
@if not map.has-key($radius, $size) {
|
|
149
|
+
@error "radius(): '#{$size}' no existe. Use: #{map.keys($radius)}.";
|
|
150
|
+
}
|
|
151
|
+
@return map.get($radius, $size);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Returns the z-index for a layer key; numbers are stringified ("10").
|
|
155
|
+
@function z($layer) {
|
|
156
|
+
@if meta.type-of($layer) == "number" { $layer: "#{$layer}"; }
|
|
157
|
+
@if not map.has-key($z-layers, $layer) {
|
|
158
|
+
@error "z(): '#{$layer}' no existe. Use: #{map.keys($z-layers)}.";
|
|
159
|
+
}
|
|
160
|
+
@return map.get($z-layers, $layer);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// Returns the transition duration for $ms (75, 100, 150…).
|
|
164
|
+
@function duration($ms) {
|
|
165
|
+
@if meta.type-of($ms) == "number" { $ms: "#{$ms}"; }
|
|
166
|
+
@if not map.has-key($transition-durations, $ms) {
|
|
167
|
+
@error "duration(): '#{$ms}' no existe. Use: #{map.keys($transition-durations)}.";
|
|
168
|
+
}
|
|
169
|
+
@return map.get($transition-durations, $ms);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// Returns the easing curve for $name (default "in-out").
|
|
173
|
+
@function ease($name: "in-out") {
|
|
174
|
+
@if not map.has-key($transition-easings, $name) {
|
|
175
|
+
@error "ease(): '#{$name}' no existe. Use: #{map.keys($transition-easings)}.";
|
|
176
|
+
}
|
|
177
|
+
@return map.get($transition-easings, $name);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// ============================================
|
|
181
|
+
// GENERATE CSS CUSTOM PROPERTIES (tokens)
|
|
182
|
+
// Emits the design tokens as --prefix-key custom properties
|
|
183
|
+
// inside :root, e.g. --font-sans-serif, --shadow-md, --spacing-4.
|
|
184
|
+
// ============================================
|
|
185
|
+
|
|
186
|
+
// Emits one group of custom properties per token map.
|
|
187
|
+
// Every group is enabled by default; pass false to skip a group
|
|
188
|
+
// (e.g. generate-css-tokens($shadows: false)).
|
|
189
|
+
@mixin generate-css-tokens(
|
|
190
|
+
$fonts: true, $shadows: true, $containers: true, $spacing: true,
|
|
191
|
+
$radius-tokens: true, $z: true, $durations: true, $easings: true
|
|
192
|
+
) {
|
|
193
|
+
:root {
|
|
194
|
+
@if $fonts { @each $n, $v in $font-families { --font-#{$n}: #{list.join($v, (), $separator: comma)}; } }
|
|
195
|
+
@if $shadows { @each $n, $v in $shadow-sizes { --shadow-#{$n}: #{$v}; } }
|
|
196
|
+
@if $containers { @each $n, $v in $container-sizes { --container-#{$n}: #{$v}; } }
|
|
197
|
+
@if $spacing { @each $n, $v in $spacing-scale { --spacing-#{$n}: #{$v}; } }
|
|
198
|
+
@if $radius-tokens { @each $n, $v in $radius { --radius-#{$n}: #{$v}; } }
|
|
199
|
+
@if $z { @each $n, $v in $z-layers { --z-#{$n}: #{$v}; } }
|
|
200
|
+
@if $durations { @each $n, $v in $transition-durations { --duration-#{$n}: #{$v}; } }
|
|
201
|
+
@if $easings { @each $n, $v in $transition-easings { --ease-#{$n}: #{$v}; } }
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// ============================================================
|
|
206
|
+
// COLOR PALETTES
|
|
207
|
+
// Each palette maps a shade (100–700, light → dark) to an hsla
|
|
208
|
+
// color. Palette names become the prefix of the generated
|
|
209
|
+
// classes and custom properties (--purple-500, .bg-purple-500…).
|
|
210
|
+
// ============================================================
|
|
211
|
+
|
|
212
|
+
// Main palettes. Override the whole map or individual entries
|
|
213
|
+
// before importing to re-theme the framework.
|
|
214
|
+
$colors: (
|
|
215
|
+
"neutral": (
|
|
216
|
+
50: hsla(0, 0%, 97%, 1), 100: hsla(0, 0%, 93%, 1), 200: hsla(0, 0%, 86%, 1),
|
|
217
|
+
300: hsla(0, 0%, 71%, 1), 400: hsla(0, 0%, 50%, 1), 500: hsla(0, 0%, 35%, 1),
|
|
218
|
+
600: hsla(0, 0%, 24%, 1), 700: hsla(0, 0%, 12%, 1), 800: hsla(0, 0%, 9%, 1),
|
|
219
|
+
900: hsla(0, 0%, 6%, 1), 950: hsla(0, 0%, 3%, 1),
|
|
220
|
+
),
|
|
221
|
+
"purple": (
|
|
222
|
+
50: hsla(269, 60%, 97%, 1), 100: hsla(269, 60%, 93%, 1), 200: hsla(269, 70%, 86%, 1),
|
|
223
|
+
300: hsla(269, 70%, 71%, 1), 400: hsla(269, 66%, 50%, 1), 500: hsla(269, 66%, 35%, 1),
|
|
224
|
+
600: hsla(269, 60%, 24%, 1), 700: hsla(269, 50%, 12%, 1), 800: hsla(269, 50%, 9%, 1),
|
|
225
|
+
900: hsla(269, 50%, 6%, 1), 950: hsla(269, 50%, 3%, 1),
|
|
226
|
+
),
|
|
227
|
+
"info": (
|
|
228
|
+
50: hsla(215, 95%, 97%, 1), 100: hsla(215, 95%, 93%, 1), 200: hsla(215, 95%, 86%, 1),
|
|
229
|
+
300: hsla(215, 95%, 71%, 1), 400: hsla(215, 95%, 50%, 1), 500: hsla(215, 95%, 35%, 1),
|
|
230
|
+
600: hsla(215, 95%, 24%, 1), 700: hsla(215, 95%, 12%, 1), 800: hsla(215, 95%, 9%, 1),
|
|
231
|
+
900: hsla(215, 95%, 6%, 1), 950: hsla(215, 95%, 3%, 1),
|
|
232
|
+
),
|
|
233
|
+
"warning": (
|
|
234
|
+
50: hsla(49, 100%, 97%, 1), 100: hsla(49, 100%, 93%, 1), 200: hsla(49, 100%, 86%, 1),
|
|
235
|
+
300: hsla(49, 100%, 71%, 1), 400: hsla(49, 100%, 50%, 1), 500: hsla(49, 100%, 35%, 1),
|
|
236
|
+
600: hsla(49, 90%, 24%, 1), 700: hsla(49, 70%, 12%, 1), 800: hsla(49, 70%, 9%, 1),
|
|
237
|
+
900: hsla(49, 70%, 6%, 1), 950: hsla(49, 70%, 3%, 1),
|
|
238
|
+
),
|
|
239
|
+
"danger": (
|
|
240
|
+
50: hsla(3, 95%, 97%, 1), 100: hsla(3, 95%, 93%, 1), 200: hsla(3, 95%, 86%, 1),
|
|
241
|
+
300: hsla(3, 95%, 71%, 1), 400: hsla(3, 95%, 50%, 1), 500: hsla(3, 95%, 35%, 1),
|
|
242
|
+
600: hsla(3, 95%, 24%, 1), 700: hsla(3, 95%, 12%, 1), 800: hsla(3, 95%, 9%, 1),
|
|
243
|
+
900: hsla(3, 95%, 6%, 1), 950: hsla(3, 95%, 3%, 1),
|
|
244
|
+
),
|
|
245
|
+
"success": (
|
|
246
|
+
50: hsla(147, 95%, 97%, 1), 100: hsla(147, 95%, 93%, 1), 200: hsla(147, 95%, 86%, 1),
|
|
247
|
+
300: hsla(147, 95%, 71%, 1), 400: hsla(147, 95%, 50%, 1), 500: hsla(147, 95%, 35%, 1),
|
|
248
|
+
600: hsla(147, 95%, 24%, 1), 700: hsla(147, 95%, 17%, 1), 800: hsla(147, 95%, 12%, 1),
|
|
249
|
+
900: hsla(147, 95%, 8%, 1), 950: hsla(147, 95%, 4%, 1),
|
|
250
|
+
),
|
|
251
|
+
// --- Extended palettes (Tailwind-compatible) ---
|
|
252
|
+
"slate": (
|
|
253
|
+
50: hsl(210, 40%, 98%), 100: hsl(210, 40%, 96%), 200: hsl(214, 32%, 91%),
|
|
254
|
+
300: hsl(213, 27%, 84%), 400: hsl(215, 20%, 65%), 500: hsl(215, 16%, 47%),
|
|
255
|
+
600: hsl(215, 19%, 35%), 700: hsl(215, 25%, 27%), 800: hsl(217, 33%, 17%),
|
|
256
|
+
900: hsl(222, 47%, 11%), 950: hsl(229, 84%, 5%),
|
|
257
|
+
),
|
|
258
|
+
"gray": (
|
|
259
|
+
50: hsl(220, 14%, 96%), 100: hsl(220, 13%, 91%), 200: hsl(220, 13%, 84%),
|
|
260
|
+
300: hsl(216, 12%, 73%), 400: hsl(218, 11%, 65%), 500: hsl(220, 9%, 46%),
|
|
261
|
+
600: hsl(220, 8%, 36%), 700: hsl(220, 10%, 28%), 800: hsl(220, 14%, 18%),
|
|
262
|
+
900: hsl(224, 25%, 10%), 950: hsl(230, 40%, 5%),
|
|
263
|
+
),
|
|
264
|
+
"zinc": (
|
|
265
|
+
50: hsl(0, 0%, 98%), 100: hsl(240, 5%, 96%), 200: hsl(240, 6%, 90%),
|
|
266
|
+
300: hsl(240, 5%, 81%), 400: hsl(240, 5%, 65%), 500: hsl(240, 4%, 46%),
|
|
267
|
+
600: hsl(240, 5%, 36%), 700: hsl(240, 5%, 28%), 800: hsl(240, 6%, 17%),
|
|
268
|
+
900: hsl(240, 10%, 10%), 950: hsl(240, 20%, 4%),
|
|
269
|
+
),
|
|
270
|
+
"stone": (
|
|
271
|
+
50: hsl(60, 9%, 97%), 100: hsl(60, 5%, 93%), 200: hsl(20, 6%, 87%),
|
|
272
|
+
300: hsl(30, 5%, 76%), 400: hsl(30, 4%, 60%), 500: hsl(25, 5%, 45%),
|
|
273
|
+
600: hsl(25, 6%, 35%), 700: hsl(28, 7%, 27%), 800: hsl(30, 9%, 17%),
|
|
274
|
+
900: hsl(24, 15%, 11%), 950: hsl(30, 20%, 5%),
|
|
275
|
+
),
|
|
276
|
+
"red": (
|
|
277
|
+
50: hsl(0, 86%, 97%), 100: hsl(0, 93%, 94%), 200: hsl(0, 96%, 90%),
|
|
278
|
+
300: hsl(0, 94%, 82%), 400: hsl(0, 91%, 71%), 500: hsl(0, 84%, 60%),
|
|
279
|
+
600: hsl(0, 72%, 51%), 700: hsl(0, 74%, 42%), 800: hsl(0, 70%, 35%),
|
|
280
|
+
900: hsl(0, 63%, 31%), 950: hsl(0, 75%, 15%),
|
|
281
|
+
),
|
|
282
|
+
"orange": (
|
|
283
|
+
50: hsl(34, 100%, 97%), 100: hsl(34, 100%, 92%), 200: hsl(32, 98%, 83%),
|
|
284
|
+
300: hsl(31, 97%, 72%), 400: hsl(27, 96%, 61%), 500: hsl(25, 95%, 53%),
|
|
285
|
+
600: hsl(21, 90%, 48%), 700: hsl(17, 88%, 40%), 800: hsl(15, 79%, 34%),
|
|
286
|
+
900: hsl(16, 72%, 28%), 950: hsl(14, 74%, 14%),
|
|
287
|
+
),
|
|
288
|
+
"amber": (
|
|
289
|
+
50: hsl(48, 100%, 96%), 100: hsl(48, 96%, 89%), 200: hsl(48, 97%, 77%),
|
|
290
|
+
300: hsl(46, 97%, 65%), 400: hsl(43, 96%, 56%), 500: hsl(38, 92%, 50%),
|
|
291
|
+
600: hsl(32, 95%, 44%), 700: hsl(26, 90%, 37%), 800: hsl(23, 83%, 31%),
|
|
292
|
+
900: hsl(22, 78%, 26%), 950: hsl(22, 80%, 14%),
|
|
293
|
+
),
|
|
294
|
+
"yellow": (
|
|
295
|
+
50: hsl(55, 92%, 95%), 100: hsl(55, 97%, 88%), 200: hsl(53, 98%, 77%),
|
|
296
|
+
300: hsl(50, 98%, 64%), 400: hsl(48, 96%, 53%), 500: hsl(45, 93%, 47%),
|
|
297
|
+
600: hsl(41, 96%, 40%), 700: hsl(35, 92%, 33%), 800: hsl(32, 81%, 29%),
|
|
298
|
+
900: hsl(28, 73%, 26%), 950: hsl(27, 75%, 13%),
|
|
299
|
+
),
|
|
300
|
+
"lime": (
|
|
301
|
+
50: hsl(78, 92%, 95%), 100: hsl(80, 89%, 86%), 200: hsl(82, 84%, 72%),
|
|
302
|
+
300: hsl(82, 77%, 56%), 400: hsl(84, 81%, 44%), 500: hsl(85, 78%, 37%),
|
|
303
|
+
600: hsl(86, 69%, 30%), 700: hsl(88, 61%, 25%), 800: hsl(89, 53%, 21%),
|
|
304
|
+
900: hsl(89, 45%, 18%), 950: hsl(89, 60%, 10%),
|
|
305
|
+
),
|
|
306
|
+
"green": (
|
|
307
|
+
50: hsl(152, 76%, 95%), 100: hsl(149, 80%, 90%), 200: hsl(152, 76%, 80%),
|
|
308
|
+
300: hsl(156, 72%, 67%), 400: hsl(158, 64%, 52%), 500: hsl(160, 84%, 39%),
|
|
309
|
+
600: hsl(161, 94%, 30%), 700: hsl(163, 94%, 24%), 800: hsl(165, 91%, 18%),
|
|
310
|
+
900: hsl(167, 91%, 14%), 950: hsl(168, 100%, 6%),
|
|
311
|
+
),
|
|
312
|
+
"emerald": (
|
|
313
|
+
50: hsl(151, 81%, 96%), 100: hsl(149, 80%, 90%), 200: hsl(152, 76%, 80%),
|
|
314
|
+
300: hsl(156, 72%, 67%), 400: hsl(158, 64%, 52%), 500: hsl(160, 84%, 39%),
|
|
315
|
+
600: hsl(161, 94%, 30%), 700: hsl(163, 94%, 24%), 800: hsl(165, 91%, 18%),
|
|
316
|
+
900: hsl(167, 91%, 14%), 950: hsl(168, 100%, 6%),
|
|
317
|
+
),
|
|
318
|
+
"teal": (
|
|
319
|
+
50: hsl(166, 76%, 97%), 100: hsl(167, 85%, 89%), 200: hsl(168, 84%, 78%),
|
|
320
|
+
300: hsl(170, 77%, 64%), 400: hsl(172, 66%, 50%), 500: hsl(173, 80%, 36%),
|
|
321
|
+
600: hsl(174, 83%, 28%), 700: hsl(175, 78%, 23%), 800: hsl(176, 69%, 18%),
|
|
322
|
+
900: hsl(178, 61%, 16%), 950: hsl(180, 80%, 8%),
|
|
323
|
+
),
|
|
324
|
+
"cyan": (
|
|
325
|
+
50: hsl(183, 100%, 96%), 100: hsl(185, 96%, 90%), 200: hsl(186, 94%, 82%),
|
|
326
|
+
300: hsl(187, 92%, 69%), 400: hsl(187, 81%, 53%), 500: hsl(189, 94%, 43%),
|
|
327
|
+
600: hsl(192, 91%, 34%), 700: hsl(193, 84%, 27%), 800: hsl(195, 78%, 22%),
|
|
328
|
+
900: hsl(197, 71%, 18%), 950: hsl(198, 80%, 9%),
|
|
329
|
+
),
|
|
330
|
+
"sky": (
|
|
331
|
+
50: hsl(204, 100%, 97%), 100: hsl(204, 94%, 94%), 200: hsl(201, 94%, 86%),
|
|
332
|
+
300: hsl(199, 95%, 74%), 400: hsl(198, 93%, 60%), 500: hsl(199, 89%, 48%),
|
|
333
|
+
600: hsl(200, 98%, 39%), 700: hsl(201, 96%, 32%), 800: hsl(201, 90%, 27%),
|
|
334
|
+
900: hsl(202, 80%, 24%), 950: hsl(204, 80%, 12%),
|
|
335
|
+
),
|
|
336
|
+
"blue": (
|
|
337
|
+
50: hsl(214, 100%, 97%), 100: hsl(214, 95%, 93%), 200: hsl(213, 97%, 87%),
|
|
338
|
+
300: hsl(212, 96%, 78%), 400: hsl(213, 94%, 68%), 500: hsl(217, 91%, 60%),
|
|
339
|
+
600: hsl(221, 83%, 53%), 700: hsl(224, 76%, 48%), 800: hsl(226, 71%, 40%),
|
|
340
|
+
900: hsl(224, 64%, 33%), 950: hsl(226, 55%, 21%),
|
|
341
|
+
),
|
|
342
|
+
"indigo": (
|
|
343
|
+
50: hsl(226, 100%, 97%), 100: hsl(226, 100%, 94%), 200: hsl(228, 96%, 89%),
|
|
344
|
+
300: hsl(230, 94%, 82%), 400: hsl(234, 89%, 74%), 500: hsl(239, 84%, 67%),
|
|
345
|
+
600: hsl(243, 75%, 59%), 700: hsl(245, 58%, 51%), 800: hsl(244, 55%, 41%),
|
|
346
|
+
900: hsl(243, 47%, 34%), 950: hsl(244, 47%, 20%),
|
|
347
|
+
),
|
|
348
|
+
"violet": (
|
|
349
|
+
50: hsl(250, 100%, 97%), 100: hsl(251, 100%, 94%), 200: hsl(251, 91%, 87%),
|
|
350
|
+
300: hsl(252, 90%, 80%), 400: hsl(256, 86%, 72%), 500: hsl(258, 80%, 63%),
|
|
351
|
+
600: hsl(262, 73%, 54%), 700: hsl(263, 70%, 46%), 800: hsl(263, 67%, 38%),
|
|
352
|
+
900: hsl(263, 62%, 31%), 950: hsl(265, 60%, 18%),
|
|
353
|
+
),
|
|
354
|
+
"pink": (
|
|
355
|
+
50: hsl(330, 100%, 97%), 100: hsl(340, 100%, 93%), 200: hsl(340, 82%, 86%),
|
|
356
|
+
300: hsl(339, 77%, 76%), 400: hsl(340, 72%, 65%), 500: hsl(340, 75%, 54%),
|
|
357
|
+
600: hsl(343, 72%, 46%), 700: hsl(345, 67%, 39%), 800: hsl(346, 61%, 33%),
|
|
358
|
+
900: hsl(347, 55%, 28%), 950: hsl(349, 66%, 14%),
|
|
359
|
+
),
|
|
360
|
+
"rose": (
|
|
361
|
+
50: hsl(340, 100%, 97%), 100: hsl(340, 87%, 93%), 200: hsl(340, 82%, 86%),
|
|
362
|
+
300: hsl(340, 77%, 76%), 400: hsl(340, 72%, 65%), 500: hsl(348, 81%, 59%),
|
|
363
|
+
600: hsl(348, 76%, 50%), 700: hsl(348, 67%, 42%), 800: hsl(347, 60%, 35%),
|
|
364
|
+
900: hsl(344, 55%, 29%), 950: hsl(346, 72%, 15%),
|
|
365
|
+
),
|
|
366
|
+
"fuchsia": (
|
|
367
|
+
50: hsl(289, 100%, 97%), 100: hsl(287, 100%, 93%), 200: hsl(288, 86%, 86%),
|
|
368
|
+
300: hsl(291, 77%, 76%), 400: hsl(292, 72%, 65%), 500: hsl(292, 72%, 54%),
|
|
369
|
+
600: hsl(292, 67%, 46%), 700: hsl(291, 59%, 39%), 800: hsl(290, 53%, 33%),
|
|
370
|
+
900: hsl(288, 46%, 28%), 950: hsl(290, 60%, 15%),
|
|
371
|
+
),
|
|
372
|
+
) !default;
|
|
373
|
+
|
|
374
|
+
// Single-value colors without shades: black, white, transparent, current.
|
|
375
|
+
$special-colors: (
|
|
376
|
+
"black": hsl(0, 0%, 3%), "white": hsl(0, 0%, 98%),
|
|
377
|
+
"transparent": transparent, "current": currentColor
|
|
378
|
+
) !default;
|
|
379
|
+
|
|
380
|
+
// Shade order used by the theme() mixin to invert palettes in dark mode.
|
|
381
|
+
$shades: (50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950) !default;
|
|
382
|
+
|
|
383
|
+
// ============================================================
|
|
384
|
+
// COLOR ACCESS FUNCTIONS
|
|
385
|
+
// Typed color getters with compile-time validation.
|
|
386
|
+
// ============================================================
|
|
387
|
+
|
|
388
|
+
// Returns a color from $colors/$special-colors.
|
|
389
|
+
// Special colors ("white", "black"…) ignore $shade. Pass $alpha != 1
|
|
390
|
+
// to change the alpha channel of regular colors.
|
|
391
|
+
@function get-color($name, $shade: 300, $alpha: 1) {
|
|
392
|
+
@if map.has-key($special-colors, $name) {
|
|
393
|
+
$color: map.get($special-colors, $name);
|
|
394
|
+
@if $alpha != 1 and meta.type-of($color) == "color" { @return color.change($color, $alpha: $alpha); }
|
|
395
|
+
@return $color;
|
|
396
|
+
}
|
|
397
|
+
@if not map.has-key($colors, $name) { @error "get-color(): paleta '#{$name}' no existe."; }
|
|
398
|
+
$palette: map.get($colors, $name);
|
|
399
|
+
@if not map.has-key($palette, $shade) { @error "get-color(): tono '#{$shade}' no existe en '#{$name}'."; }
|
|
400
|
+
$color: map.get($palette, $shade);
|
|
401
|
+
@if $alpha != 1 { @return color.change($color, $alpha: $alpha); }
|
|
402
|
+
@return $color;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
// Shorthand: main color of a palette (shade 500) with optional alpha.
|
|
406
|
+
@function get($name, $alpha: 1) { @return get-color($name, 500, $alpha); }
|
|
407
|
+
// Shorthand for a semi-transparent color (alpha defaults to 0.5).
|
|
408
|
+
@function alpha($name, $shade: 500, $alpha: 0.5) { @return get-color($name, $shade, $alpha); }
|
|
409
|
+
|
|
410
|
+
// ============================================================
|
|
411
|
+
// GENERATE CSS CUSTOM PROPERTIES (colors)
|
|
412
|
+
// Emits --palette-shade custom properties (plus the special
|
|
413
|
+
// colors) inside the selector you choose.
|
|
414
|
+
// ============================================================
|
|
415
|
+
|
|
416
|
+
// Private helper: keeps only the palettes whose names are listed in
|
|
417
|
+
// $keys (a single string is wrapped into a one-item list first).
|
|
418
|
+
@function _filter-palettes($map, $keys) {
|
|
419
|
+
@if meta.type-of($keys) == "string" { $keys: ($keys,); }
|
|
420
|
+
$result: ();
|
|
421
|
+
@each $key, $value in $map {
|
|
422
|
+
@if list.index($keys, $key) != null { $result: map.merge($result, ($key: $value)); }
|
|
423
|
+
}
|
|
424
|
+
@return $result;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
// Emits color custom properties.
|
|
428
|
+
// $root: selector to wrap the properties in (default ":root").
|
|
429
|
+
// $palettes: null → all palettes; a map → use it directly;
|
|
430
|
+
// a list of names → only those palettes from $colors.
|
|
431
|
+
// $include-special: also emit --white, --black, --transparent, --current.
|
|
432
|
+
@mixin generate-css-vars($root: ":root", $palettes: null, $include-special: true) {
|
|
433
|
+
$source: $colors;
|
|
434
|
+
@if $palettes != null {
|
|
435
|
+
@if meta.type-of($palettes) == "map" { $source: $palettes; }
|
|
436
|
+
@else { $source: _filter-palettes($colors, $palettes); }
|
|
437
|
+
}
|
|
438
|
+
#{$root} {
|
|
439
|
+
@each $name, $palette in $source {
|
|
440
|
+
@each $shade, $value in $palette { --#{$name}-#{$shade}: #{$value}; }
|
|
441
|
+
}
|
|
442
|
+
@if $include-special {
|
|
443
|
+
@each $name, $value in $special-colors { --#{$name}: #{$value}; }
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
// ============================================================
|
|
449
|
+
// COLOR UTILITY CLASS GENERATORS
|
|
450
|
+
// Emit utility classes from the palettes, e.g.
|
|
451
|
+
// .text-purple-500, .bg-info-300, .border-danger-700 and the
|
|
452
|
+
// special variants .text-white, .bg-transparent…
|
|
453
|
+
// ============================================================
|
|
454
|
+
|
|
455
|
+
// Private generator shared by text/bg/border utilities:
|
|
456
|
+
// one class per palette shade for $property, prefixed with $class-prefix.
|
|
457
|
+
@mixin _utility-classes($property, $class-prefix, $palettes: null, $include-special: true) {
|
|
458
|
+
$palettes: if(sass($palettes == null): $colors; else: _filter-palettes($colors, $palettes));
|
|
459
|
+
@each $name, $palette in $palettes {
|
|
460
|
+
@each $shade, $value in $palette {
|
|
461
|
+
.#{$class-prefix}-#{$name}-#{$shade} { #{$property}: $value; }
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
@if $include-special {
|
|
465
|
+
@each $name, $value in $special-colors {
|
|
466
|
+
.#{$class-prefix}-#{$name} { #{$property}: $value; }
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
// Public generators. Each accepts $palettes (null = all, list = subset)
|
|
472
|
+
// and $special (whether to emit the special colors too).
|
|
473
|
+
@mixin text-utilities($palettes: null, $special: true) { @include _utility-classes(color, "text", $palettes, $special); }
|
|
474
|
+
@mixin bg-utilities($palettes: null, $special: true) { @include _utility-classes(background-color, "bg", $palettes, $special); }
|
|
475
|
+
@mixin border-utilities($palettes: null, $special: true) { @include _utility-classes(border-color, "border", $palettes, $special); }
|
|
476
|
+
|
|
477
|
+
// Emits :hover color variants: .hover-text-purple-500:hover and
|
|
478
|
+
// .hover-bg-purple-500:hover (plus the special colors).
|
|
479
|
+
@mixin hover-utilities($palettes: null, $special: true) {
|
|
480
|
+
$palettes: if(sass($palettes == null): $colors; else: _filter-palettes($colors, $palettes));
|
|
481
|
+
@each $name, $palette in $palettes {
|
|
482
|
+
@each $shade, $value in $palette {
|
|
483
|
+
.hover-text-#{$name}-#{$shade}:hover { color: $value; }
|
|
484
|
+
.hover-bg-#{$name}-#{$shade}:hover { background-color: $value; }
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
@if $special {
|
|
488
|
+
@each $name, $value in $special-colors {
|
|
489
|
+
.hover-text-#{$name}:hover { color: $value; }
|
|
490
|
+
.hover-bg-#{$name}:hover { background-color: $value; }
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
// Emits every color utility group at once.
|
|
496
|
+
@mixin all-utilities($palettes: null, $special: true) {
|
|
497
|
+
@include text-utilities($palettes, $special);
|
|
498
|
+
@include bg-utilities($palettes, $special);
|
|
499
|
+
@include border-utilities($palettes, $special);
|
|
500
|
+
@include hover-utilities($palettes, $special);
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
// ============================================================
|
|
504
|
+
// THEME
|
|
505
|
+
// Emits a themed set of color custom properties scoped to a
|
|
506
|
+
// selector, e.g. :root[data-theme='dark'].
|
|
507
|
+
// ============================================================
|
|
508
|
+
|
|
509
|
+
// Creates a color theme. For $mode == "dark" each palette is
|
|
510
|
+
// inverted (shade 100 ↔ 700, 200 ↔ 600, …) so light shades become
|
|
511
|
+
// dark and vice versa. $overrides is merged on top of the result.
|
|
512
|
+
// Output selector: :root[data-theme='<mode>'].
|
|
513
|
+
// Dark mode inversion pairs: light shade ↔ dark shade.
|
|
514
|
+
$_dark-inversion: (
|
|
515
|
+
50: 950, 100: 900, 200: 800, 300: 700, 400: 600,
|
|
516
|
+
500: 500, 600: 400, 700: 300, 800: 200, 900: 100, 950: 50
|
|
517
|
+
);
|
|
518
|
+
|
|
519
|
+
@mixin theme($mode, $overrides: ()) {
|
|
520
|
+
$base: $colors;
|
|
521
|
+
@if $mode == "dark" {
|
|
522
|
+
$base: ();
|
|
523
|
+
@each $name, $palette in $colors {
|
|
524
|
+
$new: ();
|
|
525
|
+
@each $shade, $value in $palette {
|
|
526
|
+
$inverted: map.get($_dark-inversion, $shade);
|
|
527
|
+
@if $inverted != null and map.has-key($palette, $inverted) {
|
|
528
|
+
$new: map.merge($new, ($shade: map.get($palette, $inverted)));
|
|
529
|
+
} @else {
|
|
530
|
+
// No inversion pair exists; keep the original value.
|
|
531
|
+
$new: map.merge($new, ($shade: $value));
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
$base: map.merge($base, ($name: $new));
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
@if meta.type-of($overrides) == "map" { $base: map.merge($base, $overrides); }
|
|
538
|
+
@include generate-css-vars(":root[data-theme='#{$mode}']", $base, false);
|
|
539
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Both namespaces point to the same mixins module: `m` is used for
|
|
2
|
+
// apply() and layout mixins; `bp` is available for breakpoint mixins.
|
|
3
|
+
@use "../mixins" as m;
|
|
4
|
+
@use "../mixins" as bp;
|
|
5
|
+
|
|
6
|
+
// ============================================================
|
|
7
|
+
// EXAMPLE COMPONENTS (built with @apply)
|
|
8
|
+
// This is where your custom component styles live. Each class
|
|
9
|
+
// composes registered utilities via apply() and can nest
|
|
10
|
+
// breakpoint/media-query mixins.
|
|
11
|
+
// ============================================================
|
|
12
|
+
|
|
13
|
+
// Simple card: column flexbox with padding, rounded corners,
|
|
14
|
+
// a medium shadow and a white background. Hovering upgrades the shadow.
|
|
15
|
+
.card {
|
|
16
|
+
@include m.apply(flex, flex-col, p-4, rounded-lg, shadow-md, bg-white);
|
|
17
|
+
|
|
18
|
+
&:hover {
|
|
19
|
+
@include m.apply(shadow-lg);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Button: inline-flex, centered content, padding, rounded corners,
|
|
24
|
+
// semibold text and animated color changes on hover/focus.
|
|
25
|
+
.button {
|
|
26
|
+
@include m.apply(
|
|
27
|
+
inline-flex, items-center, justify-center,
|
|
28
|
+
px-4, py-2, rounded-md, font-semibold, transition-colors
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Responsive container: stacks vertically on mobile, switches to a
|
|
33
|
+
// row with more spacing from the md breakpoint (≥ 768px) upward.
|
|
34
|
+
.container-custom {
|
|
35
|
+
@include m.apply(flex, flex-col, gap-4, p-6);
|
|
36
|
+
|
|
37
|
+
@include m.md {
|
|
38
|
+
@include m.apply(flex-row, gap-6, p-8);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Hero section: single-column grid on small screens, two columns
|
|
43
|
+
// with more generous spacing from the lg breakpoint (≥ 1024px).
|
|
44
|
+
.hero {
|
|
45
|
+
@include m.apply(grid, grid-cols-1, gap-8, p-8);
|
|
46
|
+
|
|
47
|
+
@include m.lg {
|
|
48
|
+
@include m.apply(grid-cols-2, gap-12, p-12);
|
|
49
|
+
}
|
|
50
|
+
}
|
package/scss/demo.scss
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// DEMO — entry point for the example page (index.html)
|
|
3
|
+
// Compiled by Vite with HMR: pulls in the full framework plus
|
|
4
|
+
// the example components defined with @apply in
|
|
5
|
+
// components/_index.scss.
|
|
6
|
+
// ============================================================
|
|
7
|
+
|
|
8
|
+
// Full framework stylesheet (reset + tokens + utilities).
|
|
9
|
+
@use "main";
|
|
10
|
+
|
|
11
|
+
// Example components built on top of the framework.
|
|
12
|
+
@use "components/index";
|
package/scss/main.scss
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// KATANAKIT CSS — PUBLIC ENTRY POINT
|
|
3
|
+
// Emits the complete framework stylesheet in this order:
|
|
4
|
+
//
|
|
5
|
+
// 1. Reset / Preflight
|
|
6
|
+
// 2. Design tokens (custom properties on :root)
|
|
7
|
+
// 3. Color custom properties
|
|
8
|
+
// 4. Color utility classes (.text-*, .bg-*, .border-*, :hover)
|
|
9
|
+
// 5. Spacing utilities (.p-*, .m-*, .gap-*)
|
|
10
|
+
// 6. Base effects (.shadow, .rounded, .gap)
|
|
11
|
+
// 7. Typography scale (.text-xs … .text-9xl)
|
|
12
|
+
// 8. Border widths (.border, .border-0/2/4/8)
|
|
13
|
+
// 9. Sizing (.w-*, .h-*, .min-*, .max-*)
|
|
14
|
+
// 10. Flex utilities (.flex-*, .items-*, .justify-*)
|
|
15
|
+
// 11. Effects (.shadow-*, .rounded-*, .z-*, .opacity-*, .duration-*, .ease-*)
|
|
16
|
+
// 12. Layout (display, position, overflow, overflow-x/y, text-align, font-weight, whitespace, overflow-wrap)
|
|
17
|
+
// 13. Aspect ratio, object fit/position
|
|
18
|
+
// 14. Cursor, visibility
|
|
19
|
+
// 15. Typography extensions (text-transform, text-decoration, text-overflow, line-height, letter-spacing, font-family)
|
|
20
|
+
// 16. List style
|
|
21
|
+
// 17. Interactivity (pointer-events, resize, user-select, scroll-behavior, appearance)
|
|
22
|
+
// 18. Border style
|
|
23
|
+
// 19. Float, clear, isolation, box-sizing
|
|
24
|
+
// 20. Table utilities
|
|
25
|
+
// 21. Grid CSS classes (.grid-cols-*, .col-span-*, .row-span-*, .grid-flow-*, .container)
|
|
26
|
+
// 22. Flex CSS classes (.flex-1, .grow, .shrink, .order-*)
|
|
27
|
+
// 23. Position utilities (.top-*, .inset-*, etc.)
|
|
28
|
+
//
|
|
29
|
+
// To compose a smaller custom stylesheet, import the modules
|
|
30
|
+
// individually instead:
|
|
31
|
+
// @use "katanakit-css/src/scss/variables" as v;
|
|
32
|
+
// @use "katanakit-css/src/scss/mixins" as m;
|
|
33
|
+
// @use "katanakit-css/src/scss/functions" as f;
|
|
34
|
+
// ============================================================
|
|
35
|
+
|
|
36
|
+
@use "reset";
|
|
37
|
+
@use "variables" as v;
|
|
38
|
+
@use "functions" as f;
|
|
39
|
+
@use "mixins" as m;
|
|
40
|
+
@use "utilities" as u;
|
|
41
|
+
|
|
42
|
+
// ── 1. Reset / Preflight ──────────────────────────────────
|
|
43
|
+
// (loaded by @use "reset" above — emits box-sizing, margin/padding
|
|
44
|
+
// zeroing, typography normalization, form resets, media defaults)
|
|
45
|
+
|
|
46
|
+
// ── 2. Design tokens ──────────────────────────────────────
|
|
47
|
+
@include v.generate-css-tokens();
|
|
48
|
+
|
|
49
|
+
// ── 3. Color custom properties ────────────────────────────
|
|
50
|
+
@include v.generate-css-vars();
|
|
51
|
+
|
|
52
|
+
// ── 4. Color utility classes ──────────────────────────────
|
|
53
|
+
@include v.all-utilities();
|
|
54
|
+
|
|
55
|
+
// ── 5–23. All utility classes ─────────────────────────────
|
|
56
|
+
@include u.generate-all-utilities();
|