-
Notifications
You must be signed in to change notification settings - Fork 12
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
how to use sass #1
Comments
Here is my sample code:
[class^="el-icon-fa"], [class*=" el-icon-fa"] {
display: inline-block;
font: normal normal normal 14px/1 FontAwesome!important;
font-size: inherit;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
};
$fa-css-prefix: el-icon-fa;
$fa-font-path: "~@/../node_modules/font-awesome/fonts";
@import '~@/../node_modules/font-awesome/scss/font-awesome.scss'; |
Try the following: // font-awesome: Concatenates with '/' between path and font name.
$fa-font-path: '~font-awesome/fonts';
$fa-css-prefix: el-icon-fa;
@import '~font-awesome/scss/font-awesome';
[class^='#{$fa-css-prefix}-'], [class*=' #{$fa-css-prefix}-'] {
display: inline-block;
font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome !important;
font-size: inherit;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
} My project is using Webpack. Can't remember if the |
I actually found a simpler option that allows FontAwesome's size classes to work. // font-awesome: Concatenates with '/' between path and font name.
$fa-font-path: '~font-awesome/fonts';
$fa-css-prefix: el-icon-fa;
@import '~font-awesome/scss/font-awesome';
[class^='#{$fa-css-prefix}-'], [class*=' #{$fa-css-prefix}-'] {
font-family: FontAwesome !important; // override ElementUI's icon font
} |
There are 3 types of icon font in fontawesome-free: "^5.8.1": solid, regular, light. All I got is the solid. How could I use the regular or light one? @jpickwell |
FA 5 has 4 sets: solid, regular, light, and brands. Light is not free. Only a sub-set of solid and regular are free. Brands is completely free, all icons included. When I made those comments, I was using FA 4. Now I'm using FA 5, and I use the SVG+JS version instead of web fonts (IE may not allow web fonts to load). I also no longer use ElementUI. However, FA has a Vue component, and all the icons can be used directly through JS without using SCSS. To use with ElementUI, you might have to dig through their code looking for icon slots that you can override. |
can you offered demo how to use sass? when i use sass element-ui & font-awesome it can't work
The text was updated successfully, but these errors were encountered: