-
-
Notifications
You must be signed in to change notification settings - Fork 32
Description
Feature Use Case
One of the really nice features of the PostCSS API is its Node.error() method, which returns a CssSyntaxError with all the information necessary to identify the location of errors in the source stylesheet. It would be really nice to be able to do the same thing for value nodes.
Feature Proposal
Although postcss-values-parser inherits the error(), but it's currently not very useful—it always returns an error with line 1, column 1, and no filename.
I propose that the parse() function take a node option which is a PostCSS node that indicates the context of the value being parsed. The node's filename, line, and column numbers can then be used to locate the value nodes within the parent stylesheet, which information can in turn be fed into the error() method to produce useful errors.