Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: e069ede The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📦 NPM canary releaseDeployed canary version 0.0.0-canary-e2a9f35. |
🧪 Storybook is successfully deployed!
|
🏋️ Size limit report
Click here if you want to find out what is changed in this build |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 4 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| // In dark+auto mode, flip the contrast sign | ||
| if (isDark && mode === 'auto') { | ||
| contrast = -contrast; | ||
| } |
There was a problem hiding this comment.
Dark mode dependent colors broken without minContrast
High Severity
Dependent colors using auto mode (default) without minContrast produce incorrect lightness in dark scheme. The contrast sign flip causes colors to move in the wrong direction. For example, a text color with contrast: 52 from a light surface (97→12.4 in dark) becomes pure black (0) instead of lighter (~65) for readable contrast. This only affects colors without minContrast since the solver corrects it when specified.
| */ | ||
| export function formatOkhsl(h: number, s: number, l: number): string { | ||
| return `okhsl(${h.toFixed(1)} ${s.toFixed(1)}% ${l.toFixed(1)}%)`; | ||
| } |
There was a problem hiding this comment.
OKHSL conversion algorithm duplicated across files
Low Severity
The OKHSL color conversion algorithm is duplicated between okhsl-to-rgb.ts and okhsl-color-math.ts. While they have different output formats (gamma-encoded vs linear RGB), the core pipeline including computeMaxSaturationOKLC, findCuspOKLCH, findGamutIntersectionOKLCH, and related functions are identical. This increases maintenance burden - bugs in the algorithm need fixing in two places.
| return Math.max(1, value); | ||
| } | ||
| return CONTRAST_PRESETS[value]; | ||
| } |
There was a problem hiding this comment.
Missing validation for minContrast preset strings
Medium Severity
The resolveMinContrast function returns CONTRAST_PRESETS[value] without validating that value is a valid preset key. When theme configs are loaded from JSON or used without TypeScript, an invalid preset string (like 'AA-Large' with wrong capitalization) returns undefined, which propagates as NaN through contrast calculations, silently breaking color output instead of failing with a clear error.
|
|
||
| function pairHC<T>(p: HCPair<T>): T { | ||
| return Array.isArray(p) ? p[1] : p; | ||
| } |
There was a problem hiding this comment.
Missing validation for HCPair array length
Medium Severity
The pairHC function accesses array index [1] without validating that HCPair arrays contain exactly two elements. When theme configs are loaded from JSON or used without TypeScript, a single-element array like { l: [97] } returns undefined for the high-contrast value, propagating as NaN through color calculations and silently producing invalid output.


Note
Medium Risk
Introduces a sizable new color-generation surface area with non-trivial contrast/math algorithms and new package exports, which could affect consumers via API usage and bundling/typing entrypoints despite being additive.
Overview
Adds new
glazetheming API to generate OKHSL-based light/dark/high-contrast palettes from seed hue/saturation, including dependent colors with explicitminContrast(WCAG AA/AAA presets or numeric) enforcement.Introduces a contrast solver (with caching) and OKHSL color-math utilities, plus a theme/palette API supporting
.colors(),.extend(),.resolve(), and exports to tasty token maps/JSON with configurable state aliases and per-call/global output modes.Exposes the new entrypoint via
src/tasty/index.tsand a tree-shakeable@cube-dev/ui-kit/tasty/glazeexport (packageexports), with comprehensive unit tests and a changeset for a minor version bump.Written by Cursor Bugbot for commit e069ede. This will update automatically on new commits. Configure here.