Error: @import "./styles/mixins"; ^ Properties are only allowed within rules, directives, mixin includes, or other properties.
My scss file is as simple as that :
@import "./styles/mixins";
// There shouldn't be anything else
// Set my variables
@import "styles/variables";
@import "styles/core-style";
@include font-importer("Raleway Regular",'normal',400,"./assets/fonts/Raleway/Raleway-Regular.ttf");
@include font-importer("Raleway Bold",'normal',700,"./assets/fonts/Raleway/Raleway-Bold.ttf");
@include font-importer("Raleway Light",'normal',300,"./assets/fonts/Raleway/Raleway-Light.ttf");
@include font-importer("Raleway Medium",'normal',500,"./assets/fonts/Raleway/Raleway-Medium.ttf");
What does it mean ? I don't understand Sass error. I don't understand where to look at. What do I have to do ?
Thanks,
Stéphane.
The @include directive is created to let you use (include) the mixin. A mixin is defined with the @mixin directive. ... Tip: A tip on hyphens and underscore in Sass: Hyphens and underscores are considered to be the same. This means that @mixin important-text { } and @mixin important_text { } are considered as the same mixin!
The @mixin directive lets you create CSS code that is to be reused throughout the website. The @include directive is created to let you use (include) the mixin. A mixin is defined with the @mixin directive. ... Tip: A tip on hyphens and underscore in Sass: Hyphens and underscores are considered to be the same.
Sometimes you only want a property declaration to show up some of the time. If a declaration’s value is null or an empty unquoted string, Sass won’t compile that declaration to CSS at all.
Custom Properties In Sass as in CSS, property declarations define how elements that match a selector are styled. But Sass adds extra features to make them easier to write and to automate. First and foremost, a declaration's value can be any SassScript expression, which will be evaluated and included in the result.
What does your font-importer
return?
Error explanation:
Properties are only allowed within rules, directives, mixin includes, or other properties.
That means that you call you mixin outside css selector.
For example this code will produce the same error:
@mixin color() {
color: red;
}
@include color(); // call mixin without css selector
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