You need to use interpolation (eg. #{$var}
) on your variable in order for Sass to treat it as a CSS property. Without it, you’re just performing variable assignment.
@mixin w_fluid($property_name, $w_element, $w_parent:16) {
#{$property_name}: percentage(($w_element / $w_parent));
}
Related Contents:
- False positive “undefined variable” error when compiling SCSS
- Adding a unit to a number in Sass
- Using Sass Variables with CSS3 Media Queries
- Append the parent selector to the end with Sass
- Sass .scss: Nesting and multiple classes?
- Sass – Manipulate inherited property?
- Modifying the middle of a selector in Sass (adding/removing classes, etc.)
- Using a function in Sass is returning the string containing the name of the function rather than the result
- Is Sass 3.3 compatible with Compass?
- How to overwrite SCSS variables when compiling to CSS
- Concatenating nested classes using SASS [duplicate]
- Math with interpolated variables?
- Sass Interpolation of Mixin, Function, and Variable names
- Why does Sass change the format of my colors?
- Can I import an externally hosted file with sass?
- Sass combining parent using ampersand (&) with type selectors
- Define variables in Sass based on classes
- Sass calculate percent minus px
- CSS property as SASS mixin value [duplicate]
- Unexpected results when using @extend for themes
- How to define a dynamic mixin or function name in SASS?
- Sass color variable not working inside darken()
- How to convert a number to a percentage with SASS? [duplicate]
- Can’t get sass + compass + susy installed due to version conflict
- Multiple values for one property with variable argument lists in Sass
- Styling a specific set of input types in a reusable way with Sass
- How to extend/modify (customize) Bootstrap with SASS
- Using fonts with Rails asset pipeline
- How to create color shades using CSS variables similar to darken() of Sass?
- What are Mixins (as a concept)
- SASS: randomly pick background-image from a list
- Access HTML attribute value in SASS
- SASS – use variables across multiple files
- access SASS values ($colors from variables.scss) in Typescript (Angular2 ionic2)
- Including another class in SCSS
- Can I use variables for selectors?
- Angular-cli from css to scss
- Error: ‘node-sass’ version 5.0.0 is incompatible with ^4.0.0
- How can I use Ruby/Rails variables inside Sass?
- When using SASS how can I import a file from a different directory?
- Can variables be used in import statements for Sass files?
- cycling through a list of colors with sass
- How to use mixins properly in Javascript
- Is there a way to import variables from javascript to sass or vice versa?
- Why put in front of the file name “_” or “_” in scss/css?
- Text Stroke (-webkit-text-stroke) css Problem
- Does LESS have an “extend” feature?
- how to watch changes in whole directory/folder containing many sass files
- Checking if a variable is defined in SASS
- Cannot find module ‘sass’