A
A
andrew_answer2018-08-23 19:09:52
css
andrew_answer, 2018-08-23 19:09:52

How to synchronize SCSS and CSS?

Hello everyone,
I have this problem. The project has a set of SCSS files and a CSS file that was once compiled from SCSS (sass style.scss:style.css --compass). After some time, clumsy developers manually pushed instructions into the CSS file and into SCSS, as a result, the files dispersed. The site uses only CSS. The project, of course, has Git.
Task: Synchronize SCSS and CSS to get CSS again by compiling SCSS files. We need to write an efficient solution algorithm. For example, a head-on solution: sass-convert style.css style.scss does not help, because all mixins and imports are lost.
Who has any ideas?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey delphinpro, 2018-08-23
@andrew_answer

I also got into such a situation ...
I solved it with painstaking manual labor.
To facilitate tracking, I made a copy of the css file, opened the copy and build in the diff viewer (in my case, the file comparison tool in phpstorm). The goal is to bring the build to identity with the current css version. For each diff, I made changes to sass, the diff was immediately updated after rebuilding, and I moved on to the next one.
PS. css copy should be reformatted with autoformat. And in sass include outputStyle="expanded"
Automatically, such a task can hardly be solved.

A
Anton Shamanov, 2018-08-23
@SilenceOfWinter

it seems everything is obvious - if you are too lazy to rewrite in scss, then just copy the missing lines from css into it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question