Skip to main content
Deno 2 is finally here 🎉️
Learn more
Go to Latest
method postcss.CssSyntaxError.prototype.showSourceCode
Re-export
import { postcss } from "https://deno.land/x/bundler@0.6.5/deps.ts";
const { CssSyntaxError } = postcss;

Returns a few lines of CSS source that caused the error.

If the CSS has an input source map without sourceContent, this method will return an empty string.

error.showSourceCode() //=> "  4 | }
                       //      5 | a {
                       //    > 6 |   bad
                       //        |   ^
                       //      7 | }
                       //      8 | b {"

Parameters

optional
color: boolean

Whether arrow will be colored red by terminal color codes. By default, PostCSS will detect color support by process.stdout.isTTY and process.env.NODE_DISABLE_COLORS.

Returns

string

Few lines of CSS source that caused the error.