webcomponents / webcomponents/polyfills

Supporting ie11 and inheritance of css variable with slotted components

Open
#296 4 comments 0 reactions 0 assignees View on GitHub
Focus Area: Standards & Polyfills Package: shadycss Type: Bug wontfix
Dominant language
HTML
Stars
1.2k
Forks
168
PR merge metrics
No merged PRs in 30d

Description

I am trying to use css variables with ie 11 and I got stucked at one point.

Think that I have a layout element and icon element.My layout element only have slot and in that slot there are icon components. Dom tree be like here.

```



```

And my-icon component have these in its style:

```
:host {
fill: var(--icon-default-fill-color, green);
}
```

- On Chrome when I run these code with my-layout component:

`$0.style.setProperty('--icon-default-fill-color', 'yellow');
`

It sets the variable on my-laoyut component and all the icons below changes their color with yellow.It is OK.

- On ie11 when I run these code with my-layout component:

```
ShadyCSS.styleSubtree(this, {
'--icon-default-fill-color': 'yellow'
});
```

It sets the variable on my-laoyut component successfuly.When I check it with below code it seems ok and returns 'yellow' as expected.

`ShadyCSS.getComputedStyleValue($0, '--icon-default-fill-color')
`

But below(slotted) icon components color doesn't change.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.