non combacia con questo */
}
::slotted(div) p {
- /* can't go inside light DOM */
+ /* non va dentro il light DOM */
}
```
-Also, `::slotted` can only be used in CSS. We can't use it in `querySelector`.
+Inoltre, `::slotted` può essere usato solamente con i CSS. Non è possibile usarlo in `querySelector`.
-## CSS hooks with custom properties
+## CSS hooks con proprietà custom
-How do we style internal elements of a component from the main document?
+Come si possono stilizzare gli elementi interni di un componente, applicando stili dal documento principale?
-Selectors like `:host` apply rules to `
` element or ``, but how to style shadow DOM elements inside them?
+I selettori com `:host` applicano le loro regole all'elemento `` o ``, ma come possiamo stilizzare gli elementi dello shadow DOM al suo interno?
-There's no selector that can directly affect shadow DOM styles from the document. But just as we expose methods to interact with our component, we can expose CSS variables (custom CSS properties) to style it.
+Non abbiamo dei selettori che possano direttamente influire sugli stili dello shadow DOM dal documento. Ma dal momento che possiamo esporre dei metodi per interagire con i nostri componenti, possiamo anche esporre delle variabili CSS (proprietà CSS personalizzate) per stilizzarli.
-**Custom CSS properties exist on all levels, both in light and shadow.**
+**Le proprietà Custom CSS risiedono in tutti i livelli, sia nel light che nello shadow.**
-For example, in shadow DOM we can use `--user-card-field-color` CSS variable to style fields, and the outer document can set its value:
+Per esempio, nello shadow DOM, possiamo usare la variabile CSS `--user-card-field-color` per stilizzare i campi, e l'outer document può impostarne il valore:
```html
-Name:
-Birthday:
+Nome:
+Data di nascita:
```
-Then, we can declare this property in the outer document for ``:
+Quindi, possiamo dichiarare questa proprietà nell'outer document per ``:
```css
user-card {
@@ -269,9 +269,9 @@ user-card {
}
```
-Custom CSS properties pierce through shadow DOM, they are visible everywhere, so the inner `.field` rule will make use of it.
+Le proprietà Custom CSS permeano anche lo shadow DOM, e sono visibili ovunque, quindi la regola interna `.field` ne farà uso.
-Here's the full example:
+Ecco l'esempio completo:
```html run autorun="no-epub" untrusted height=80
- Name:
- Birthday:
+ Nome:
+ Data di nascita: