suonpera
suonpera

Reputation: 225

How to use sass (scss) compared to css

So to start off, let me introduce myself as a complete beginner. I want to get startet with scss, but I'm confused about how it works in regards to my css file. After having set of sass, and compiled my css to sass, should I then link my html to the sass file instead of to the css? And would I then delete my css file from the FTP and instead upload the sass file?

Thanks, Jonas the newbie.

Upvotes: 0

Views: 1172

Answers (2)

Ula
Ula

Reputation: 624

Nope. Scss file is just for you to write code in more convenient style. You should link html to main css file. And put on server only css file.

Good practice is break scss in small pieces and import to one scss file, which is transpiled to css.

F. ex. my main.scss file (transpiling to main.css linked to html site) looks like this:

// Layout
@import '_layout/_navbar';
@import '_layout/_main';
@import '_layout/_footer';
@import '_layout/_header';
@import '_layout/_blog';
@import '_layout/_aside';

// Components (you can replace the below ones to bootstrap or other framework's files just with components)
@import '_components/_blockquote';
....

This is the biggest asset of scss.

Upvotes: 1

Fla
Fla

Reputation: 627

scss or sass files are an improved syntax to write CSS, but remember that browsers can only understand CSS files. You can write a file with the sass or scss syntax, then compile it to a css file, and link this css file in your html file. So no, you will never upload anything else than the css file to your FTP.

Upvotes: 2

Related Questions