Skip to content

Instantly share code, notes, and snippets.

@jensgro
Last active April 2, 2024 12:47
Show Gist options
  • Save jensgro/3c6401dab31353fa31e8cf01104300e3 to your computer and use it in GitHub Desktop.
Save jensgro/3c6401dab31353fa31e8cf01104300e3 to your computer and use it in GitHub Desktop.
Border-radius Mixin for Sass with automatic falsification
@mixin br($br: false) {
@if $br {
border-radius: $br * 1px;
}
}
.card {
@include br(80);
}
.test {
@include br(4);
}
.test2 {
@include br();
}
.card {
border-radius: 80px;
}
.test {
border-radius: 4px;
}
{
"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