Skip to content

Instantly share code, notes, and snippets.

@greglockwood
Created December 9, 2021 02:10
Show Gist options
  • Save greglockwood/2a4c0659765b0de8cdc9916ca24d6b6d to your computer and use it in GitHub Desktop.
Save greglockwood/2a4c0659765b0de8cdc9916ca24d6b6d to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
@function -strip-unit($num) {
@return $num / ($num * 0 + 1);
}
@function -convert-to-rem($value, $base-value) {
$value: -strip-unit($value) / -strip-unit($base-value) * 1rem;
@if ($value == 0rem) { $value: 0; } // Turn 0rem into 0
@return $value;
}
// convert from px to rem.
// px measurements must be based on 1080p resolution
// e.g. p {@include convert1080pxToREM(12px);}
@function convert1080pxToREM($size) {
@return -convert-to-rem($size, 15px);
}
$ott-spinner-size: convert1080pxToREM(75px);
$otherValue: convert1080pxToREM(150);
.loadingSpinner {
margin-left: -($ott-spinner-size / 2);
margin-bottom: -($ott-spinner-size / 2);
width: $otherValue;
height: $ott-spinner-size;
}
.loadingSpinner {
margin-left: -2.5rem;
margin-bottom: -2.5rem;
width: 10rem;
height: 5rem;
}
{
"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