Open tomivirkki opened 3 years ago
Indeed, for this we implemented a registerGlobalStyles()
in registerStyles()
spirit
See also #499
I wonder if this should also support using ApplyShim (for legacy migration cases)?
I wonder if this should also support using ApplyShim (for legacy migration cases)?
We do not use CSS mixins in our components and do not recommend anyone to use them. IMO there is no need for it at the moment, and hopefully we can avoid doing that.
Also note that Polymer's <custom-style>
will continue to work as before (assuming it gets imported).
If someone specifically wants to use <custom-style>
with <style include="some-vaadin-style">
they can still do so by importing the style-modules
adapter.
Was struggling a bit today trying to phase out iron-icon in favor of vaadin-icon.
https://discord.com/channels/732335336448852018/1060531737794453575/1060531737794453575
Finally figured out with less Polymer loaded, some <custom-style>
elements also needed a refactor.
It's a bit unclear, why https://github.com/vaadin/web-components/blob/3f5113c82ebf30a229eecb7a7319cbf5ddf9160f/packages/vaadin-lumo-styles/typography.js#L138-L140 import @vaadin/vaadin-lumo-styles/typography.js
does inject its <style>
tag into head element, but it doesn't have any actual effect.
From opener here One option would be to extend registerStyles to also support main document-level styling:
If this would land, I'd be able to retire our registerGlobalStyles util then.
@lkraav Thanks for the feedback. I agree that the current code looks confusing. Here is what you would need to do:
This can be addressed by the following helper added in #5666 (currently marked as internal):
The
<custom-style>
element, used for including main document-level styles, is a Polymer Web Component and so needs a replacement.Example:
It's already possible to use ESM for importing Vaadin styles and then include them in the main document with js, but the end result is quite verbose:
One option would be to extend
registerStyles
to also support main document-level styling: