Re: [csswg-drafts] [css-scoping-1] Specificity of :host, ::slotted, and :host-context doesn't seem to be defined? (#1915)

> once you put !important in your component, there is no way to override it from outside.

Yeah that's a big downside since you want your users to do styling overrides on LightDOM, as this is basically their content, their territory..

So correct me if I'm wrong but you have to choose between:

- Stuff outside **always** overrides your slotted selector (default behavior)
- Stuff outside **cannot** override your slotted selector (if you use !important inside your slotted selectors)
- Custom CSS props with fallbacks as default value, everywhere 🤷 :

```css
.accordion ::slotted([slot='invoker']) {
  margin: var(--accordion-invoker-margin, 0);
}
```

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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 20 July 2021 13:07:41 UTC