Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to handle scss and css in git?

I'm very new to scss and css so please bear with me. I've done some research but found conflicting information.

I have 2 freelancers working on my project. Both freelancers make changes to:

style.css
style.css.map
style.scss

Everytime I merge their work I break the frontend. How can I merge their work without breaking everything?

I read online that these files should not be included in GIT? I also read that I should used GULP or LESS? Apparently, I should compile the merged code before committing? Seriously confused with the research.

How do I handle these files?

like image 382
Boosted_d16 Avatar asked Aug 08 '18 12:08

Boosted_d16


People also ask

Can you use CSS and SCSS together?

scss files, Sass can import plain old . css files. The only rule is that the import must not explicitly include the . css extension, because that's used to indicate a plain CSS @import .

Is SCSS and CSS same?

CSS is a style language that is used to style and create web pages. While SCSS is a particular type of file for SASS, it used the Ruby language, which assembles the browser's CSS style sheets. SCSS contains advanced and modified features. SCSS is more expressive than the CSS.


1 Answers

The .css file is generated from the .scss files. Your developers should commit only in the .scss files. In the most cases the .css file is not added to the repository at all. And you should not modify the .css file directly because it will be replaced with the next compilation of .scss the files.

GULP is just the tool that compiles the .scss files and create the css from them. Basically when using GULP you can create some functions where you can specify the input location(.scss), output location(.css) and additional rules, etc.

There are also other tools that can do this. Like Koala, Webpack.

like image 54
NicuVlad Avatar answered Sep 21 '22 18:09

NicuVlad