public final class Omakase extends Object
Example:
StyleWriter verbose = StyleWriter.verbose();
StandardValidation validation = new StandardValidation();
Omakase.source(input).use(verbose).use(validation).process();
verbose.writeTo(System.out);
Example:
StandardValidation validation = new StandardValidation();
StyleWriter inline = StyleWriter.inline();
Omakase.source(input)
.use(new Plugin() {
@Rework
public void rework(Selector selector) {
...
}
})
.use(new MyCustomPlugin())
.use(inline)
.use(validation)
.process();
inline.writeTo(System.out);
Unless you are specifically optimizing for performance you should usually add StandardValidation
, and it should
be added after any custom plugins.
For more usage information, see the readme.md file. Please note that the parser does not currently support the following:
cdo and cdc, escaping (in most cases)
Omakase.Request
Modifier and Type | Class and Description |
---|---|
static class |
Omakase.Request
Represents a CSS parsing operation.
|
Modifier and Type | Method and Description |
---|---|
static Omakase.Request |
source(CharSequence source)
Specifies the CSS source to parse.
|
public static Omakase.Request source(CharSequence source)
Omakase calls begin with this method, you then usually add some plugins and then finally end with .process()
.
Unless you are specifically optimizing for performance you should usually add StandardValidation
, and it should
be added after any custom plugins.
source
- The CSS source code.Omakase.Request
).Copyright (c) 2019, Salesforce.com, Inc. All rights reserved. Licensed under the BSD 3-Clause license. For full license text, see the LICENSE file in the repository.