React MUI fills properties clockwise
P粉312195700
P粉312195700 2023-07-25 10:17:02
0
1
462
<p>Does MuiBox have any populated shorthand properties? for clockwise syntax? </p><p>This is invalid and will cause a syntax error. </p> <pre class="brush:php;toolbar:false;"><Box padding = {2 1 1 2}/></pre> <p><br /></p>
P粉312195700
P粉312195700

reply all(1)
P粉950128819

Strictly speaking, there will be no such shorthand attribute, and the padding/p attribute only accepts a single spacing value. If you don't want to use the provided long-hand properties (pt, pr, pb, pl) and for some reason need to pass them as a list, the best way is to provide a function to the padding/p property from which Box can be derived value (if you don't want to use sx). For example:

<Box
  padding={(theme) => theme.spacing(2, 1, 1, 2)}
/>

Runnable CodeSandbox example code: : https://codesandbox.io/s/box-padding-example-r6v28m?file=/demo.tsx

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template