Skip to content

feat(themes): add once() and store the design system as theme in palette and type scale meta - #676

Merged
simeonoff merged 1 commit into
masterfrom
simeonoff/once-and-meta
Nov 16, 2026
Merged

simeonoff merged 1 commit into
masterfrom
simeonoff/once-and-meta

Conversation

@simeonoff

Copy link
Copy Markdown
Member

Part of #651 (sections 2, 4 and 6).

  • once($key) emits its content once per compilation and key, at the document root. sizing() and spacing() use it, so calling them again no longer repeats their @property rules.
  • palette() takes $theme, and the palette and type scale _meta store theme. variant still holds the design system, so existing readers keep working. A design system passed as $variant moves to $theme, with a deprecation warning.

The compiled output doesn't change: the theming build and all Ignite UI for Angular (135) and Web Components (776) stylesheets are byte-identical to master.

@simeonoff
simeonoff requested review from adrianptrv and a balanced review from Copilot November 13, 2026 13:05
@simeonoff simeonoff assigned simeonoff and adrianptrv and unassigned simeonoff Nov 13, 2026
@simeonoff simeonoff added 🪛 enhancement New feature or request Refactoring labels Nov 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the shared Sass utilities and theme metadata changes.

No open issues 🎉

What changed in this PR

This PR adds shared Sass utilities and theme metadata in preparation for the unified theming API described in #651.

Changes:

  • Adds once() and a test reset helper; sizing and spacing use it to avoid duplicate root-level property registrations.
  • Adds theme metadata to palettes and type scales, preserves legacy design-system metadata, and deprecates passing design systems through $variant.
  • Updates presets and tests for metadata compatibility, deduplication, and nested-scope behavior.
File Description
packages/​theming/​tests/​_utils.spec.scss Tests keyed emission, root placement, and reset behavior.
packages/​theming/​tests/​_typography.spec.scss Tests theme metadata in generated and preset type scales.
packages/​theming/​tests/​_themes.spec.scss Tests sizing and spacing registration deduplication.
packages/​theming/​tests/​_color.spec.scss Tests palette metadata and legacy argument compatibility.
packages/​theming/​sass/​utils/​_meta.scss Adds once() and its test reset helper.
packages/​theming/​sass/​typography/​_functions.scss Adds theme metadata while retaining variant.
packages/​theming/​sass/​themes/​_mixins.scss Registers sizing and spacing properties once per compilation.
packages/​theming/​sass/​color/​presets/​light/​_material.scss Passes the design system through $theme.
packages/​theming/​sass/​color/​presets/​light/​_indigo.scss Adds explicit theme metadata.
packages/​theming/​sass/​color/​presets/​light/​_fluent.scss Migrates Fluent, Word, and Excel palettes to $theme.
packages/​theming/​sass/​color/​presets/​light/​_bootstrap.scss Passes the design system through $theme.
packages/​theming/​sass/​color/​presets/​dark/​_material.scss Passes the design system through $theme.
packages/​theming/​sass/​color/​presets/​dark/​_indigo.scss Adds explicit theme metadata.
packages/​theming/​sass/​color/​presets/​dark/​_fluent.scss Migrates Fluent, Word, and Excel palettes to $theme.
packages/​theming/​sass/​color/​presets/​dark/​_bootstrap.scss Passes the design system through $theme.
packages/​theming/​sass/​color/​_types.scss Adds theme to the palette metadata shape.
packages/​theming/​sass/​color/​_functions.scss Adds $theme and handles deprecated design-system variants.

Review effort: Balanced

@simeonoff
simeonoff added this pull request to the merge queue Nov 16, 2026
Merged via the queue into master with commit c8c3791 Nov 16, 2026
6 checks passed
@simeonoff
simeonoff deleted the simeonoff/once-and-meta branch November 16, 2026 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Refactoring 🪛 enhancement New feature or request ✅ status: verified Applies to PRs that have passed manual verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants