Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Incorrect column reported when parsing hex values and !important #212

Closed
jadimmock opened this Issue · 0 comments

2 participants

@jadimmock

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:

.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:

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):

.bar {
    color: red !important;
}

.baz {
    color: #f00;
}

PS: Thanks for a great tool :)

@nzakas nzakas closed this in 536e416
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.