csstree / validator

CSS validator based on CSSTree
MIT License
65 stars 14 forks source link

Some CSS errors are not detected if they are at the start of the file, but detected when they are in the middle (?) #21

Open Stvad opened 3 years ago

Stvad commented 3 years ago

Example:

This generates no errors:

}  

.garden-link::before {
  content: "🦚"
 } 

This generates an error:

.garden-link::before {
  content: "🦚"
 } 

}

More generally I seem to be able to put semi-arbitrary things at the start of the file...

lahmatiy commented 3 years ago

Validator doesn't exam selectors at the moment. In first case } became a part of selector. In second case, } is a part of seelctor, but there is no block – that's why an error happens. I suppose, when selector validation will be added, this issue will be resolved.

Stvad commented 3 years ago

I see, thanks for the update! Is there anything I can do in the meantime to catch somethign like this?