Closed jlong closed 12 years ago
Can you please provide a small example that demonstrates the problem?
Yup:
$base-font-size: 95%
@import compass
This is why I suggest that you take the cascading approach:
Include all your dependencies on the top, compass should be always the highest on the chain of includes:
Example: https://github.com/kuroir/Survival-Kit/blob/master/src/stylesheets/app.scss
I can't think of a way to solve this issue in compass really. I think namespacing is best handled by a future Sass feature and so in the meantime, judicious handling of import order and selective importing is the best solution.
While upgrading a project today I had trouble with the new typography module because I had defined $base-font-size as 95% and imported all of Compass:
https://github.com/radiant/radiant-prototype/blob/master/stylesheets/admin/_base.sass
I ended up having to import utilities and css3 separately in order to use this variable name. (I'm not using the typography module.)
The problem was caused because of this line:
$base-rhythm-unit: $base-line-height / $base-font-size * $font-unit;
https://github.com/chriseppstein/compass/blob/stable/frameworks/compass/stylesheets/compass/typography/_vertical_rhythm.scss#L25
Which assumes that $base-font-size is in pixels. I couldn't figure out an easy way to solve this.