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

Issue with our guidance of use of custom properties #8

Open
torgo opened this issue Oct 15, 2020 · 7 comments
Open

Issue with our guidance of use of custom properties #8

torgo opened this issue Oct 15, 2020 · 7 comments

Comments

@torgo
Copy link
Member

torgo commented Oct 15, 2020

From https://twitter.com/LeaVerou/status/1316353717688557571 from @LeaVerou:

The @w3ctag advice is to use custom properties over attributes for presentation.

Unfortunately, custom elements can neither listen to changes on CSS properties, nor use them to toggle rules, making this impossible for high level styling.

Proposal: https://discourse.wicg.io/t/observe-current-computed-style-changes-styleobserver/4879

@LeaVerou
Copy link
Member

Thank you Daniel for raising this. FWIW, I see this as an issue with custom properties, not an issue with the guidance. The guidance is very sound and correct, we just need to make sure the platform can support it.

@torgo
Copy link
Member Author

torgo commented Oct 15, 2020

Ok thanks for the clarification Lea – I mostly wanted to create an issue so we could have an anchor to discuss at the future TAG meting call. Do you think we should make a note in the document to reflect the issue?

@LeaVerou
Copy link
Member

This issue is also relevant: WICG/webcomponents#856
I opened this in csswg, in case we can solve it from CSS: w3c/csswg-drafts#5624

Do you think we should make a note in the document to reflect the issue?

Yes.

@LeaVerou
Copy link
Member

Ok thanks for the clarification Lea – I mostly wanted to create an issue so we could have an anchor to discuss at the future TAG meeting call.

Now that I'm here, I'm wondering if we could pick this up in a breakout soon, or the F2F? I want to make sure this guidance can be followed by authors, otherwise we are setting them up for failure.

@alice
Copy link

alice commented Jan 27, 2021

https://www.w3.org/2001/tag/doc/webcomponents-design-guidelines/

"Don’t use custom attributes for styling, like bgcolor. Instead use Custom Properties or CSS Shadow Parts."

@LeaVerou
Copy link
Member

Note that container queries allow for style queries too, so this guidance may be possible to follow in the near future (or at least more feasible for more cases).

@torgo torgo transferred this issue from w3ctag/design-principles Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants