Skip to content

feat(mixins): add theme-markers mixin - #668

Merged
simeonoff merged 1 commit into
masterfrom
apetrov/theme-markers-mixin
Nov 9, 2026
Merged

simeonoff merged 1 commit into
masterfrom
apetrov/theme-markers-mixin

Conversation

@adrianptrv

@adrianptrv adrianptrv commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Closes: #616

  • Added a new theme-markers($theme, $variant) mixin. It declares --ig-theme and --ig-theme-variant only where it's included.
  • css-vars-from-theme() no longer emits the markers. It now emits only the component's variables, so code that calls it directly, such as the Web Components sheets and the Angular scrollbar, no longer gets them.
  • tokens() includes theme-markers() in scoped mode, so its output is unchanged: scoped mode still declares the markers and global mode still doesn't. The Tailwind utilities include it too, so their output is unchanged as well.

@adrianptrv
adrianptrv requested a review from simeonoff November 9, 2026 08:29
@adrianptrv adrianptrv added 🪛 enhancement New feature or request themes labels Nov 9, 2026
@adrianptrv
adrianptrv marked this pull request as ready for review November 9, 2026 09:20
Copilot AI balanced review requested due to automatic review settings November 9, 2026 09:20

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 change separating theme markers from component CSS variables.

No open issues 🎉

What changed in this PR

Separates theme-marker declarations from component CSS variables, allowing direct callers to avoid redundant markers while preserving scoped tokens() and Tailwind utility output.

Changes:

  • Adds the public theme-markers($theme, $variant) mixin.
  • Removes marker emission from css-vars-from-theme() and adds explicit calls where existing output must be preserved.
  • Updates tests for marker-free component variables and explicit marker emission.
File Description
packages/​theming/​tests/​_themes.spec.scss Updates expected output and adds theme-marker tests.
packages/​theming/​sass/​themes/​_mixins.scss Extracts marker emission into a public mixin and integrates it with scoped tokens.
packages/​theming/​sass/​tailwind/​_mixins.scss Explicitly emits markers to preserve utility output.

Review effort: Balanced

@simeonoff
simeonoff added this pull request to the merge queue Nov 9, 2026
Merged via the queue into master with commit 6de8fcc Nov 9, 2026
5 checks passed
@simeonoff
simeonoff deleted the apetrov/theme-markers-mixin branch November 9, 2026 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🪛 enhancement New feature or request themes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

css-vars-from-theme(): add an option to skip the --ig-theme and --ig-theme-variant markers

3 participants