Move pxToRem to functions partial

This commit is contained in:
Ned Zimmerman 2020-02-16 14:32:54 -07:00
parent 1c1e82bdc6
commit 7620d29d9d
2 changed files with 13 additions and 15 deletions

View File

@ -0,0 +1,11 @@
@function pxToRem($pixels, $context: $browser-context) {
@if (unitless($pixels)) {
$pixels: $pixels * 1px;
}
@if (unitless($context)) {
$context: $context * 1px;
}
@return $pixels / $context * 1rem;
}

View File

@ -2,23 +2,10 @@
@import url('https://use.typekit.net/qlo3dpu.css');
@import '~prism-themes/themes/prism-a11y-dark';
// FUNCTIONS
@import '_sass/functions';
$browser-context: 16;
@function pxToRem($pixels, $context: $browser-context) {
@if (unitless($pixels)) {
$pixels: $pixels * 1px;
}
@if (unitless($context)) {
$context: $context * 1px;
}
@return $pixels / $context * 1rem;
}
pre[class*='language-'] {
font-size: 1rem;
}
@ -96,7 +83,7 @@ $bold: 700;
body {
border-top: 1rem solid red;
font-family: $sans-serif;
font-size: rem(20);
font-size: pxToRem(20);
padding: 2rem;
margin: 0;
}