Re: [csswg-drafts] [css-shadow-parts] ::part(foo)::part(bar) instead of forwarding? (#3841)

Okay, so going with "only the subparts you explicitly choose to export show up, but you have to access them with nested ::part() selectors", that still exposes implementation details of the component in an unfortunate way.

When styling a component with custom properties, you have no way of knowing whether the things consuming the custom properties are going to be in the component itself, or in a sub-component that the component passes the property on along to (possibly with a rename (`--foo2: var(--foo1);`) to match the custom property that that subcomponent expects.

This is good: the component can implement some bit of functionality itself, or with a nested component; it can swap out components that expect different theming variables; etc. And all of this is invisible to the outermost user of the component, who only needs to care about the custom-property contract that the outer component lists and can keep stable between updates.

We'd like the same property to be true of ::part(); exposing the precise nesting structure (and names of sub-parts, which may be out of the control of the main component author) seems like an unfortunate regression in encapsulation of components.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3841#issuecomment-484970128 using your GitHub account

Received on Friday, 19 April 2019 17:51:56 UTC