@@ -67,12 +67,12 @@ as the shadow host).
67
67
68
68
The ` <article-meta> ` custom element inherits its ` color ` from the ` <article> ` element where it is set to ` deeppink ` . The
69
69
` <span> ` element within the shadow tree inherits its ` color ` from the ` <article-meta> ` custom element which means the
70
- value will be ` deeppink ` .
70
+ value will also be ` deeppink ` .
71
71
72
72
## Styling elements outside of a shadow tree
73
73
74
- In order to be portable, Web Components can provide default styles for a couple types of elements which exist outside of
75
- its shadow tree: the custom element itself ( also known as the shadow host) and slotted elements .
74
+ In order to be portable, Web Components can provide default styles for the element itself (also known as the shadow host).
75
+ They can also style slotted elements with some default styles .
76
76
77
77
### Writing default styles for the shadow host with ` :host ` and ` :host() `
78
78
@@ -92,8 +92,9 @@ action:
92
92
</fancy-p >
93
93
```
94
94
95
- The second will select the shadow host if it matches a selector. For example, given the following default styles for the
96
- ` <fancy-p> ` component, only the second element in the subsequent code example will have the styles applied.
95
+ The ` :host() ` selector will select the shadow host if it matches a given selector. For example, it can be used to
96
+ select for hosts that have a given attribute. While ` :host ` may apply to ` <fancy-p> ` component, ` :host([extra]) ` would
97
+ apply only to ` <fancy-p extra> ` elements:
97
98
98
99
``` css
99
100
:host ([extra ]) {
@@ -126,12 +127,11 @@ it will select elements within the shadow tree.
126
127
</fancy-p >
127
128
```
128
129
129
- You can ` ::slotted() ` to style light DOM descendants of a shadow host.
130
130
131
131
### Writing default styles for slotted elements with ` ::slotted() `
132
132
133
- The ` ::slotted() ` pseudo-element selector allows you to write default styles for different kinds of elements which are
134
- slotted .
133
+ The ` ::slotted() ` pseudo-element selector allows you to write default styles for slotted elements that match the given
134
+ selector. Specifying a selector can be useful for styling specific elements in particular ways .
135
135
136
136
``` html
137
137
<fancy-elements >
0 commit comments