logo CSS Splitter Maven Plugin

Splits CSS stylesheets to smaller files ("parts") which contain maximum X rules.

homepage:
fresh index:
last release: 3 months ago, first release: 2 years ago
packaging: maven-plugin
get this artifact from: central
see this artifact on: search.maven.org




This chart shows how much is this artifact used as a dependency in other Maven artifacts in Central repository and GitHub:


select version:

Add this snippet into pom.xml inside tag <project><build><plugins>:




Switch to artifact.
goals:
css-splitter:split (phase: process-sources)

Splits CSS stylesheets to smaller files ("parts") which contain maximum X rules. The plugin performs the following steps: reads source code parses it using the CSS Parser (parser removes all comments) splits parsed document to "parts" builds imports' tree writes "parts" to files During split process the plugin can divide "standard style" and @media rules, which size is bigger than 1, into smaller. Example: /* size is equal to 1, not splittable (size smaller than 2) */ @import 'file.css'; /* size is equal to 2, not splittable (not "standard style" or @media rule) */ @font-face { font-family: FontFamilyName; src: url("font.woff2") format("woff2"), url("font.ttf") format("truetype"); } /* size is equal to 4, splittable */ .element { width: 100px; height: 200px; margin: 0; padding: 0; } /* size is equal to 1, not splittable (size smaller than 2) */ selector1, selector2 > selector3 { width: 200px; } /* size is equal to 1 (for safety), not splittable (size smaller than 2) */ .empty { } /* size is equal to 1, not splittable (size smaller than 2) */ @media screen and (min-width: 480px) { } /* size is equal to 4 (1 + 2 + 1), splittable */ @media screen and (min-width: 480px) { /* size is equal to 1, not splittable (size smaller than 2) */ rule { width: 100px; } /* size is equal to 2, splittable */ rule2 { width: 100px; height: 100px; } /* size is equal to 1 (for safety), not splittable (size smaller than 2) */ .empty { } }


© Jiri Pinkas 2015 - 2018. All rights reserved. Admin login To submit bugs / feature requests please use this github page
related: JavaVids | Top Java Blogs | Java školení | 4npm - npm search | monitored using: sitemonitoring
Apache and Apache Maven are trademarks of the Apache Software Foundation. The Central Repository is a service mark of Sonatype, Inc.