-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update core icons to support new theming system #4993
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
and refactor themed icons to a single mixin
…ark class name as well
Demo starting at https://vanilla-framework-4993.demos.haus |
bartaz
changed the title
WIP: Update core icons to support new theming system
Update core icons to support new theming system
Feb 14, 2024
chillkang
approved these changes
Feb 14, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM👍 This is incredible Bartek!
chillkang
added
Review: QA +1
Review: Code +1
and removed
Review: QA needed
Review: Code needed
labels
Feb 14, 2024
Cool stuff! The flagging with whitespace usage is very interesting |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
Done
Updates the icons to use new CSS variables for theming.
Involved a bit of refactoring, so that both previous way of including icon mixins works and the new themed icons.
So currently icons have 2 mixins each:
@vf-icon-NAME($color)
- that is deprecated and backwards compatible way of including an icon with an option to change its colour.@vf-icon-NAME-themed
- that is a new recommended way to include icon, that will use the icon colour defined by current theme (via CSS variables).This PR also updates icon colours, to use default text colour in each theme, so black in light themes, and white in dark theme.
We also introduce
--vf-is-light-theme
and--vf-is-dark-theme
CSS variables that are used by icon mixins to conditionally switch to correct version. This is based on a "var space hack" solution explained in this blog post: https://lea.verou.me/blog/2020/10/the-var-space-hack-to-toggle-multiple-values-with-one-custom-property/NOTE New theming is only applied to standard set of Vanilla icons that are directly included in Vanilla. It doesn't cover all individual icons in the "additional" set.
Fixes WD-8624
QA
is-light
oris-paper
, check if icons adjust accordinglyCheck if PR is ready for release
If this PR contains Vanilla SCSS code changes, it should contain the following changes to make sure it's ready for the release:
Feature 🎁
,Breaking Change 💣
,Bug 🐛
,Documentation 📝
,Maintenance 🔨
.package.json
should be updated relative to the most recent release, following semver convention:Screenshots