@tenphi/glaze 0.9.1 → 0.9.3

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 CHANGED
@@ -776,9 +776,9 @@ palette.tokens({ prefix: { primary: 'p-', danger: 'd-' } });
776
776
 
777
777
  An error is thrown if the primary name doesn't match any theme in the palette.
778
778
 
779
- ### Tasty Export (for [Tasty](https://cube-ui-kit.vercel.app/?path=/docs/tasty-documentation--docs) style system)
779
+ ### Tasty Export (for [Tasty](https://tasty.style) style system)
780
780
 
781
- The `tasty()` method exports tokens in the [Tasty](https://cube-ui-kit.vercel.app/?path=/docs/tasty-documentation--docs) style-to-state binding format — `#name` color token keys with state aliases (`''`, `@dark`, etc.):
781
+ The `tasty()` method exports tokens in the [Tasty](https://tasty.style/docs) style-to-state binding format — `#name` color token keys with state aliases (`''`, `@dark`, etc.). See the [Playground](https://tasty.style/playground) for live examples of Glaze integration:
782
782
 
783
783
  ```ts
784
784
  const palette = glaze.palette(
@@ -1146,7 +1146,7 @@ brand.colors({ surface: { lightness: 97 }, text: { base: 'surface', lightness: '
1146
1146
  | `theme.extend(options)` | Create a child theme |
1147
1147
  | `theme.resolve()` | Resolve all colors |
1148
1148
  | `theme.tokens(options?)` | Export as flat token map grouped by variant |
1149
- | `theme.tasty(options?)` | Export as [Tasty](https://cube-ui-kit.vercel.app/?path=/docs/tasty-documentation--docs) style-to-state bindings |
1149
+ | `theme.tasty(options?)` | Export as [Tasty](https://tasty.style/docs) style-to-state bindings |
1150
1150
  | `theme.json(options?)` | Export as plain JSON |
1151
1151
  | `theme.css(options?)` | Export as CSS custom property declarations |
1152
1152
 
package/dist/index.cjs CHANGED
@@ -620,7 +620,7 @@ function coarseScan(h, s, lo, hi, yBase, target, epsilon, maxIter) {
620
620
  function findLightnessForContrast(options) {
621
621
  const { hue, saturation, preferredLightness, baseLinearRgb, contrast: contrastInput, lightnessRange = [0, 1], epsilon = 1e-4, maxIterations = 14 } = options;
622
622
  const target = resolveMinContrast(contrastInput);
623
- const searchTarget = target * 1.007;
623
+ const searchTarget = target * 1.01;
624
624
  const yBase = gamutClampedLuminance(baseLinearRgb);
625
625
  const crPref = contrastRatioFromLuminance(cachedLuminance(hue, saturation, preferredLightness), yBase);
626
626
  if (crPref >= searchTarget) return {
@@ -1415,10 +1415,14 @@ function createTheme(hue, saturation, initialColors) {
1415
1415
  };
1416
1416
  },
1417
1417
  extend(options) {
1418
- return createTheme(options.hue ?? hue, options.saturation ?? saturation, options.colors ? {
1419
- ...colorDefs,
1418
+ const newHue = options.hue ?? hue;
1419
+ const newSat = options.saturation ?? saturation;
1420
+ const inheritedColors = {};
1421
+ for (const [name, def] of Object.entries(colorDefs)) if (def.inherit !== false) inheritedColors[name] = def;
1422
+ return createTheme(newHue, newSat, options.colors ? {
1423
+ ...inheritedColors,
1420
1424
  ...options.colors
1421
- } : { ...colorDefs });
1425
+ } : { ...inheritedColors });
1422
1426
  },
1423
1427
  resolve() {
1424
1428
  return resolveAllColors(hue, saturation, colorDefs);