简体   繁体   中英

I can't use css styles on my navbar (using sass)

I'm starting to learn by my own and I tried for the first time to use sass in order to get more clean my code, having everything on sections. So the problem is when I try to give some styles to the navbar, I don't know why when I write code it doesn't apply. Maybe is because I'm not linking correctly or just using bad the sass compiler.

The best option to help me is take a look into my repository where I started to build this project to practice. I really hope could help me because I want to create differents sections like navbar, body, articles, footer using sass and give them styles.

https://github.com/Shylex96/test-portfolio

Edit: After a long search about this issue I see there is a problem with "use" and I have to change rules or something like that, but still don't know.

Replace @use with @import in your scss files.

Try updating your \\util\\style.scss like below:

@import '../globals/';
@import '../components/';

Save and compile them then copy the resulting css files to dist folder if they weren't copied automatically.

Update the stylesheet link in your index.html file to:

<link rel="stylesheet" type="text/css" href="dist/style.css">

It should be "dist/style.css" not "/dist/style.css"

FINALLY!! I solved it and I'm going to commit what helps me if someone have same issues..

I had to reinstall node.js, install gulp, and change "about_Execution_Policies" from windows.. when I did, I could finally install gulp correctly and then I install again sass. Of course, I just converted all the changes that people told me about into the first ones I had. I created a new file called gulpfie.js and two more files: .gitignore and .gitattributes

So, If someone need it, can check the changes here: https://github.com/Shylex96/test-portfolio

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM