Padding style property
rtpm opened this issue · comments
Hello,
I'm having problems with a padding style property :
Below does not work:
padding="10px 20px 15px 30px"
padding="10 20 15 30"
I could get this working using percent values.
The error I am getting is:
"JSON value '10 20 15 30' of type NSString cannot be converted to a ABI45_0_0YGValue. Did you forget the % or pt suffix ?"
I know I can use separate properties for top, bottom etc. but there's "padding" mentioned in the docs and maybe
I am doing it wrong, or there's a bug.
Thanks!
Hi @rtpm , thanks for the comment. I checked our supported schema. It looks like we don't support shorthand properties right now like in CSS. So you can set padding="10"
or padding="10%"
to use the same padding on all four sides. If you want to use different paddings on different sides, you need to use separate properties.
Linking to MDN docs here is confusing, I'll make a change to clarify.