- From: Wii <notifications@github.com>
- Date: Tue, 19 Mar 2024 14:01:24 -0700
- To: WICG/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <WICG/webcomponents/issues/1052/2008126332@github.com>
@robglidden > It seems to be getting missed that modern browsers support "[Declarative Shadow DOM](https://developer.chrome.com/docs/css-ui/declarative-shadow-dom)". Declarative Shadow DOM is an optimisation to avoid FOUC by pre-rendering the contents of a shadow DOM on the server or during deployment. It's not an entirely new way of doing shadow DOM, just an additional API to attach and initialise it. The problems with styling remain the exact same ones: Outside style-sheets don't affect the insides of the shadow DOM. > * Shadow trees are not "Custom Elements" I think you're missing the forest for the trees here, no pun intended. Shadow DOM is primarily useful in combination with custom elements and `<template>`s to build web components. They can be attached to other elements, yes, but that is a very rare way of using them, so it makes sense for most of these user stories to focus on this main use-case. If you have any user stories that showcase the use of shadow-dom with normal HTML elements, I'd be curious to see those to get another perspective on the spec, but if you don't actually post them here, then we can't read your mind. > So user stories that boil down to something like "as a web component user I want the web component to consider using some styles I present to it in a shadow tree" is not a missing platform feature, it is a choice for web component authors to make. It is not per se a missing feature, as it can be done imperatively using Javascript, but it is a common enough case for a specific platform feature to be added to make it more ergonomic and resilient. Synchronising stylesheets between light- and shadow-dom is far from trivial with the APIs we currently have. > Classifying as "push" vs "pull" vs "other" seem to suffer similarly I disagree. Classifying as "push" vs "pull" is very important because it is the distinction between whether the component *author* or the component *user* is the one who initiates the style adoption. The open-stylable proposal specifically addresses the former case, where a component *author* wants to opt in to some or all styles defined by the component *user*. It preserves encapsulation except where the author specifically chooses to expose APIs to let the user influence the process. Separating user stories into which of the two they need is important to know whether a push-based mechanism is worth exploring further, either as a separate feature, or as a part of open-stylable, or a purely pull-based mechanism can cover most of the users' needs. Again, if you think there's another, more important axis to consider, it'd be much easier if you could explain it with some actual user stories or at least specific use cases. I think this issue was created precisely because just listing requirements seems a bit arbitrary to us strangers on the internet, and user stories are a convenient way of bundling a requirement with the context to show why that requirement is useful. -- Reply to this email directly or view it on GitHub: https://github.com/WICG/webcomponents/issues/1052#issuecomment-2008126332 You are receiving this because you are subscribed to this thread. Message ID: <WICG/webcomponents/issues/1052/2008126332@github.com>
Received on Tuesday, 19 March 2024 21:01:28 UTC