@tbela99/css-parser
    Preparing search index...

    Function render

    • render the ast tree

      Parameters

      • data: AstNode
      • options: RenderOptions = {}

        Example:


        import {render, ColorType} from '@tbela99/css-parser';

        const css = 'body { color: color(from hsl(0 100% 50%) xyz x y z); }';
        const parseResult = await parse(css);

        let renderResult = render(parseResult.ast);
        console.log(result.code);

        // body{color:red}


        renderResult = render(parseResult.ast, {beautify: true, convertColor: ColorType.SRGB});
        console.log(renderResult.code);

        // body {
        // color: color(srgb 1 0 0)
        // }

      Returns RenderResult