Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can I convert css to scss and scss to css parallelly?

I am planing to use sass/compass in a big project. is it possible that some team members can use simple css while others can still write scss?

what i exactly wants to know is the way compass/sass listen to scss and convert css the same moment can it also listen css file and convert back any changes in scss file ?

like image 733
nitesh sharma Avatar asked May 17 '12 10:05

nitesh sharma


People also ask

Can you use both CSS and SCSS?

The application renders fine with a mix of css and scss files. I assume this styleExt parameter is just there for the default component style ( css, scss, less ) file generation when adding components via angular-cli commands.

Can you convert CSS to SCSS?

This online tool will convert your CSS code into SCSS code. SCSS which stands for 'Sassy CSS' is a CSS Preprocessors. Simply enter your CSS code into the textbox below and click on convert, your SCSS code will then be available for download or you can copy to the clipboard.

How do I run a SCSS variable from another SCSS file?

To use variables across multiple files in SASS is carried out by @import rule of SASS. @import rule which import Sass and CSS stylesheets for providing variables, @mixins and functions. Such that combine all stylesheets together for compiled css. It also imports URL such as frameworks like Bootstrap etc..

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

It is possible, but not ideal. Your best bet is to crack open your terminal and run

sass-convert --from css --to scss

in the directory where your styles are located and then refactor from there. It's a pain, and not a true "conversion". It tries to nest properly, and usually gets it right, but if you're not refactoring the code and using things like mix-ins, extends, and variables, it kind of defeats the purpose of using SASS to begin with.

To automate this, you may want to use something like Guard to watch the css files for changes. You'll want to make sure you're not also watching your main style (the one that sass is compiling to), as this will put you in a never-ending loop of conversion!

like image 158
vinspee Avatar answered Oct 26 '22 08:10

vinspee