feat(app-bar): remove default auto-theming in favor of scoped CSS variables and theme attribute #894
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Checklist
Please check if your PR fulfills the following requirements:
Describe the new behavior?
This change adds a new
theme-mode="scoped"
API that allows developers to opt-out of the built-in global theme token overrides that are applied to the<forge-app-bar>
in favor of two new tokens designed specifically for targeting certain child elements within an app bar:--forge-app-bar-theme-foreground
--forge-app-bar-theme-foreground-muted
These two new tokens will not apply to any elements by default, but I have also added a new opt-in
theme="app-bar"
attribute to the following components that will inherit these new tokens when rendered within an app-bar:<forge-button>
<forge-icon-button>
<forge-tab-bar>
The following convenience components automatically apply the
theme="app-bar"
to their internal<forge-icon-button>
elements for you (developers should see no change when using these components):<forge-app-bar-menu-button>
<forge-app-bar-profile-button>
<forge-app-bar-help-button>
<forge-app-bar-notification-button>
An example of the problem that this component was facing in regards to auto-theming is demonstrated here:
https://stackblitz.com/edit/forge-v3-app-bar-theming-problem-demo?file=src%2Fcustom-app-bar-component.ts,src%2Fmain.ts