Re: [w3c/webcomponents] Theming options for shadow roots (#864)

@dflorey 

> Why would you prefer that only publicly exposed pieces can be overwritten?
> What if a designer wants to adjust pieces of a component that have not been exposed?

Let's clarify that there are lots of different relationships between component authors and component users where encapsulation concerns are different.

In the open-source world - with independent releases and strict semver - it's tempting to say that users should be able to style anything, and if authors change their DOM that it's a breaking, semver-major change. This might be somewhat true, but even in this case many authors will not want to have to release a new major version because of some DOM change that should have been private.

Within a single application, it's also tempting to say that the user and author are the same party and encapsulation is only a hinderance. This is also sometimes true, but experience from large applications and teams shows that this doesn't scale. Encapsulation is necessary to avoid an overly fragile codebase that's difficult to change.

And at many large companies these days that use a mono repo, encapsulation is even more important. Without releases and versions, any change to a component is a simultaneous to all uses of the component. If users style private details of a component and the component definition changes, then the component author has just unwittingly just broken the user, and often cannot make that change because of tests. This means that users of a component can put unbounded costs on authors and effectively freeze development.

Shadow DOM absolutely solves a lot of these problems, and we don't want to eliminate that when addinging theming support. There is a spectrum of use cases, from solo developers to single teams to large orgs, and any solution needs to be usable in these different cases, possibly by dialing back encapsulation. I strongly believe that the author of the component needs to be in control of the level of encapsulation so that they can offer a limited (or not I guess) public interface that they can actually support and maintain.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/864#issuecomment-591549914

Received on Wednesday, 26 February 2020 17:37:40 UTC