Skip to content

API options

Gabriel Scatolin edited this page Sep 25, 2023 · 2 revisions

You can specify compilation options under the CSSCompilerOptions parameter, which:

Pretty

  • bool Pretty produces an pretty, formatted and indented output. Example:
main {
    position: relative;

    div + nav {
        color: red;
    }
}

Pretty:

main div + nav {
    color: red;
}

main {
    position: relative;
}

Non-pretty:

main div+nav{color:red}main{position:relative}

UseVarShortcut

  • bool UseVarShortcut specifies if the compiler should rewrite --variable to var(--variable) in the value context, example:
:root {
    --red: #FF1100;
}

div {
    color: --red;
}

Will be rewrited to:

div {
    color: var(--red);
}

And it will NOT rewrite if the variable is inside an string:

div {
    color: --red;
    background: url('--red');
}

// becomes:
div {
    color: var(--red);
    background: url('--red');
}
Clone this wiki locally