maud icon indicating copy to clipboard operation
maud copied to clipboard

It is awkward to use classes containing numbers

Open JohnDowson opened this issue 3 years ago • 3 comments

Notably Bootstrap has alot of classes like mx-4, px-3, gy-2.

JohnDowson avatar Mar 28 '22 23:03 JohnDowson

Hi @JohnDowson, thanks for the suggestion and PR!

My primary concern with this (and the reason why numbers weren't permitted originally) is that in Rust proper, 0000069 and 69 are considered to be the same number. But if we allow your proposal, then Maud will introduce a distinction between the two. I'm unsure what implications this might have.

In particular:

  1. Does Rust itself guarantee that number literal tokens are passed through unchanged to proc macros? (So that the token 0000069 is not normalized to 69 or anything else.)
  2. What about other tools, like IDEs or code formatters?
  3. Finally, from a user's point of view, would they be confused by this?

Also, consider that there is already an alternative syntax (."mx-4"). See #267.

lambda-fairy avatar Apr 10 '22 11:04 lambda-fairy

For me this is more of a documentation issue than a matter of usability. However since I hit this problem myself and found this issue to resolve it, the documentation was updated and explains how to use the "alternative syntax" in order to use numbers in class names. From my point of view the docs are fine now and there is no need to spend (probably) a lot of time to evaluate the implications mentioned above.

puetzp avatar Dec 11 '23 09:12 puetzp