Search


Search something to see results

RenderOptions

Ast node render options

interface RenderOptions {
    beautify?: boolean;
    convertColor?: any;
    cwd?: string;
    expandNestingRules?: boolean;
    indent?: string;
    minify?: boolean;
    newLine?: string;
    output?: string;
    preserveLicense?: boolean;
    removeComments?: boolean;
    removeEmpty?: boolean;
    resolve?: (
        url: string,
        currentUrl: string,
        currentWorkingDirectory?: string,
    ) => ResolvedPath;
    sourcemap?: boolean | "inline";
    withParents?: boolean;
}

Hierarchy (View Summary)

Index

Properties

beautify?: boolean

Pretty print css

const result = await transform(css, {beautify: true});
convertColor?: any

Convert color to the specified color space. 'true' will convert to HEX

cwd?: string

Current working directory

expandNestingRules?: boolean

Expand nesting rules

indent?: string

Indention string

minify?: boolean

Minify css values.

newLine?: string

New line string

output?: string

Output file. Used for url resolution

preserveLicense?: boolean

Preserve license comments. License comments are comments that start with '/*!'

removeComments?: boolean

Remove comments

removeEmpty?: boolean

Remove empty nodes. Empty nodes are removed by default


const css = `
@supports selector(:-ms-input-placeholder) {

:-ms-input-placeholder {

}
}`;
const result = await transform(css, {removeEmpty: false});
resolve?: (
    url: string,
    currentUrl: string,
    currentWorkingDirectory?: string,
) => ResolvedPath

Resolve path

sourcemap?: boolean | "inline"

Generate sourcemap object. 'inline' will embed it in the css

withParents?: boolean

Render the node along with its parents