- From: Jesse Sutherland <notifications@github.com>
- Date: Fri, 16 Feb 2024 11:15:58 -0800
- To: WICG/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <WICG/webcomponents/issues/909/1949162507@github.com>
@LeaVerou I think has articulated the simplest solution. This: > We introduce an attribute to control how style encapsulation works (name TBB, let’s call it adoptstyles for now). It inherits, and using adoptstyles on a descendant changes the behavior for that descendant subtree. Or, alternatively, each element needs to opt-in separately. Or, even better, it’s a CSS property so both patterns are easy. Except I would add another set of values: none (as now and default), all same as original idea, and probably most practical: **adoptstyles="some shared style.css"** Each component author could limit/open the subtree themselves as they wish, eg preserving as in @LeaVerou example, a "close dialogue" button from externally adopted styles even if shadowroot allows them for other internal elements. Component user could specify: `<custom-c adoptstyles="custom-addition.css" />` Same API in lightDOM or shadow all the way down. Reaching across shadow barrier unsupported? Or combine with Chris Coyier "I know what I'm doing selector" type solution as proposed by @sorvell (I'm a random dev who's faced this issue several times but has no real expertise in how these things get implemented fwiw, and maybe all of the above would be terrible for perf? 🤔) -- Reply to this email directly or view it on GitHub: https://github.com/WICG/webcomponents/issues/909#issuecomment-1949162507 You are receiving this because you are subscribed to this thread. Message ID: <WICG/webcomponents/issues/909/1949162507@github.com>
Received on Friday, 16 February 2024 19:16:02 UTC