Would you include SCSS/SASS inside of your repository?

Hi everyone,

I had recently learned about SCSS/SASS from a friend and installed it in my system. I want to include it in my project, but realized it has to be converted to normal CSS beforehand. I have a (private) GitHub repository with an Express backend, and the folder structure looks something like the following:

views -
    index.ejs
public -
    css -
        index.css
index.js
.gitignore

Should raw SASS/SCSS code be included inside of my repo, or should I just .gitignore it out, and simply convert it to vanilla CSS? If it should be included, what is the best folder structure that corresponds with my current layout?

Thank you!

5 Likes

You could probably use a GitHub Actions thing to build CSS from the SCSS files for GitHub Pages.

3 Likes

I have a backend, so I wouldn’t be able to do that (GitHub Pages only supports static sites IIRC). Should I even include raw SASS files inside of my repo anyway, or leave them .gitignore’d?

Then create a build script that runs before your server starts.

3 Likes

It does only support static sites, but those sites can have a build process that’s done using GitHub Actions (that’d be perfect for building your CSS)

Should I even include raw SCSS/SASS files inside of my repo anyway, or leave them .gitignore ’d, and just use the build script I will create to automatically build my CSS?

(I would use the build script regardless, but idk if I should include SASS inside of my repo at all though. Whats the best folder structure if I am to include it in my repo anyway?)

(@9pfs1 further explained on AMC, but I would like to recap for anyone else that might be wondering)

What I did was .gitignore the built CSS files (public/css/), and include the raw SCSS/SASS inside of my repository. I created a build script, tools/build.sh which would build all of the SASS and include it inside of that .gitignore’d public/css/ directory.

TLDR: Just include SASS and not your built CSS, use a build script to build the SASS into your CSS directory

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.