Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Cathrine Alvin
Cathrine Alvin
12,184 Points

Sassify?

Can someone tell me how to best 'sassify' already witten css? (Imagine big, old projects in production, loads of css documents)

6 Answers

Tom Bedford
Tom Bedford
15,645 Points

A quick search turned up css2sass though I'm not sure of the usefulness of an automated solution for ongoing understanding of your code.

I had a go with it and it just nested everything that it could, keeping the general order and any comments the same. It doesn't seem to create mixins, variables etc. It may help as a starting point though I don't have experience converting older projects in this manner.

Look site without looking in CSS file see what should be the same. Take notes! Use Chrome dev tool under what files need work. DRY Take you time when looking over the site.

Cathrine Alvin
Cathrine Alvin
12,184 Points

Thanks Kevin,

I was more like wishfully thinking of a tool that would do it for me :)

Big old project is mostly likely got allot of place thing are close but not the same that should be the same. That will break any tools. How many people have worked on the project?

Cathrine Alvin
Cathrine Alvin
12,184 Points

My question was misplaced; forget about the big, old project. Does any good 'sassifying tool' exist? Any tips?

As far as a tool that will fix your code, no, but vanilla CSS is compatible with Sass as long as you're using Sassy CSS and not the legacy Ruby syntax. All you have to do is name the file with a .scss extension.