|
vor 4 Jahren | |
---|---|---|
.. | ||
LICENSE.md | vor 4 Jahren | |
README.md | vor 4 Jahren | |
expansive.es | vor 4 Jahren | |
package.json | vor 4 Jahren |
Expansive plugin for CSS files.
The exp-css plugin provides build tooling for stylesheets. It provides the css.prefix service to automatically insert browser specific CSS prefixes, the css.render service to manage the generation HTML for stylesheets, and the minify-js service to minify script files for release distributions.
pak install exp-css
Provides the following transforms
The css service provides configuration control for the css transforms.
The css.prefix service processes CSS files to automatically add browser specific prefixes to CSS rules. It requires the autoprefixer
utility.
The css.render service smartly selects supplied stylesheets. By default, it selects minified stylesheets if a corresponding source map file with a 'css.map' extension is present. Otherwise, non-minified stylesheets files with a plain 'css' extension will be selected.
The renderStyles API will generate the HTML for the page to include the specified stylesheets. The styles are taken from the current 'styles' collection for the page. Use 'addItems' and 'removeItems' to modify the styles collection.
The renderStyles API may be invoked with an argument can specify a set of patterns to select a subset of stylesheets for which to create link elements. This can be used to select or reject specific stylesheets. A second argument can supply an array of additional stylesheets to render.
renderStyles(['!unwanted.css'], ['extra.css'])
The css.minify service optimizes stylesheets by minifying to remove white-space, managle names and otherwise compress the stylesheets. By default, the stylesheets use a '.css' extension, but will use a '.min.css' extension if the 'dotmin' option is enabled.
To support Content Security Policy headers, the css.extract service extracts inline styles into external Stylesheets. It will extract incline <style> elements and style attributes into a per-page external stylesheet file. If the extract attribute is set to a filename, then all the styles will be placed in that file.
The debug
collection will be selected if the package.json pak.mode
is set to debug. Similarly for the release
collection.
debug: {
services: {
"css": {
usemap: true
}
}
},
release: {
services: {
"css": {
minify: true
}
}
}