TilmanGriesel / graphite

🌿 Calm and clean dark theme for Home Assistant
MIT License
108 stars 6 forks source link

Variable in configuration file for primary color #37

Closed nitras closed 1 week ago

nitras commented 1 week ago

Hi there,

Thanks so much for developing this theme! I'm really enjoying it.

I was wondering if it's possible to add an option that lets a variable in the configuration.yaml override the theme's primary color? I’ve set my own color, but it’s a bit tedious to update it whenever the theme gets updated.

I know it’s not a huge issue, but it would be a nice quality-of-life improvement.

TilmanGriesel commented 1 week ago

Hi @nitras,

I'm glad you're enjoying Graphite! The idea of a user configurable primary theme color is fantastic. While there's no straightforward way to implement user defined colors similar to the HA default theme to my knowledge, your suggestion got me thinking.

I came up with a solution that leverages Graphite's token abstraction and a simple patch script. After testing it this morning, I'm happy to say it works seamlessly! The process involves scanning the theme files and replacing the primary color tokens with a value provided by the user via a script. It's an easy and relatively elegant approach.

I'll be sharing an theme update later today with this custom feature for you and anyone else interested. Thanks again for suggesting this!

TilmanGriesel commented 1 week ago

@nitras You might want to check out the new theme patcher tool! It streamlines updates, making them less of a chore while letting you keep your custom primary color 🛠️ https://github.com/TilmanGriesel/graphite/tree/main/extras/theme-patcher

nitras commented 1 week ago

Hi @nitras,

I'm glad you're enjoying Graphite! The idea of a user configurable primary theme color is fantastic. While there's no straightforward way to implement user defined colors similar to the HA default theme to my knowledge, your suggestion got me thinking.

I came up with a solution that leverages Graphite's token abstraction and a simple patch script. After testing it this morning, I'm happy to say it works seamlessly! The process involves scanning the theme files and replacing the primary color tokens with a value provided by the user via a script. It's an easy and relatively elegant approach.

I'll be sharing an theme update later today with this custom feature for you and anyone else interested. Thanks again for suggesting this!

Thank you so much! It works perfectly. I really appreciate you seeing the value in this—sometimes I tend to overthink these things.

TilmanGriesel commented 1 week ago

Great to hear it's working well for you! I'm always up for a challenge if it means making the theme more user-friendly. I also believe that many themes tend to be overly imposing. While this can be great when everything works perfectly and matches the taste, it often makes things less accessible for others. I'm really glad we have such a supportive community here at Home Assistant that values helping one another. It would also mean a lot if you could leave a star since the HACS ranking is based on it 😊

nitras commented 1 week ago

Great to hear it's working well for you! I'm always up for a challenge if it means making the theme more user-friendly. I also believe that many themes tend to be overly imposing. While this can be great when everything works perfectly and matches the taste, it often makes things less accessible for others. I'm really glad we have such a supportive community here at Home Assistant that values helping one another. It would also mean a lot if you could leave a star since the HACS ranking is based on it 😊

Absolutely ;) Happy to be the 87th star. Thanks!