JohnAlbin / normalize-scss

This is the Sass version of Normalize.css, a collection of HTML element and attribute rulesets to normalize styles across all browsers.
https://github.com/JohnAlbin/normalize-scss#latest-versions
MIT License
1.44k stars 254 forks source link

$indent-amount value not honoring $base-unit, always displays px #117

Closed toddmilliken closed 7 years ago

toddmilliken commented 7 years ago

$indent-amount values always resolve to px, even when changing the default variable for $base-unit to be rem.

My main sass file is as follows:

$indent-amount: 40px; // The amount lists and blockquotes are indented.
$base-unit: 'rem';

// Normalize (this path will change depending on where your sass partial is located, mine is in `/src/core/sass/` for my app
@import "../../../node_modules/normalize-scss/sass/normalize/import-now";

One possible solution is modifying /sass/normalize/_normalize-mixin.scss to wrap each $indent-amount with normalize-rhythm($indent-amount) so it gets converted to the proper units.

JohnAlbin commented 7 years ago

$indent-amount values always resolve to px.

No, $indent-amount is set to 40px by default. But you can set it to any value with any unit.

If you set this before running @include normalize();, it will output 2rem instead of 40px.

$indent-amount: 2rem;

$base-unit only controls the font size/line heights, not margins or padding.