styled-ppx icon indicating copy to clipboard operation
styled-ppx copied to clipboard

Improve error messaging when not filling entire property definitions (for example `box-shadow`)

Open rusty-key opened this issue 3 years ago • 1 comments

let shadow =  [%cx {|
  box-shadow: 0 0 0 1px gray, 0 1px black;
|}]

fails with:

invalid property value: 0 0 0 1px gray, 0 1px black

For reference, single shadow works:

let shadow =  [%cx {|
  box-shadow: 0 0 0 1px gray;
|}]

rusty-key avatar May 06 '22 13:05 rusty-key

Hi,

box-shadow (same as text-shadow) deserves a better error messaging here. Bot single values and multiple values are supported, but they need to be expressed with full form.

box-shadow:
      12px 12px 2px 1px rgba(0, 0, 255, .2),
      13px 14px 5px 6px rgba(2, 1, 255, 50%);

I will keep this issue open to remind me to improve the error message specifically for the properties that "half-match".

davesnx avatar May 06 '22 23:05 davesnx