-
Notifications
You must be signed in to change notification settings - Fork 12.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extending multiple FA* styles within a custom Sass = Bug #13170
Comments
Hi, just some hints, not a solution, at the moment. I think that this is not an issue If you wanto to switch icon style, you just need to change the font weight from So, something like .icon {
@include fa-icon;
@extend .far;
&.fill {
font-weight: 900;
}
&.light {
font-weight: 300;
}
} Also, &.ico-star {
&:before {
content: fa-content($fa-var-star); //👍
}
&.half:before {
content: fa-content($fa-var-star-half); //👍
}
} |
@tagliala that is a marvelous hint! I completely missed that |
SCSS extend creates these these bugs, by messing up the order of things. Given this scss
Produces this output: The Switching things on/off I noticed -
So removing And perhaps doc's or examples should be updated by removing |
Thanks @leqwasd! Was confused why my Sass implementation wasn't working (following the docs). Removing |
Wow this makes me so mad. Using the paid version and I spent 3 hours debugging trying to figure out why this wasn't working, turns out the documentation is just wrong. THANK YOU @leqwasd! |
@cfbauer sorry for the troubles and thanks for the heads-up I can see that the documentation at https://fontawesome.com/how-to-use/on-the-web/using-with/sass#mixins has been partially changed to @import "./fontawesome/scss/fontawesome.scss";
@import "./fontawesome/scss/regular.scss";
@import "./fontawesome/scss/solid.scss";
@import "./fontawesome/scss/brands.scss";
.user {
@extend %fa-icon;
@extend .fas;
&:before {
content: fa-content($fa-var-user);
}
}
.user-regular {
@extend %fa-icon;
@extend .far;
&:before {
content: fa-content($fa-var-user);
}
}
.twitter {
@extend %fa-icon;
@extend .fab;
&:before {
content: fa-content($fa-var-twitter);
}
}
Output: How are you loading the scss files in you project? Any chance that you are using https://github.com/FortAwesome/font-awesome-sass ? |
Extending multiple FA* styles within a custom Sass file renders only one style in the compiled CSS
I have a rating stars component to design with our CMS solution. So I want to avoid depending on HTML markup that can get corrupted by site editors when posting new content. For that reason I integrated FontAwesome 5 PRO using « Web fonts with CSS », over the « SVG with Javascript » option, and everything seemed to work fine... Until I had needed both font styles Solid and Regular to render side by side.
So far I've been able to render FAR icons within my localhosted (for now) solution by extending FontAwesome's Sass library. My problem is that I'm unable to render any other styles then that REGULAR via including+extending FA class names.
Requirements
fa-star
: FontAwesome requires multiple stylesEnvironment
@includ
and@extend
, as promoted in the documentation.My Bugged Result
fas
style : Screenshot from my localhostMaybe I'm not coding it the proper way!?
My custom HTML source
My custom SCSS code
The text was updated successfully, but these errors were encountered: