W3C home > Mailing lists > Public > public-css-archive@w3.org > December 2018

Re: [csswg-drafts] [css-shadow-parts-1] Can class name selectors apply to a part? (#3431)

From: Jan Miksovsky via GitHub <sysbot+gh@w3.org>
Date: Wed, 12 Dec 2018 00:06:52 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-446411162-1544573211-sysbot+gh@w3.org>
@tabatkins Thanks for your thoughts! We care less about the precise mechanism and more about the scenario.

My initial thought is that your multiple-parts solution would probably be sufficient to support styling our tabs component and a number of similar components.

I do wonder if we'll hit cases where part state is more complex than a binary value, or multiple state values are in place. Another approach would give the author a way to expose only those part aspects that should be considered available for styling purposes. Using attributes as an example, something like

  <tab-button part="tab-button" part-attributes="selected" selected>Tab 1</tab-button>

might explicitly open up the component-specific `selected` attribute for styling:

my-tabs-component::part(tab-button)[selected] { ... }

We'll continue exploring the application of shadow parts to our library and look for cases were the current spec appears to be insufficient.

GitHub Notification of comment by JanMiksovsky
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3431#issuecomment-446411162 using your GitHub account
Received on Wednesday, 12 December 2018 00:06:54 UTC

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