Currently, Declaration.name represents the text of the declaration name as it was written in the stylesheet, without any parsing or normalization. For example, DISPLAY: grid will have name: "DISPLAY" and displ\61y: grid will have name: "displ\\61y". This causes bugs in downstream tools that look for specific property names—for example, Autoprefixer won't expand either of those to display: -ms-grid, despite being the CSS spec considering them semantically identical to display: grid.
I propose that PostCSS fully parses escape sequences in declaration names and converts them to lower case, so that the assumption authors are already making that the properties are in their most well-known form is guaranteed. To ensure that stylesheets remain round-trippable, I further propose that name: {raw: string, value: string} be added to Declaration.raws to contain the original representation of the declaration's name.
Currently,
Declaration.namerepresents the text of the declaration name as it was written in the stylesheet, without any parsing or normalization. For example,DISPLAY: gridwill havename: "DISPLAY"anddispl\61y: gridwill havename: "displ\\61y". This causes bugs in downstream tools that look for specific property names—for example, Autoprefixer won't expand either of those todisplay: -ms-grid, despite being the CSS spec considering them semantically identical todisplay: grid.I propose that PostCSS fully parses escape sequences in declaration names and converts them to lower case, so that the assumption authors are already making that the properties are in their most well-known form is guaranteed. To ensure that stylesheets remain round-trippable, I further propose that
name: {raw: string, value: string}be added toDeclaration.rawsto contain the original representation of the declaration's name.