Skip to content

Switch paper-toggle-button to mwc-switch#3683

Merged
bramkragten merged 6 commits into
home-assistant:devfrom
iantrich:mwc-switch
Sep 21, 2019
Merged

Switch paper-toggle-button to mwc-switch#3683
bramkragten merged 6 commits into
home-assistant:devfrom
iantrich:mwc-switch

Conversation

@iantrich
Copy link
Copy Markdown
Member

Closes #3352

Could use some help with this one. When checked the toggle is styled with --mdc-theme-secondary which we already have set to accent color.

@iantrich iantrich self-assigned this Sep 11, 2019
@bramkragten
Copy link
Copy Markdown
Member

Check ha-checkbox, we override the variable so for that element —mdc-theme-secondary is primary-color

@iantrich
Copy link
Copy Markdown
Member Author

Of course! I'll make a ha-switch. Thanks.

@bramkragten
Copy link
Copy Markdown
Member

Why does mwc-switch have a slot and mwc-checkbox not 😕

@balloob
Copy link
Copy Markdown
Member

balloob commented Sep 11, 2019

File a bug with mwc!

@iantrich
Copy link
Copy Markdown
Member Author

Not able to figure out how to style the switch when it is unchecked. Anyone mind checking here: https://deploy-preview-3683--home-assistant-demo.netlify.com/

@bramkragten
Copy link
Copy Markdown
Member

I checked the styling for mwc and all I can say is that it is a nightmare... They compile SASS with vars and functions, so it is hardcoded in their css, so a lot of styling can't be done with css vars... So we would have to create our own css if we want to use mwc and themes.

@iantrich
Copy link
Copy Markdown
Member Author

Thanks @bramkragten that looks to work well

@gerardo15
Copy link
Copy Markdown

gerardo15 commented Sep 18, 2019

@iantrich Just tested it on my setup! works great.

Comment thread src/dialogs/config-entry-system-options/dialog-config-entry-system-options.ts Outdated
Comment thread src/panels/config/cloud/alexa/cloud-alexa.ts Outdated
Comment thread src/panels/config/cloud/google-assistant/cloud-google-assistant.ts Outdated
Comment thread src/panels/config/cloud/google-assistant/cloud-google-assistant.ts Outdated
Comment thread src/panels/config/entity_registry/dialog-entity-registry-detail.ts Outdated
Comment thread src/panels/profile/ha-force-narrow-row.ts Outdated
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prevent click propagation on scroll

5 participants