nzakas/parser-lib — Issue #19: !important causing incorrect line/col
Author: nzakas
Created: 2011-11-28 20:17:27+00:00
State: open

(copied from https://github.com/stubbornella/csslint/issues/212)

I've implemented some custom rules that make use of the col of the property name and value, however when parsing properties featuring hex values and !important the col of the property value appears to be reported incorrectly. Example:

```css
.foo {
color: #fff !important;
}
```

When listening to the property event, I'd expect property.parts[0].col to equal 12. Instead I get 16 (the space after #fff). The values of event.property and event.value are:

```javascript
event.property: { col: 5, line: 2, text: 'color', type: 4, hack: null }
event.value: { col: undefined,
line: undefined,
text: '#fff',
type: 5,
parts:
[ { col: 16,
line: 2,
text: '#fff',
type: 'color',
red: 255,
green: 255,
blue: 255 } ] }
```

This issue does not occur in the following cases (col 12 is reported):

```css
.bar {
color: red !important;
}

.baz {
color: #f00;
}
```