Skip to content

feat(web, web-react): extract color-scheme to helpers and update Pill#2565

Draft
crishpeen wants to merge 3 commits intorelease/v5-essencefrom
feat/color-scheme-package-split
Draft

feat(web, web-react): extract color-scheme to helpers and update Pill#2565
crishpeen wants to merge 3 commits intorelease/v5-essencefrom
feat/color-scheme-package-split

Conversation

@crishpeen
Copy link
Copy Markdown
Member

Description

This PR splits color-scheme concerns out of the generic utilities pipeline in @alma-oss/spirit-web, adds dedicated SCSS helpers and a component token override mixin, and aligns @alma-oss/spirit-web-react (Pill, Tag, IconBox) with getColorSchemeClassName / colorTokens. Design token documentation in design-tokens is updated to describe the new setup.

Packages: web (breaking), web-react, design-tokens (docs).

Additional context

  • Web (breaking): Color-scheme generation moved from settings/_utilities and tools/_utilities into helpers/color-scheme and related tooling; consumers that depended on utilities-only builds for .color-scheme-on-* must import the color-scheme helper entry or the updated bundle.
  • React: Renamed/refactored color token utilities (colorObjectGeneratorscolorTokens), added tests and provider coverage for color-scheme props.
  • Reviewers: confirm SCSS public surface and changelog wording for the breaking release notes.

Issue reference

Link the Jira ticket when available (e.g. https://jira.almacareer.tech/browse/DS-XXXX).

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 31, 2026

Deploy Preview for spirit-design-system-storybook ready!

Name Link
🔨 Latest commit 32ae40f
🔍 Latest deploy log https://app.netlify.com/projects/spirit-design-system-storybook/deploys/69cc2d1eeb3eba000868d94d
😎 Deploy Preview https://deploy-preview-2565--spirit-design-system-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 31, 2026

Deploy Preview for spirit-design-system ready!

Name Link
🔨 Latest commit 32ae40f
🔍 Latest deploy log https://app.netlify.com/projects/spirit-design-system/deploys/69cc2d1e6b75370008191b0e
😎 Deploy Preview https://deploy-preview-2565--spirit-design-system.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions bot added the feature New feature or request label Mar 31, 2026
BREAKING CHANGE: Remove color-scheme from the utilities settings and move generation to
helpers/color-scheme. Consumers must import the color-scheme helper entry (or the updated
main bundle) instead of relying on utilities-only builds for color-scheme classes. Pill and
ControlButton use the new component token override mixin.
@crishpeen crishpeen force-pushed the feat/color-scheme-package-split branch from 73604be to 32ae40f Compare March 31, 2026 20:22
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review: feat/color-scheme-package-split

Scope: 3 commits, 33 files (+812 / −266)

What this branch does

  1. Moves color-scheme utility generation from the utilities map into a dedicated SCSS helper (helpers/color-scheme) that emits .color-scheme-on-* classes setting --spirit-local-background-color and --spirit-local-color only (no !important on longhands in the helper path).
  2. Introduces component-color-overrides to discover component-* tokens and emit high-specificity modifier overrides; updates Pill to consume local-* variables and documents optional component token overrides in design-tokens README.
  3. Adds React utilities (colorTokens, getColorSchemeClassName), wires Pill with isSubtle and matching color-scheme classes, refactors Tag / IconBox to createScopedColorTokenName, and expands unit/provider tests.

Summary

Dimension Notes
Security No concerns in the diff.
Bugs / behavior Pill now defaults isSubtle to false and always applies a color-scheme class; documented for vanilla HTML.
Tests Good coverage for new helpers, Pill, and SCSS (sass-true).
Docs / DX One small wording fix suggested in Pill README (see inline).

Verdict: APPROVE — No blocking findings; a few non-blocking suggestions and one scope question below.

praise

Solid split between helpers and utilities, shared token naming between TS and SCSS, thorough tests (including sass-true for the new mixins), and clear docs for consumers who must add color-scheme-on-* in plain HTML. The component-color-overrides approach scales better than hand-maintained dictionaries for optional tokens.

Open in Web View Automation 

Sent by Cursor Automation: Spirit Cursor Code Review

<span class="Pill Pill--danger color-scheme-on-emotion-danger-basic">3</span>
```

ℹ️ Even thought the `Pill--<color>` modifier is not used by default, it can be used to override the color scheme when needed. See [Default Color Overrides](#default-color-overrides) for more information.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (non-blocking): Fix the typo “Even thought” → “Even though” so the sentence reads naturally.

Fix: Replace the phrase on this line.

Why: Readers may trip on the grammar; it is a quick doc polish.

generate-custom-properties: false,
values: (
block,
contents,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question (non-blocking): Was adding contents to the display utility map intentional for this change, or did it ride along from another task?

Why: It is unrelated to the color-scheme / Pill work; if accidental, consider moving it to a separate commit or noting it in the PR description for changelog clarity.

Comment on lines 39 to +40
&:is(:disabled, .is-disabled, .ControlButton--disabled) {
// TODO This is not ideal, check with señor Adam how to handle this.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (non-blocking, if-minor): Consider replacing or tightening the informal TODO / “señor Adam” notes before merge, or tracking them in an issue linked from the PR so the codebase does not accumulate ambiguous follow-ups.

Fix: Either resolve the specificity/background questions in this PR if the design is settled, or shorten to a neutral TODO(#issue): … with a ticket.

Why: Future readers may not have context; linked issues keep intent clear without blocking the feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant