Package com.salesforce.omakase.writer

Examples of com.salesforce.omakase.writer.StyleWriter


        /** parses the CSS according to the specified configuration */
        public ParserResult parse() throws StyleParserException, QuickFixException {
            // determine the output compression level based on the aura mode
            Mode mode = Aura.getContextService().getCurrentContext().getMode();
            StyleWriter writer = mode.prettyPrint() ? StyleWriter.inline() : StyleWriter.compressed();

            if (!runtime) {
                // write annotated comments out on the initial pass, in case the runtime pass needs them
                writer.writeComments(true, true);
            }

            // do the parsing
            CssErrorManager em = new CssErrorManager(resourceName);
            PluginRegistry registry = Omakase.source(content).add(plugins).add(writer).add(em).process();

            // report any errors found during parsing
            em.checkErrors();

            // return the results
            ParserResult result = new ParserResult();
            result.content = writer.write();

            if (registry.retrieve(ThemeFunctionPlugin.class).isPresent()) {
                result.themeExpressions = registry.retrieve(ThemeFunctionPlugin.class).get().parsedExpressions();
            }

View Full Code Here

TOP

Related Classes of com.salesforce.omakase.writer.StyleWriter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.