Welcome to the Treehouse Community
Looking to learn something new?
What to do when you realize you've been editing CSS instead of SCSS files?
I'm going through the Sass Basics course and have just discovered what Sass is and what it does. I also have realized that a website I inherited was originally built using Sass. I've been editing the CSS files for at least a year, with no clue that the scss versions even existed. It hasn't appeared to cause any problems, but it's such bad practice! I also don't want to pass problems along if they site lands in the lap of another developer or administrator.
What should I do?
Website uses WordPress and is built on Bootstrap 3.
Seth Kroger56,407 Points
This is a difficult question to answer because there is no one answer. It really depends on the specifics of your project and what you've done with it.
If it's been a year I would put the option of getting rid of the old Sass or otherwise marking them as old/obsolete on the table. Particularly if 1) you've made significant changes to the layout/styles or 2) aren't using version control. 1) is the harder factor to gauge. The more you've changed the harder it is to recreate (and recreate without errors). At some point the effort won't be worth it. It may be easier to convert your CSS to new Sass files or just keep the CSS. With 2) version control would make the job easier because you can get a "diff" of the changes you've made to the CSS that would guide you in editing the old Sass.
stjarnanFront End Web Development Techdegree Graduate 56,488 Points
You could do it in a series of steps like this:
- Take images of the layout and everything the css affected
- Copy the css and save it externally
- Start using sass and have it compile (this step will remove your css)
- Start implementing your css to the scss files and watch the changes comparing them to the images of how it should look.
This might be tedious but will work, and the css files will be saved in case you need to backup.
Thank you both! I think I may be a little too far down the rabbit hole at this point, so it would be a matter of new SCSS or sticking with CSS. A new website is on the horizon, so I can start with best practices then. Appreciate the ideas!