mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-14 00:21:31 +08:00
Created Converting Scoped to Shadow (markdown)
35
Converting-Scoped-to-Shadow.md
Normal file
35
Converting-Scoped-to-Shadow.md
Normal file
@ -0,0 +1,35 @@
|
||||
## Converting Scoped to Shadow
|
||||
|
||||
### CSS
|
||||
|
||||
There will be some CSS issues when converting to shadow. Below are some of the differences.
|
||||
|
||||
**Targeting host + slotted child**
|
||||
|
||||
```css
|
||||
/* IN SCOPED */
|
||||
:host(.ion-color)::slotted(ion-segment-button)
|
||||
|
||||
/* IN SHADOW*/
|
||||
:host(.ion-color) ::slotted(ion-segment-button)
|
||||
```
|
||||
|
||||
**Targeting host-context + host (with a :not)**
|
||||
|
||||
```css
|
||||
/* IN SCOPED */
|
||||
:host-context(ion-toolbar.ion-color):not(.ion-color) {
|
||||
|
||||
/* IN SHADOW */
|
||||
:host-context(ion-toolbar.ion-color):host(:not(.ion-color)) {
|
||||
```
|
||||
|
||||
**Targeting host-context + host (with a :not) > slotted child**
|
||||
|
||||
```css
|
||||
/* IN SCOPED */
|
||||
:host-context(ion-toolbar:not(.ion-color)):not(.ion-color)::slotted(ion-segment-button) {
|
||||
|
||||
/* IN SHADOW*/
|
||||
:host-context(ion-toolbar:not(.ion-color)):host(:not(.ion-color)) ::slotted(ion-segment-button) {
|
||||
```
|
Reference in New Issue
Block a user