Posts

Showing posts with the label Compass Sass

Can I Convert Css To Scss And Scss To Css Parallelly?

Answer : 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! Use a command for installing compass gem install compass Run this command. This will scan defined directory for css files and convert them to scss files. sass-convert -R my_css_dir --from css --to scss Then execute this command compass watch...

Can I Calculate And Use Element Height With SASS \ Compass

Answer : You seem to have got the XY problem. You have a task to solve, and instead of asking us about the task, you ask about a solution that you tried and already found inappropriate. Why do you want to apply the top property equal to half of element's height and negated? Because you want to move an absolutely positioned element half its height up . This is the original task. There's a simple solution to achieve that, and SASS is not even necessary! (Actually, as long as you don't know element's height, SASS can't provide more help than CSS.) We'll need an extra wrapper: <div class=container> <div class=elements-wrapper> <div class=element> </div> </div> </div> To push the element up for 50% of its height, do two simple steps: 1) Push its wrapper up fully out of the container: .elements-wrapper { position: absolute; bottom: 100%; } 2) Now pull the element down for 50% of its height: .ele...