Re: [csswg-drafts] [css-shadow-parts] theme too broad?

Even better solution would be to split part and theme attributes as described here
https://github.com/w3c/csswg-drafts/issues/1972

part names can be pretty generic... whereas theme names should be unique.

That would change the above example to
```html
<my-app>
  #shadow-root
    <h3 part="header" theme="my-app-header">My App Header</h3>
    <my-dialog>
      #shadow-root
        <p part="header" theme="my-dialog-header">My Dialog Header</p>
        <my-alert>
          #shadow-root
            <span part="header" theme="my-alert-header">My Alert Header</span>
        </my-alert>
        <my-alert>
          #shadow-root
            <span part="header" theme="my-alert-header">My Alert Header</span>
        </my-alert>
    </my-dialog>
</my-app>
```

obviously 
```
my-app::theme(my-alert-header) { 
  background: green; 
}
```
would work as expected :)


The best practice could be:
- use part with short names for more local changes (1-3 shadow levels down with forwarding) 
- use theme with unique long names to provide global theming


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

Received on Friday, 12 January 2018 10:54:18 UTC