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

Error during compilation from _normalize.scss (rhythm mixin problem) #19

Closed Spheerys closed 10 years ago

Spheerys commented 10 years ago

Hi,

I have installed the partial _normalize.scss but the compilation failed :

error sass/styles.sass (Line 192 of sass/vendors/_normalize.scss: 0.15em/px isn't a valid CSS value.)

It's looking like a problem with the rhythm mixin but I don't understand why...

Any idea ?

JohnAlbin commented 10 years ago

@Spheerys Doesn't Compass' vertical-rhythm module give you this warning? $base-font-size must resolve to a pixel unit."

That module requires that $base-font-size be set using px values.

Spheerys commented 10 years ago

Hummm this value is set in px :

// The base font size.
$base-font-size: 16px !default; // Override default set in Compass' Vertical Rhythm partial.

So what's wrong ?

waynedpj commented 10 years ago

@Spheerys i am no SASS expert, but i actually believe that you do not want to use the !default modifier in this case. as explained here, it seems to prevent the variable from being changed if it already has a value, which it sounds like it already does. in fact, Compass does use !default for this variable so as not to change it if it already has a value. so perhaps try removing !default and see if that helps.

Spheerys commented 10 years ago

I have tried this too, without success... I have set "$base-font-size: 16px" just before the rhythm call just in case, but no changes...

tbartels commented 10 years ago

I think the error you are seeing is related to the $base-line-height not the $base-font-size.

$base-font-size: 16px;
$base-line-height: 24px;

it looks like you may have an em value for your $base-line-height e.g.:

$base-font-size: 16px;
$base-line-height: 0.15em;
JohnAlbin commented 10 years ago

I think @tbartels found the right diagnosis. :-)