sebastiaanvisser / clay

A CSS preprocessor as embedded Haskell.
Other
357 stars 72 forks source link

No way to specify "border{direction}: none" #263

Open gfarrell opened 5 months ago

gfarrell commented 5 months ago

Sometimes I find myself needing to remove a border (often on last-child elements), but the following produces invalid CSS:

borderRight none none none
-- gives "border-right: none none none;" which the browser (Firefox in this case) rejects

Valid CSS would be border-right: none but I don't see a way to achieve this with Clay.

turion commented 4 months ago

I see, good finding.

A local workaround for you could be:

key "border" none

Solutions in the library might be to change the type signature of border and similar functions like borderRight to:

border :: Maybe (Size LengthUnit, Stroke, Color) -> CSS

Or:

data Border = Border
  { borderSize :: Size LengthUnit
  , borderStroke :: Stroke
  , borderColor :: Color
  }

border :: Maybe Border -> CSS

PRs welcome :)