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

Is it possible to get dots working in the variable names? #39

Closed
sebpowell opened this issue Aug 12, 2022 · 8 comments
Closed

Is it possible to get dots working in the variable names? #39

sebpowell opened this issue Aug 12, 2022 · 8 comments
Labels
Feature: added feature request question Further information is requested

Comments

@sebpowell
Copy link

sebpowell commented Aug 12, 2022

Versions:

  • Package Version: 2.3.0
  • Tailwindcss Version: 3.1.6

Question:

I'm trying to generate a variable name called --sizes-3.5 (and others like it – e.g. --sizes-0.5). Here's what I've tried:

{
      "0.5": "2px",
      "3.5": "14px",
}

The output however, ignores the '.' – so I just get:

--sizes-05, --sizes-35, etc.

I also tried escaping the dot, but no luck. Any ideas?

@sebpowell sebpowell added the question Further information is requested label Aug 12, 2022
@mertasan
Copy link
Owner

mertasan commented Aug 12, 2022

Hi Sebastien,

The variable syntax does not contain dots. Feel free to let me know if you have a specific use case for this.

https://developer.mozilla.org/en-US/docs/Web/CSS/--*

@mertasan mertasan closed this as not planned Won't fix, can't repro, duplicate, stale Aug 12, 2022
@mertasan
Copy link
Owner

screenshot 6

@sebpowell
Copy link
Author

sebpowell commented Aug 12, 2022

Hey Mert,

Thanks for the quick response!

Ok, I see – the use case was wanting to mimick the classes that Tailwind generates (that includes half sizes – e.g. .p-0.5).

Prior to finding your plugin, I was generating all these variables myself, and I was able to get this working by escaping the '.' like so: --sizes-0\.5 (I believe TW do this as well to generate their classes). See attached screenshot – this works fine.

I actually tried generating them this way using your plugin, but found that the period simply gets ignored altogether.

It's not a 'must-have' as I can find a way round it (I can simply write these variables manually somewhere), but thought it might make sense to add this in given that TW supports this with their classes.

Screenshot 2022-08-12 at 16 27 28

@mertasan
Copy link
Owner

Thanks for explaining. This is very logical! Please wait for the next release.

@sebpowell
Copy link
Author

@mertasan brilliant, thank you! Looking forward to it, let me know if you need any further input.

@mertasan
Copy link
Owner

@sebpowell

Please upgrade the plugin to ^2.5.0 🎉

@mertasan
Copy link
Owner

https://github.com/mertasan/tailwindcss-variables/blob/master/examples/simple/clean.css

@sebpowell
Copy link
Author

@mertasan brilliant, thank you for getting that sorted so quickly! I'll give it a go tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: added feature request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants