CSS Builder Plugin

The CSS Builder plugin lets you compile Sass files in your project.

Usage

To use the plugin, include it in your project’s root pom.xml file:

<build>
    <plugins>
    ...
        <plugin>
            <groupId>com.liferay</groupId>
            <artifactId>com.liferay.css.builder</artifactId>
            <version>3.0.0</version>
            <executions>
                <execution>
                    <id>default-build</id>
                    <phase>compile</phase>
                    <goals>
                        <goal>build</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
            </configuration>
        </plugin>
    ...
    </plugins>
</build>

You can view an example POM containing the CSS Builder configuration here.

Goals

The plugin adds one Maven goal to your project:

NameDescription
css-builder:buildCompiles the Sass files in the project.

Available Parameters

You can set the following parameters in the <configuration> section of the POM:

Parameter NameTypeDefault ValueDescription
appendCssImportTimestampsbooleantrueWhether to append the current timestamp to the URLs in the @import CSS at-rules.
baseDirFile"src/META-INF/resources"The base directory that contains the SCSS files to compile.
dirNamesList<String>["/"]The name of the directories, relative to baseDir, which contain the SCSS files to compile.
generateSourceMapbooleanfalseWhether to generate source maps for easier debugging.
importDirFilenullThe META-INF/resources directory of the Liferay Frontend Common CSS artifact. This is required in order to make Bourbon and other CSS libraries available to the compilation.
outputDirNameString".sass-cache/"The name of the sub-directories where the SCSS files are compiled to. For each directory that contains SCSS files, a sub-directory with this name is created.
precisionint9The numeric precision of numbers in Sass.
rtlExcludedPathRegexpsList<String> The SCSS file patterns to exclude when converting for right-to-left (RTL) support.
sassCompilerClassNameString"jni"The type of Sass compiler to use. Supported values are "jni" and "ruby". The Ruby Sass compiler requires com.liferay.sass.compiler.ruby.jar, com.liferay.ruby.gems.jar, and jruby-complete.jar to be added to the classpath.

You can also manage the com.liferay.frontend.css.common default theme dependency provided by the CSS Builder in your pom.xml. This can be modified by adding it as a project dependency:

<project>
    ...
    <dependencies>
        <dependency>
            <groupId>com.liferay</groupId>
            <artifactId>com.liferay.frontend.css.common</artifactId>
            <version>3.0.1</version>
            <scope>provided</scope>
        </dependency>
        ...
    </dependencies>
</project>

There are additional Liferay theme-related dependencies you can manage this way that are provided by the Theme Builder. See this section for more information.

« Bundle Support PluginDB Support Plugin »
Este artigo foi útil?
Utilizadores que acharam útil: 0 de 0