Skip to content

Instantly share code, notes, and snippets.

@feoche
Created July 11, 2023 13:42
Show Gist options
  • Save feoche/00054db8f9df3c1ec24216460ba4c6bd to your computer and use it in GitHub Desktop.
Save feoche/00054db8f9df3c1ec24216460ba4c6bd to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
@mixin wrapComponent($selector) {
:host,
.#{$selector} {
@content;
}
}
@mixin wrapSlot($slotName) {
slot[name="#{$slotName}"] {
@content;
}
}
@mixin wrapSlotted($slotName) {
::slotted([slot="#{$slotName}"]) {
@content;
}
}
@include wrapComponent(otds-button) {
background: red;
@include wrapSlot("") {
background: blue;
}
@include wrapSlot(title) {
background: green;
}
@include wrapSlotted("") {
background: cyan;
}
@include wrapSlotted(title) {
background: magenta;
}
}
:host,
.otds-button {
background: red;
}
:host slot[name=""],
.otds-button slot[name=""] {
background: blue;
}
:host slot[name=title],
.otds-button slot[name=title] {
background: green;
}
:host ::slotted([slot=""]),
.otds-button ::slotted([slot=""]) {
background: cyan;
}
:host ::slotted([slot=title]),
.otds-button ::slotted([slot=title]) {
background: magenta;
}
{
"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