Skip to content
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

Add CSS variables to ha-toast #20804

Draft
wants to merge 5 commits into
base: dev
Choose a base branch
from
Draft

Conversation

dhoeben
Copy link
Contributor

@dhoeben dhoeben commented May 16, 2024

Proposed change

Added two variables for styling ha-toast. One for the background and one for the text color. Unfortunatly, I'm not on a good enough laptop to check if code works. According to https://m2.material.io/components/snackbars/web#javascript-api these variables should work.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

theme.yaml:

theme:
  ha-toast-background-color: var(--ha-card-background-color)
  ha-toast-text-color: var(--primary-text-color)

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

Added two variables for styling ha-toast
Changed from material design variable to css style
Added css variables
Copy link
Contributor Author

@dhoeben dhoeben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Copy link
Contributor

@silamon silamon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for picking this up. 👍 You should add the css class to the ha-toast component instead of the notification-manager.
FYI: CI is also failing right now as you closed the class too early.

@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@home-assistant home-assistant bot marked this pull request as draft May 17, 2024 17:52
Copy link
Contributor Author

@dhoeben dhoeben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants