W3C home > Mailing lists > Public > public-css-archive@w3.org > January 2019

[csswg-drafts] [css-shadow-parts] Limited ::theme selector (#3507)

From: Florian Rivoal via GitHub <sysbot+gh@w3.org>
Date: Mon, 14 Jan 2019 02:59:25 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-398733637-1547434764-sysbot+gh@w3.org>
frivoal has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-shadow-parts] Limited ::theme selector ==
(Split from issue #3467, reported by @stefsullrew)

The current description of the *::theme* selector is perhaps a bit too broad for real world usage. However the ability to access any *::part* within the context of a component, without elaborate `exportparts=` chains would be much easier to work with in the context of a design system.

In the example below, a theme context is defined for `**x-foo**` with the prefix of “`foo-`*”*. This would grant access to all child parts that match the name within the declared theme's context. This scoping limits the reach of *::theme* while avoiding the potentially complex *exportparts=* chains. Particularly when there's deep composition of components not owned by a single team.

<x-foo theme="foo-">

// x-bar definition
    <p part="metadata">Posted on: 2019-01-10</p>

// x-oof definition
    <svg part="icon"></svg>

x-foo::theme(foo-metadata) {
    color: grey;
    font-style: italic;

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3507 using your GitHub account
Received on Monday, 14 January 2019 02:59:26 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:42 UTC