CSS in web components: how to style LitElement components in Vaadin Fusion

preview_player
Показать описание
Learn how to style LitElement based web components. Shadow DOM encapsulates styles automatically: letting you write simple, scoped selectors in your components. We also cover theme variants in the Vaadin Lumo theme.

0:00 - Intro
0:15 - Defining styles for LitElement web component
0:43 - Using the :host selector to target the component
1:49 - Syle scoping and encapsulation
3:02 - Vaadin theme variants: light and dark theme, primary button

Рекомендации по теме
Комментарии
Автор

How to use less or scss in lit element?

林崖
Автор

A somewhat related question to themes and styling on using Lit-Element. How do you go about changing the label text color, or form background color using CSS, suppose I wanted to over ride the default theme text color for just one particular form? I can't seem to target those items in my CSS template because they are in the shadow root listed as "parts".

Also how would I change the text content of the <vaadin-text-field id"test"></vaadin-text-field> using query selector ? i.e. = "hello world" ?

thx for any help you can provide!

Glad to see a client side version of vaadin using Lit-Element:)

justindb
Автор

Hello, could you please explain how can we import css in a component from an external file?

shalusinghal