-
-
Save michael-benin-CN/c7a3f6354909665c4a33 to your computer and use it in GitHub Desktop.
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
@main-font-size: 16px; | |
.x-rem (@property, @value) { | |
// This is a workaround, inspired by https://github.com/borodean/less-properties | |
@px-fallback: @value * @main-font-size; | |
-: ~`(function () { return ';@{property}: @{px-fallback}'; }())`; | |
-: ~`(function () { return ';@{property}: @{value}rem'; }())`; | |
} | |
.some-class { | |
.x-rem(font-size, 1.4); | |
} |
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
$main-font-size: 16px; | |
@mixin x-rem ($property, $value) { | |
#{$property}: $value * $main-font-size; | |
#{$property}: #{$value}rem; | |
} | |
.some-class { | |
@include x-rem(font-size, 1.4); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment