I'm looking for SASS implementation in Java (could be used with JSP/JSF). For Python I've found CleverCSS, but there is nothing for Java. Anyone heard something about this sort of tool for generating CSS?
You'll never need to install Sass again! Npm is a command line interface that comes bundled with the server framework, node. js.
Once you start tinkering with Sass, it will take your preprocessed Sass file and save it as a normal CSS file that you can use in your website. The most direct way to make this happen is in your terminal. Once Sass is installed, you can compile your Sass to CSS using the sass command.
Usage/Shortcuts. Click to Watch Sass from the status bar to turn on the live compilation and then click to Stop Watching Sass from the status bar to turn off live compilation.
With ANT:
<path id="JRuby"> <fileset file="libs/jruby-complete-[VERSION].jar"/> <!-- Location of JRuby jar file --> </path> <target name="compileSCSS"> <echo message="Compiling scss files..." /> <property name="filesIn" value="${dir.css}/scss/**/[^_]*.scss" /> <property name="fileOutDir" value="/${dir.css}/${dir.css.build}" /> <script language="ruby" classpathref="JRuby"> <![CDATA[ require 'libs/sass-[VERSION]/lib/sass' require 'sass/exec' files = Dir.glob($project.getProperty('filesIn')) Dir.mkdir($project.getProperty('fileOutDir')) unless File.exists?($project.getProperty('fileOutDir')) files.each do | file | puts " [sass compiler] " + file + " -> " + $project.getProperty('fileOutDir') + "/" + File.basename(file, ".*") + ".css" opts = Sass::Exec::Sass.new(["--load-path", File.dirname(file), file, File.join($project.getProperty('fileOutDir'), File.basename(file, ".*") + ".css")]) opts.parse end ]]> </script> <echo message="Done compiling scss files!" /> </target>
With MAVEN:
Maven can also do this: Using the antrun plugin:
<project> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <version>1.6</version> <executions> <execution> <id>compileAndMinify</id> <phase>compile</phase> <goals> <goal>run</goal> </goals> <configuration> <target> <mkdir dir="${project.build.directory}/compiled" /> <echo message="Compiling scss files..."/> <path id="JRuby"> <fileset file="${basedir}/jars/jruby-complete-[VERSION].jar"/> </path> <property name="filesIn" value="${project.build.directory}/css/**/[^_]*.scss" /> <property name="fileOutDir" value="${project.build.directory}/compiled/css" /> <script language="ruby" classpathref="JRuby"> <![CDATA[ require 'libs/sass-[VERSION]/lib/sass' require 'sass/exec' files = Dir.glob($project.getProperty('filesIn')) Dir.mkdir($project.getProperty('fileOutDir')) unless File.exists?($project.getProperty('fileOutDir')) files.each do | file | puts " [sass compiler] " + file + " -> " + $project.getProperty('fileOutDir') + "/" + File.basename(file, ".*") + ".css" opts = Sass::Exec::Sass.new(["--load-path", File.dirname(file), file, File.join($project.getProperty('fileOutDir'), File.basename(file, ".*") + ".css")]) opts.parse end ]]> </script> </target> </configuration> </execution> </executions> </plugin> </plugins> </build> </project>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With