Jeremy
Jeremy

Reputation: 178

Polymer - iron-collapse don't work with padding/margin/border

As stated in the documentation, iron-collapses don't work with margin, padding or border; but I don't get why?

The documentation just says that "iron-collapses adjust the width or height of the collapsible element to show/hide content", how is that a relevant reason for not supporting margin or padding on the iron-collapse itself ?

Can someone explains that to me, please ?

Upvotes: 0

Views: 183

Answers (1)

Scott Miles
Scott Miles

Reputation: 11027

Calculating (and controlling/animating) sizes when padding/border/margin are involved can be a tricky business and it's a better strategy in general to avoid that problem.

Often you can put your padding/border/margin on elements inside or outside of the iron-collapse itself and get the rendering you want.

Upvotes: 1

Related Questions