-
Notifications
You must be signed in to change notification settings - Fork 374
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
[exportparts] support exporting via wildcards exportparts="*, primary-*"
#1051
Comments
Supporting wildcards like this would be a massive help, but there's still an extremely large styling API to document, and that's pretty undesirable. Here is an alternative idea, although I'm not sure if this is supportable in CSS:
|
i agree that a declarative api is somewhat limited if you need to pass through a lot of things @sorvell i wildcard would realy help there |
This is effectively a dupe of an older proposal in the CSSWG repo w3c/csswg-drafts#3422 ^_^ The idea there exactly matches @sorvell's idea - you can do |
@tabatkins does that mean it would be useful to bring this back up at a CSSWG session for resolution? |
More useful than discussing it in this venue, yes, as the editors of the spec in question (me) aren't actively watching this repo. |
@tabatkins thanks for the clarity? How can we get w3c/csswg-drafts#3422 |
Currently,
exportparts
requires explicitly exporting individual parts. This requirement is extremely cumbersome in practice when many parts are used and/or multiple levels of shadow roots wish to re-export parts since the attribute size grows exponentially.It is a common case that a element wants to re-export the set of parts provided by an element it uses. Often it wants to do this both as a pass-through and for that specific usage. This would be simple via a wildcard syntax like this:
Instead this must be done manually and it's so impractical that it is simply not done in practice.
Consider a theme picker dialog that wants to export parts for each of its color pickers, and each of these wants to export parts for each of its range controls:
The range control provides parts for
thumb
,track
,indicator
. These are just parts and don't need to be exported.The color picker uses 3 of these controls and wants to export these parts as-is and also for each color channel it uses
r
,g
,b
. It needs to export:Then the theme element needs to export for each picker, and there might be a lot of them,
primary
,secondary
,tertiary
, ...:Now if the theme theme selector, is used inside a theme dialog, it needs to export:
In practice, this 2500+ character attribute would likely be much longer as there would likely be many more theme colors.
There's probably a mistake in that. Hopefully, it's clear that this reasonable use case is nigh impossible.
If it were possible to export with a wildcard, this would simply become:
The text was updated successfully, but these errors were encountered: