Last active
January 9, 2023 19:54
-
-
Save otakupahp/e7c5e0f4cd18d63e487a6fd91d2bf033 to your computer and use it in GitHub Desktop.
Add a class and use the direct parent as part of the child selector
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Desired output | |
// .content-section-about_this .wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content | |
.content-section-gift, | |
.content-section-about_this { | |
.wp-block-media-text { | |
$selector: nth(&,1); | |
$direct-parent: nth($selector, length($selector)); | |
&.is-stacked-on-mobile #{selector-append($direct-parent, '__content')} { | |
color: yellow; | |
} | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.content-section-about_this .wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content { | |
color: yellow; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"sass": { | |
"compiler": "dart-sass/1.32.12", | |
"extensions": {}, | |
"syntax": "SCSS", | |
"outputStyle": "expanded" | |
}, | |
"autoprefixer": false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment