Skip to content

fix(tools): use correct CSS_VARIABLES_TARGET in auto theme selector - #14136

Open
ilhan007 wants to merge 2 commits into
mainfrom
fix-auto-themes-for-root-parameters
Open

ilhan007 wants to merge 2 commits into
mainfrom
fix-auto-themes-for-root-parameters

Conversation

@ilhan007

@ilhan007 ilhan007 commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • generateAutoThemes was hardcoding :host for all non-theming packages
  • Consumer libraries (e.g. rich-text-editor) that don't set cssVariablesTarget default to "root" and need :root in their auto theme CSS
  • Fixed by reading the CSS_VARIABLES_TARGET boolean (already set per-package by nps.js from options.cssVariablesTarget ?? "root") to pick the correct selector

Selector logic after fix

Package cssVariablesTarget selector
theming n/a :root
main / fiori "host" :host
consumer (no flag set) "root" (default) :root

Test plan

  • Build @ui5/webcomponents (main) — auto theme CSS should use :host
  • Build a consumer library without cssVariablesTarget — auto theme CSS should use :root

ilhan007 and others added 2 commits October 9, 2026 16:15
The generateAutoThemes function was hardcoding :host for all
non-theming packages. Consumer libraries that don't set
cssVariablesTarget (defaulting to "root") need :root instead.

Read the CSS_VARIABLES_TARGET env var (already set per-package by
nps.js from options.cssVariablesTarget) to pick the correct selector.
@ilhan007
ilhan007 requested a review from nnaydenow October 9, 2026 13:16

This branch has not been deployed

No deployments
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.

1 participant