-
-
Notifications
You must be signed in to change notification settings - Fork 100
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
feat: support arbitrary values using square bracket notation #148
Conversation
Pull Request Test Coverage Report for Build 668619386
💛 - Coveralls |
size-limit report 📦
|
Try the Preview Package
This PR has been published to npm.pkg.github.com as Install/Update Configure your NPM client (click to expand)
Using the command line: npm config set //npm.pkg.github.com/:_authToken <READ_PACKAGES_TOKEN> --global
npm config set @tw-in-js:registry https://npm.pkg.github.com --global # For npm
npm install --force twind@npm:@tw-in-js/twind@pr148
# For yarn - upgrade implies install
yarn upgrade twind@npm:@tw-in-js/twind@pr148 |
This is awesome, I'm surprised by what small changes were required to support this feature. Personally I have concerns over the pattern generally (in the sense that it undermines the whole design tokens philosophy) but that aside, we should probably support it for feature parity with Tailwind at least. It might end up being more useful in practice than I think. Really great job. Regards the enabling/disabling.. do you see any down sides of having it enabled by default? Maybe this could/should fall under the |
Should be enabled by default in my opinion. But we can not use |
Maybe something like |
Also Any configuration that you should do to make this work on this side? |
The README in The unit tests are called "arbitrary values": https://github.com/tailwindlabs/tailwindcss-jit/blob/v0.1.3/tests/08-arbitrary-values.test.html |
The problem here is that The same issue may affect several plugins. |
So either |
Do you have any estimated time when this will come out? We have a project in production that is waiting for this feature (we already got rid of @emotion) |
Just pushed an update with the two issues you reported. Could please you verify it works now as you expect? I plan to publish this one and #149 on the weekend, maybe tonight... |
That sounds great! Could you tell us more in https://github.com/tw-in-js/twind/discussions/categories/show-and-tell? |
I can confirm you that now is receiving the values very well!! If you update the package today it will be awesome 😍 |
I'm going to put the package into production by installing it from this PR 😂 for the excitement of all that it saves us |
@danestves There you go twind@0.16.4 |
I will share the URL for you to see it! |
This PR adds the new tailwindcss square bracket notation like
top-[-113px]
. Works with variants too, likemd:top-[-113px]
.This works in places where a theme value would be used. So almost everywhere.
I would like to add a config option to disable this feature. But I'm unsure of the name. Any pointers?
Which one do you prefer: arbitraryValues or dynamicValues?
Here are some examples: Not everyone works right now – working on colors vs other value
/cc @tw-in-js/contributors