Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It is awkward to use classes containing numbers #335

Open
JohnDowson opened this issue Mar 28, 2022 · 2 comments · May be fixed by #336
Open

It is awkward to use classes containing numbers #335

JohnDowson opened this issue Mar 28, 2022 · 2 comments · May be fixed by #336

Comments

@JohnDowson
Copy link

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

@JohnDowson JohnDowson changed the title It is impossible yo use classes containing numbers. It is impossible to use classes containing numbers Mar 29, 2022
@lambda-fairy
Copy link
Owner

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 lambda-fairy changed the title It is impossible to use classes containing numbers It is awkward to use classes containing numbers Sep 18, 2022
@puetzp
Copy link
Contributor

puetzp commented Dec 11, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants