What is the reason behind not generating spacing values in order? #2637
-
In tailwind config, spacings are like these;
But in generated css file, order is changing.
I realized this when I wanted to override p-0.5 with p-1, but result didn't change because of the generated order. This situation is same for others like, margin, inset... |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hey! Can't really speak about the reason behind this order (I actually never noticed these classes were generated in this specific order), but I am curious: In what scenario are you ever overriding |
Beta Was this translation helpful? Give feedback.
-
This is just a JS quirk, numeric keys always come first in objects when you loop over the keys. “0.5” is considered a string so it is grouped with “px”, but the integers are all hoisted to the top. |
Beta Was this translation helpful? Give feedback.
This is just a JS quirk, numeric keys always come first in objects when you loop over the keys. “0.5” is considered a string so it is grouped with “px”, but the integers are all hoisted to the top.