I am trying to learn SCSS and encountered a small obstacle (if you can call it that) with something I am trying to do.
So the code beneath is probably a non-logical, simplified example of what I am trying to achieve.:
.gt-button {
// some css
&.gt-button-alt-l {
font-size: 2em;
}
}
.gt-buttonset {
// some css
&.gt-button-alt-l > .gt-button {
font-size: 2em;
}
}
This will generate:
.gt-button.gt-button-alt-l {
font-size: 2em;
}
.gt-buttonset.gt-button-alt-l > .gt-button {
font-size: 2em;
}
So I am wondering how to logically get underneath CSS instead:
.gt-button.gt-button-alt-l, .gt-buttonset.gt-button-alt-l > .gt-button {
font-size: 2em;
}
How would I go about getting above generated CSS? I have fiddled around in Sassmeister.com but I cannot seem to get it in a way that is logical to me. I also don't really know the technical term of joining those two CSS pieces into the desired generated CSS piece.
I do have to add that I did get it to work like this:
.gt-button {
&.gt-button-alt-l, .gt-buttonset .gt-button-alt-l > & {
font-size: 2em;
}
}
But that for some reason does not seem logical to me. As .gt-buttonset is no child or anything of the .gt-button. So putting it there just feels weird.
I would appreciate to know if the last code fragment actually is the way to do this or if there are other options. If there are other options I would also like to know them.