简体   繁体   中英

How to view the compiled css from sass files in ruby on rails?

I've been learning sass on teamtreehouse and it shows how to view the css files that is compiled after writing sass. However, it's in a node environment.

How would I be able to view the compiled css from the sass code in rails? I can't seem to find a proper answer through google, or maybe there is no significance of viewing it, really? I think it would be beneficial to see what css is printed from sass code.

maybe there is no significance of viewing it

If you know what you're doing, why would you need to view it?

SASS is a pre-processor , meaning that it does nothing by way of enhancing CSS -- it simply takes your pseudocode and turns it into actual CSS:

在此处输入图片说明

I tell you now that if you have incorrect CSS in your SASS file, or other potential issues, SASS will tell you about it. From that perspective, there's no real reason to see your compiled SASS unless you want to see the structure of your code or something.

-

In regards to seeing the "compiled" SASS, you'll probably be best precompiling your assets :

$ rake assets:precompile RAILS_ENV=production

This will put production-level versions of the asset files into public/... , allowing you to see what the "compiled" version of them would be.

A pain, I know, but what can you do

If your files in public/stylesheets/sass will be compiled into CSS files in your public/stylesheets .You can also use the command sass-convert --help to get more information.

You get reference from here https://github.com/sass/sass

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM