Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools

Bruno Dias
Bruno Dias
10,554 Points

Yeoman not adding css font-icon file

Hi,

I am having this issue with yeoman. We are using icomoon font icons and it comes with a icons.css file. When I generate the dist folder the icons.css is placed inside styles folder however is not called on main.css file.

What am I doing wrong?

3 Answers

Hey again, you may to change the paths to that stylesheet somewhere. When you open your console (cmd + alt + j), do you get a GET error with those stylesheets? That will tell you where your code is expecting that css file to be. You'll have to change the path where it is being called so it matches the location where Yeoman is putting it.

Bruno Dias
Bruno Dias
10,554 Points

Hey Nick,

Yes I did that no errors is showed.

This is how I am doing: On main.scss I call for the css: @import "partials/font-icons.css";

When I run grunt serve the icons are loaded but when I run grunt serve:dist after generating the dist files the font-icons.css file is not loaded into main.css

If I add link rel="stylesheet" href="styles/partials/font-icons.css" on head and generate the dist, then it works. Do you think it is a good practice doing this way?

Yeah I think that's OK. I don't know if there's any advantage in using @import over linking to it in your html other than organization. My guess is you're fine ;)

Bruno Dias
Bruno Dias
10,554 Points

Cool. Yes you are right. It would be easier to organize the structure if the @import worked. It's only one single file anyway so I think that is not going to be an issue.

Again appreciate your help. Thank you very much.