plumatic / dommy

A tiny ClojureScript DOM manipulation and event library
759 stars 74 forks source link

set-style! padding doesn't work with negative values #55

Closed DanielaValero closed 10 years ago

DanielaValero commented 10 years ago

Hello,

I am trying to do this:

(dommy-attr/set-style! el :padding-top "-3px")

but it doesn't take the negative value, it works only for positive ones, tried as well with margin-top and it worked, so I switched to margin, just wanted to report this behaviour

cpetzold commented 10 years ago

This is because the box model doesn't support negative padding. set-style! essentially just calls something like el.style.setProperty('padding-top', '-3px').

Here's a good explanation and alternative method to using negative padding: http://stackoverflow.com/a/4974113

Thanks for the report!