Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Latest
method postcss.CssSyntaxError.prototype.showSourceCode
Re-export
import { postcss } from "https://deno.land/x/fed_dev@0.9.0/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.