public class AutoPrefixer extends AssetProcessor
PostCSS plugin to parse CSS and add vendor prefixes to CSS rules using values from Can I Use. It is recommended by Google and used in Twitter, and Taobao.
assets {
pipeline {
dev: [auto-prefixer]
dist: [auto-prefixer]
}
}
Once configured, write your CSS rules without vendor prefixes (in fact, forget about them entirely):
:fullscreen a {
display: flex
}
Output:
:-webkit-full-screen a {
display: -webkit-box;
display: flex
}
:-moz-full-screen a {
display: flex
}
:-ms-fullscreen a {
display: -ms-flexbox;
display: flex
}
:fullscreen a {
display: -webkit-box;
display: -ms-flexbox;
display: flex
}
{
auto-prefixer {
browsers: ["> 1%", "IE 7"]
cascade: true
add: true
remove: true
supports: true
flexbox: true
grid: true
stats: {}
}
}
For complete documentation about available options, please refer to the autoprefixer site.
Constructor and Description |
---|
AutoPrefixer() |
Modifier and Type | Method and Description |
---|---|
boolean |
matches(org.jooby.MediaType type) |
String |
process(String filename,
String source,
com.typesafe.config.Config conf,
ClassLoader loader) |
excludes, get, options
public boolean matches(org.jooby.MediaType type)
matches
in class AssetProcessor
public String process(String filename, String source, com.typesafe.config.Config conf, ClassLoader loader) throws Exception
process
in class AssetProcessor
Exception
Copyright © 2019. All rights reserved.