About

This plugin splits CSS stylesheets to smaller files ("parts") which contain maximum X rules. It uses CSS Parser to parse source code.

CSS Parser supports following standards:

For more information read the split goal documentation or take a look into examples.

Goals Overview

Requirements

The plugin to run requires:

Usage

General instructions on how to use the CSS Splitter Maven Plugin can be found on the usage page. Some more specific use cases are described in the examples given below. Last but not least, users occasionally contribute additional examples, tips or errata to the plugin's wiki page.

In case you still have questions regarding the plugin's usage, please have a look at the FAQ.

If you feel like the plugin is missing a feature or has a defect, you can fill a feature request or bug report in the issue tracker. When creating a new issue, please provide a comprehensive description of your concern. Especially for fixing bugs it is crucial that the developers can reproduce your problem. For this reason, entire debug logs, POMs or most preferably little demo projects attached to the issue are very much appreciated. Of course, patches are also welcome. Contributors can check out the project from the source repository and will find supplementary information in the guide to helping with Maven.

License

The plugin is distributed under open source and commercial friendly "BSD 3-Clause" license:

Copyright (c) 2015, Adam Gabryƛ
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, 
are permitted provided that the following conditions are met: 
1. Redistributions of source code must retain the above copyright notice, this 
list of conditions and the following disclaimer. 
2. Redistributions in binary form must reproduce the above copyright notice, 
this list of conditions and the following disclaimer in the documentation and/or 
other materials provided with the distribution. 
3. Neither the name of the gabrys.biz nor the names of its contributors may be 
used to endorse or promote products derived from this software without specific 
prior written permission. 

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Download

You can download the plugin from docs pages or using various dependency management tools:

Example for Maven:

<project>
   ...
   <build>
      <plugins>
         ...
         <plugin>
            <groupId>biz.gabrys.maven.plugins</groupId>
            <artifactId>css-splitter-maven-plugin</artifactId>
            <version>2.0.3</version>
            <executions>
               <execution>
                  <id>default-split</id>
                  <goals>
                     <goal>split</goal>
                  </goals>
                  <configuration>
                     <!-- put your configurations here -->
                  </configuration>
               </execution>
            </executions>
         </plugin>
      </plugins>
   </build>
<project>

Examples

To provide you with better understanding of some usages of the CSS Splitter Maven Plugin, you can take a look into the following examples:

Versions

LATEST docs - the newest version under development

List of all available releases: 2.0.3, 2.0.2, 2.0.1, 2.0.0, 1.2.3, 1.2.2, 1.2.1, 1.2.0, 1.1.1, 1.1.0, 1.0.1, 1.0.0.

Version Changelog
2.0.3
(docs)

Dependencies:

2.0.2
(docs)

Bugs:

  • Fixed regex patterns should not be created needlessly (#30)
2.0.1
(docs)

Bugs:

  • Fixed colors should be written as hex codes instead of rgb functions (#28)
2.0.0
(docs)

Features:

  • Set compatibility with Java 6+
  • Set compatibility with Maven 3+

Bugs:

  • Fixed !important is missing in split code (#23)
  • Fixed special character sequences are interpreted instead of copied as is (#26)

Dependencies:

1.2.3
(docs)

Dependencies:

1.2.2
(docs)

Dependencies:

1.2.1
(docs)

Dependencies:

1.2.0
(docs)

Features:

  • Added support for nested @media rules in CSS 3.0
  • Added support for "star hack" in CSS 2.1 and 3.0 (see the starHackAllowed parameter)

Dependencies:

1.1.1
(docs)

Dependencies:

1.1.0
(docs)

Features:

  • Added code compression (see the compress parameter)
1.0.1
(docs)

Dependencies:

1.0.0
(docs)

Initial release