-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
feat(switch): add feature targeting for styles #4275
Merged
kfranqueiro
merged 7 commits into
material-components:master
from
crisbeto:switch-targeting
Feb 1, 2019
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
b8d79f3
feat(switch): add feature targeting for styles
crisbeto b937c42
refactor: address feedback
crisbeto 5f6ad5f
refactor: apply latest style API changes
crisbeto 92d05f9
WIP Fix lint
kfranqueiro ef39443
WIP Add baseline switch mixin to test
kfranqueiro ebb33ba
WIP Move radius-unbounded above states
kfranqueiro acdb82b
Merge branch 'master' into switch-targeting
kfranqueiro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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.
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.
@kfranqueiro should we add feature targeting to only the main public mixin, or these ones too? (If we are adding it here too, we should add these mixins to the test that verifies nothing is emitted for empty query, I think it would fail currently)
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.
That's a good point, this mixin is not invoked by the base styles, so we don't necessarily need to cover it, if the goal is specifically to add feature targeting to the base emitted styles. If you're fine with that, then I think we can omit
$query
frommdc-switch-toggled-on-color
andmdc-switch-toggled-off-color
.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.
I could also see doing it, just for the sake of consistency on public mixins. If we always do it then people don't have to think about whether this is one of the ones that supports it.
Also for things like disabling animations, you probably do want to have the ability to exclude the
animation
feature from all mixins, not just the base one.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.
If we're parameterizing
$query
here, then I think we need to enclose the first 2 mixin invocations within a color feature-targets block (same formdc-switch-toggled-off-color
), and invoke these intest/scss/feature-targeting.scss
as Miles suggested.