You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ShadyCSS seemingly only polyfills custom properties inside the exact html selector, and ignores all other selectors like html[theme="dark"] and html, [theme="dark"]. Currently the lumo-color style module assumes [theme~="dark"] would work when applied on the document root element.
So in order to get dark palette working in the global scope in IE11, we need to include a separate style module which overrides the color properties for the html selector.
For example:
<custom-style><styleinclude="lumo-color lumo-dark"></style></custom-style>
/*
Assuming the "lumo-dark" style module has the following content:
html {
/* The dark palette */
--lumo-base-color: hsl(214, 35%, 21%);
...
}
*/
It basically requires us to copy-paste the dark palette custom properties into an additional style module.
We can choose to make this an opt-in on top of the currently documented way of using <html theme="dark"> or we can update the documentation to show only this one way which works everywhere but is more cumbersome to implement if you want to provide a toggle for the end user.
We should try to align how the color palettes work in the Lumo and the Material theme. Currently they are structured differently, and the dark palette for global scope is not working in the Material theme either.
It’s not possible to use the dark palette in browsers that do not have native support for CSS Custom Properties.
Applying
theme="dark"
on the<html>
element does not work even if you include thelumo-color
(orlumo-color-legacy
) style module in the global scope.For example, this works in all other supported browsers except IE11:
ShadyCSS seemingly only polyfills custom properties inside the exact
html
selector, and ignores all other selectors likehtml[theme="dark"]
andhtml, [theme="dark"]
. Currently thelumo-color
style module assumes[theme~="dark"]
would work when applied on the document root element.So in order to get dark palette working in the global scope in IE11, we need to include a separate style module which overrides the color properties for the
html
selector.For example:
It basically requires us to copy-paste the dark palette custom properties into an additional style module.
We can choose to make this an opt-in on top of the currently documented way of using
<html theme="dark">
or we can update the documentation to show only this one way which works everywhere but is more cumbersome to implement if you want to provide a toggle for the end user.We should try to align how the color palettes work in the Lumo and the Material theme. Currently they are structured differently, and the dark palette for global scope is not working in the Material theme either.
Originating issue: https://github.com/vaadin/bookstore-starter-flow/issues/55
The text was updated successfully, but these errors were encountered: