support for built in components #2502
Replies: 2 comments
|
On top of this, not all elements support shadow roots. Notably, |
|
First of all I really appreciate the time to answer this. I didn't know this was dropped by Webkit / Safari, thanks for the heads up (that's why I wrote this issue to understand why nobody were using this approach). About the shadow DOM, I'm against that on some cases so for me that was not an issue but I understand your point. |
Uh oh!
There was an error while loading. Please reload this page.
I think lot of components can be rewritten using built-in approach and this will remove the "flash style" effect as you can style them with plain css directly, doing progressive enhancement just on behavior.
The simples example is button, today we have something like this:
When this is rendered the browser just render text "Button" until the logic of the web component is executed (and it will not work without javascript).
If instead of this we change into:
Then the browser will render a button instead of text which is a much better starting point than before.
Also because is a button we can apply css like this:
This will display the button as expected without flashing style!
We can apply the same for more complex components like Card using something like:
I hope this inspire some of you!!
All reactions