@tenphi/glaze 0.18.0 → 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/README.md +84 -30
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -4
- package/dist/index.d.mts +8 -4
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/docs/api.md +519 -400
- package/docs/methodology.md +125 -50
- package/docs/migration.md +79 -144
- package/docs/okhst.md +116 -254
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -465,7 +465,11 @@ interface GlazeConfig {
|
|
|
465
465
|
darkTone?: ToneWindow;
|
|
466
466
|
/** Saturation reduction factor for dark scheme (0–1). Default: 0.1. */
|
|
467
467
|
darkDesaturation?: number;
|
|
468
|
-
/**
|
|
468
|
+
/**
|
|
469
|
+
* State alias names for Tasty token export. Default to media-query states
|
|
470
|
+
* (`'@media(prefers-color-scheme: dark)'` / `'@media(prefers-contrast: more)'`)
|
|
471
|
+
* so tokens react to the OS preference without registering custom states.
|
|
472
|
+
*/
|
|
469
473
|
states?: {
|
|
470
474
|
dark?: string;
|
|
471
475
|
highContrast?: string;
|
|
@@ -780,7 +784,7 @@ interface GlazeColorToken {
|
|
|
780
784
|
token(options?: GlazeTokenOptions): Record<string, string>;
|
|
781
785
|
/**
|
|
782
786
|
* Export as a tasty style-to-state binding (no color name key).
|
|
783
|
-
* Uses `#name` keys and state aliases (`''`,
|
|
787
|
+
* Uses `#name` keys and state aliases (`''`, `'@media(prefers-color-scheme: dark)'`, etc.).
|
|
784
788
|
* @see https://tasty.style/docs
|
|
785
789
|
*/
|
|
786
790
|
tasty(options?: GlazeTokenOptions): Record<string, string>;
|
|
@@ -916,7 +920,7 @@ interface GlazeTheme {
|
|
|
916
920
|
tokens(options?: GlazeJsonOptions): Record<string, Record<string, string>>;
|
|
917
921
|
/**
|
|
918
922
|
* Export as tasty style-to-state bindings.
|
|
919
|
-
* Uses `#name` color token keys and state aliases (`''`,
|
|
923
|
+
* Uses `#name` color token keys and state aliases (`''`, `'@media(prefers-color-scheme: dark)'`, etc.).
|
|
920
924
|
* Spread into component styles or register as a recipe via `configure({ recipes })`.
|
|
921
925
|
* @see https://tasty.style/docs
|
|
922
926
|
*/
|
|
@@ -1234,7 +1238,7 @@ interface GlazePalette {
|
|
|
1234
1238
|
tokens(options?: GlazeJsonOptions & GlazePaletteExportOptions): Record<string, Record<string, string>>;
|
|
1235
1239
|
/**
|
|
1236
1240
|
* Export all themes as tasty style-to-state bindings.
|
|
1237
|
-
* Uses `#name` color token keys and state aliases (`''`,
|
|
1241
|
+
* Uses `#name` color token keys and state aliases (`''`, `'@media(prefers-color-scheme: dark)'`, etc.).
|
|
1238
1242
|
* Prefix defaults to `true`. Inherits the palette-level `primary`.
|
|
1239
1243
|
* @see https://tasty.style/docs
|
|
1240
1244
|
*/
|
package/dist/index.d.mts
CHANGED
|
@@ -465,7 +465,11 @@ interface GlazeConfig {
|
|
|
465
465
|
darkTone?: ToneWindow;
|
|
466
466
|
/** Saturation reduction factor for dark scheme (0–1). Default: 0.1. */
|
|
467
467
|
darkDesaturation?: number;
|
|
468
|
-
/**
|
|
468
|
+
/**
|
|
469
|
+
* State alias names for Tasty token export. Default to media-query states
|
|
470
|
+
* (`'@media(prefers-color-scheme: dark)'` / `'@media(prefers-contrast: more)'`)
|
|
471
|
+
* so tokens react to the OS preference without registering custom states.
|
|
472
|
+
*/
|
|
469
473
|
states?: {
|
|
470
474
|
dark?: string;
|
|
471
475
|
highContrast?: string;
|
|
@@ -780,7 +784,7 @@ interface GlazeColorToken {
|
|
|
780
784
|
token(options?: GlazeTokenOptions): Record<string, string>;
|
|
781
785
|
/**
|
|
782
786
|
* Export as a tasty style-to-state binding (no color name key).
|
|
783
|
-
* Uses `#name` keys and state aliases (`''`,
|
|
787
|
+
* Uses `#name` keys and state aliases (`''`, `'@media(prefers-color-scheme: dark)'`, etc.).
|
|
784
788
|
* @see https://tasty.style/docs
|
|
785
789
|
*/
|
|
786
790
|
tasty(options?: GlazeTokenOptions): Record<string, string>;
|
|
@@ -916,7 +920,7 @@ interface GlazeTheme {
|
|
|
916
920
|
tokens(options?: GlazeJsonOptions): Record<string, Record<string, string>>;
|
|
917
921
|
/**
|
|
918
922
|
* Export as tasty style-to-state bindings.
|
|
919
|
-
* Uses `#name` color token keys and state aliases (`''`,
|
|
923
|
+
* Uses `#name` color token keys and state aliases (`''`, `'@media(prefers-color-scheme: dark)'`, etc.).
|
|
920
924
|
* Spread into component styles or register as a recipe via `configure({ recipes })`.
|
|
921
925
|
* @see https://tasty.style/docs
|
|
922
926
|
*/
|
|
@@ -1234,7 +1238,7 @@ interface GlazePalette {
|
|
|
1234
1238
|
tokens(options?: GlazeJsonOptions & GlazePaletteExportOptions): Record<string, Record<string, string>>;
|
|
1235
1239
|
/**
|
|
1236
1240
|
* Export all themes as tasty style-to-state bindings.
|
|
1237
|
-
* Uses `#name` color token keys and state aliases (`''`,
|
|
1241
|
+
* Uses `#name` color token keys and state aliases (`''`, `'@media(prefers-color-scheme: dark)'`, etc.).
|
|
1238
1242
|
* Prefix defaults to `true`. Inherits the palette-level `primary`.
|
|
1239
1243
|
* @see https://tasty.style/docs
|
|
1240
1244
|
*/
|
package/dist/index.mjs
CHANGED
|
@@ -688,8 +688,8 @@ function defaultConfig() {
|
|
|
688
688
|
},
|
|
689
689
|
darkDesaturation: .1,
|
|
690
690
|
states: {
|
|
691
|
-
dark: "@dark",
|
|
692
|
-
highContrast: "@
|
|
691
|
+
dark: "@media(prefers-color-scheme: dark)",
|
|
692
|
+
highContrast: "@media(prefers-contrast: more)"
|
|
693
693
|
},
|
|
694
694
|
modes: {
|
|
695
695
|
dark: true,
|