Following the sass documentation at https://sass-lang.com/documentation/at-rules/mixin#passing-arguments-to-content-blocks, I decided to create a mixin that takes a content block and dynamically changes it using media queries, while also providing variable for flexible usage:
@mixin main-offset {
@content (7.26%);
@media screen and (max-width: 1360px) {
@content (24%);
}
}
body {
@include main-offset using($offset) {
padding: 0 $offset 0 0;
margin: 0 0 0 $offset;
}
}
This compiles with syntax error expecting semicolon where @content arguments go (@content;
instead of @content(...
)
Also VsCode syntax highlighter is confused too around using
block.
I'm using "node-sass": "^4.12.0"
and "react": "^16.10.2"
If I completely misunderstand this feature, alternative solution is also welcome too.
Thank you.