I do write like that. Heck, even a mix of both: <SidebarItem marginRight={2} />, using Chakra-UI [1] (not too dissimilar to Tailwind in spirit).
Even the best design system needs local overrides to satisfy a product owner's incomprehensible requests, like "can we push that button a few pixels to the left?".
`2` in this case is a design token that is defined in a theme, that would resolve to a length defined in a CSS unit (ideally rem).
How would you handle a design change where a size becomes required that fits between "small" and "medium"? These things happen throughout the lifetime of a project.
Opaque numerical design tokens may not be the most explicit to understand, but they allow for expansion.
Note however that this API is brought by Styled System [1], which Chakra uses (and exposes), and adds the component library and other niceties on top.
My only regret with Chakra is that it's a tad runtime-heavy, and it's not really adapted to static content. I'd love to see some sort of compiler that digests a React tree into rendered HTML + CSS, with minimal JS just for style interactions (is this what Svelte does?)
Even the best design system needs local overrides to satisfy a product owner's incomprehensible requests, like "can we push that button a few pixels to the left?".
[1] https://chakra-ui.com/