In Less I can do something like this
@basePath:"../../some_crazy_project_path_to_repeat/less/"; @import "@{basePath}less.less";
So I tried to do the same thing in Sass
$basePath:"../../some_crazy_project_path_to_repeat/less/"; @import "${basePath}less.scss"; // Syntax error: File to import not found or unreadable: ${basePath}less.scss.
and
@import "#{basePath}less.scss"; // Syntax error: File to import not found or unreadable: #{basePath}less.scss.
Is there a way to do this in Sass?
Sass variables are only available at the level of nesting where they are defined. Will the color of the text inside a <p> tag be red or green? It will be red! The other definition, $myColor: green; is inside the <h1> rule, and will only be available there!
The basic syntax for defining a variable is simple: Just use a $ before the variable name and treat its definition like a CSS rule: Sass Variable Syntax: $<variable name>:<value>; The following declares a variable named large-font.
To create a SCSS variable: Navigate to Acquia Cohesion > Website settings > SCSS variables. Enter a variable name in the Variable name field. Enter a value in the Variable value field.
You can't use conditional stuff for imports in SASS.
Consider creating a Compass extension out of your project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With