Skip to content

feat(themes): add a theme entry point with theme() - #677

Open
simeonoff wants to merge 4 commits into
masterfrom
simeonoff/theme-entry-point
Open

simeonoff wants to merge 4 commits into
masterfrom
simeonoff/theme-entry-point

Conversation

@simeonoff

@simeonoff simeonoff commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Part of #651 (sections 1 to 4). Stacked on #676, which should merge first.

  • New entry point, igniteui-theming/sass/themes/theme. It forwards the root module, the presets and the schemas, and adds theme().
  • theme($palette, $schema, ...) declares the palette, the elevations (those of the schema's design system unless $elevations is passed), the spacing, the --ig-theme and --ig-theme-variant markers and the radius and elevation factors, in :root or in the enclosing selector. The first call in a compilation registers the size, spacing and progress properties at the root. $exclude takes core, palette, elevations and markers.
  • theme() alone is in igniteui-theming/sass/themes/global-theme, to compile a theme without the color presets, which cost about 300 ms per compilation.
  • spacing() takes $register, to leave out its property registration.

Checked against both products: the Web Components theme files built on the entry point are identical to today's except the hand-written scrollbar globals (IgniteUI/igniteui-webcomponents#2609), and the Angular presets with theme-internal() calling theme() are identical except the Indigo elevations, the fix from section 3.

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.

🟡 Changes recommended

Two theme-state bugs remain: disabling enhanced accessibility leaves color-blind brushes active, and nested themes cannot restore elevations disabled by a parent.

2 open issues
What changed in this PR

Adds a shared Sass theme() entry point to centralize global theme setup across products, building on the once-per-compilation registration support from #676.

Changes:

  • Adds a preset-inclusive entry point and a lightweight module exposing theme() alone.
  • Composes palette, schema-selected elevations, spacing, markers, and optional factors in root or scoped themes.
  • Adds registration control to spacing(), theme tests, and usage documentation.
File Description
README.md Documents global themes, scoped usage, and entry-point tradeoffs.
packages/​theming/​tests/​_theme.spec.scss Tests theme composition, exclusions, scoping, and property registration.
packages/​theming/​tests/​_index.scss Includes the new theme tests.
packages/​theming/​sass/​themes/​_theme.scss Forwards the root API, presets, schemas, and theme().
packages/​theming/​sass/​themes/​_mixins.scss Makes spacing property registration optional.
packages/​theming/​sass/​themes/​_global-theme.scss Implements shared global theme composition.

Review effort: Balanced

Base automatically changed from simeonoff/once-and-meta to master November 16, 2026 08:17
$elevation defaults to null and inherits the factor. true sets --ig-elevation-factor to 1 and false to 0. $enhanced-accessibility defaults to null, like configure-colors(), and its description says it's a compilation-wide switch.

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 block approval of the shared Sass theme entry point.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

@simeonoff
simeonoff requested a review from adrianptrv November 19, 2026 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants