home-assistant / ui-schema

A schema to define a user interface for Home Assistant.
Apache License 2.0
41 stars 6 forks source link

Update Themes and Theme's Scope or properties #195

Closed ghost closed 5 years ago

ghost commented 5 years ago

@marcpabst commented on Nov 23, 2018, 8:13 AM UTC:

Currently it's not possible to use CSS ot themes to set border-radius and some other properties of ha-card because encapsulation of web components works petty well in modern browsers and those properties don't use CSS custom properties as of now.

I'm therefore proposing to add a number of properties to ha-card.js and ha-style.js:

–card-border-radius
–card-margin
–card-border-width
–card-border-color
–card-border-style

This would not break anything because if not set, then the properties would just resort to default values. If you agree I would be happy to make a PR.

This issue was moved by iantrich from home-assistant/home-assistant-polymer#2086.

thomasloven commented 5 years ago

If we wish to do this - which I'm not sure we do - I think it would be better to have a --card-styleor something that's added to the card css with @apply --card-style. That way we won't need to worry about which properties to support.

marcpabst commented 5 years ago

If that's the method of choice, we should think about adding -XXX-style properties to every built-in element for consistency. This would also enable theme authors to do a lot more than currently possible. They could still opt for the standard properties but also use completely custom styles for everything.

zsarnett commented 5 years ago

I am not sure if @balloob wants this kind of freedom in the Theming

iantrich commented 5 years ago

Maintaining support for that is my main concern.

marcpabst commented 5 years ago

I am not sure if @balloob wants this kind of freedom in the Theming

Isn't that the idea behind an open system like HASS? Sure, I can write hacky JS workaround (which I did) but that's not really a good solution. Why not give users the ability to customize the hell out of their frontends if they wish so?

marcpabst commented 5 years ago

Maintaining support for that is my main concern.

Maintaining support for what?

zsarnett commented 5 years ago

No the idea is that there is a way to do everything not that we give you a way to do everything. Open doesnt mean we make every feature suggested. And Support is the problem, the more freedom we give less techy users the more questions we get

marcpabst commented 5 years ago

No the idea is that there is a way to do everything not that we give you a way to do everything.

That's basically the same thing. At least from a user's perspective. Sure, technically there is already a way: I could just go and fork the whole thing. But then I would have to maintain the whole thing too.

Open doesnt mean we make every feature suggested.

Sure, after all it's the maintainers choice which ideas to agree on and which not. I'm just arguing the case that there is no reason to not give users power over the frontend in a more convenient way.

And Support is the problem, the more freedom we give less techy users the more questions we get

I don't really see the problem here - there is already theming. This wouldn't introduce anything new but rather extend existing functionality. It doesn't even change existing functionality.

balloob commented 5 years ago

Isn't that the idea behind an open system like HASS?

Just because we're open source doesn't mean that we go in every direction that any random user on the internet suggests we take.

Until our current officially theming supported variables have been defined and cleaned up, we are not going to expose any new theming variables.

marcpabst commented 5 years ago

Thanks for your answer. I wasn't implying that you should follow any random idea that some suggest and I'm sorry if that's what it sounded like.

The point I tried to make was that if you decide a feature like theming, there is no reason to restrict what people can do with it - especially if you're trying to make an open system (and not just open source) that encourages users to customize it to their own needs. There are many systems like HASS and some of them even offer more or less the same functionality. HASS might have a number of benefits over them but one of biggest (at least in my opinion) advantages is that I can customize almost everything without forking it or messing with the internal structure.

However, I do understand that you don't want to change the theming support until there is a clear plan on how it should look.

jeremiecook commented 5 years ago

Hi and thanks for all these answers.

As far as I love the Hass project and the incredible work you've done, I don't really understand the value for Hass in preventing users from styling and customizing their interface.

Some UX/UI designers may be glad to experiment, share and help :)

ghost commented 5 years ago

This issue was moved by iantrich to home-assistant/home-assistant-polymer#3929.