W3C home > Mailing lists > Public > public-css-archive@w3.org > November 2019

Re: [csswg-drafts] [css-scoping-1] Dynamic changes of state and attributes referenced by :host-context rules are pretty hard to handle efficiently. (#1914)

From: Dan Beam via GitHub <sysbot+gh@w3.org>
Date: Tue, 26 Nov 2019 20:32:00 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-558805357-1574800319-sysbot+gh@w3.org>
I agree with @rniwa on this specific matter -- `:host-context([dir=rtl])` means "any ancestor with dir == 'rtl' above, even if that's not the effective directionality[1]" (which is why `:dir` exists).  I get that it's better than nothing, but it's not bulletproof (and you can use a CSS var instead).

re: theming -- i think recent `@media (prefers-color-scheme: light/dark) {...}` is fine to embed inside of a component such that it adapts to system UI theme.  I think you're able to specify your own themes as well, but it generally reduces the generic nature of web components the more you make them aware of their housing/surroundings.  it's better to expose "parts" which can be styled externally, IMO.

[1] it'd be easy for a closer [dir="ltr"] ancestor to be ignored, as would be a `direction:` rule in CSS.

-- 
GitHub Notification of comment by danbeam
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1914#issuecomment-558805357 using your GitHub account
Received on Tuesday, 26 November 2019 20:32:02 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:56 UTC