Comments (14)
After thinking about this and porting tailwindlabs some plugins (@twind/forms, @twind/aspect-ratio and @twind/line-clamp) I'm leaning towards a new module which would create a twind configuration from a tailwind config:
import { setup } from 'twind'
import { compat } from 'twind/compat'
setup(
compat({
// Tailwind config
plugins: [
// List of tailwind plugins
]
})
)
Or even:
import { setup } from 'twind/compat'
setup({
// Tailwind config
plugins: [
// List of tailwind plugins
]
})
from twind.
Awesome tool, support for Tailwind UI would be great ❤️
We hope that we can achieve that.
from twind.
I was about to ask how to use tailwindcss plugins like the ones in tailwindUI (@tailwindcss/forms) , then i saw this. I will await the outcome of this, as i wanted to try using tailwind-UI with twind
from twind.
Awesome tool, support for Tailwind UI would be great ❤️
from twind.
Eager to use tailwindcss/forms!
@thelinuxlich @joshua1 You could try https://github.com/tw-in-js/twind-forms
from twind.
Honestly I do not believe it will happen any time soon. For now I try to provide the most common tailwind plugins as presets.
from twind.
#490 was opened so this should probably be reopened. I have an interest in seeing this supported for https://jsx.email
from twind.
Eager to use tailwindcss/forms!
from twind.
I love the concept! I hope that you consider exposing the mapper.
from twind.
Hello, how would you adapt https://github.com/stormwarning/tailwindcss-capsize ?
from twind.
Twind's primary developer mentioned a code refactoring in this comment (to align the typography plugin with others, and to hook into the autocompletion VSCode / Typescript extension):
tw-in-js/typography#2 (comment)
So I guess the developer uses some sort of template / scaffolding for creating such plugins. It would be great if a "create" Yarn / NPM utility was available to easily kick-start Twind plugins based on Tailwind ones :)
(this would make it possible for the Twind community to help build extensions to the core library)
from twind.
All plugins are written the same in principle. Whether they are core, supplementary or custom. Furthermore they are all just functions that get called when certain keywords are picked up by the compiler.
See here for docs: https://twind.dev/docs/handbook/advanced/plugins.html#plugins-without-arguments
With regards capsize, the principle is the same, so something like:
import { setup } from 'twind'
setup({
plugins: {
'capsize': ([font, size, lineHeight]) => {
return computeCapsize(font, size, lineHeight);
},
},
})
Where computeCapsize
returns some CSS-in-JS object with the appropriate values according to their algorithm. Now if the compiler came across capsize-sans-sm-tight
then it would go ahead and compute/inject the appropriate rules.
from twind.
Any updates on the compat API?
If not, what's the manual process of converting a tailwindcss plugin into a twind plugin? I'm new to tailwindcss and twind, but might be able to help with implementing a compatibility layer depending on the size and scope of such a project. If I'm unable, that information might inspire someone else to take on this feature.
Edit: I'm going to just switch to using the latest next release, it has a preset for the tailwindcss forms plugin that should meet my needs.
from twind.
Hey folks. This issue hasn't received any traction for 90 days, so we're going to close this for housekeeping. If this is still an ongoing issue, please do consider contributing a Pull Request to resolve it. Further discussion is always welcome even with the issue closed. If anything actionable is posted in the comments, we'll consider reopening it. ⓘ
from twind.
Related Issues (20)
- [Bug]: apply hoists before preflight HOT 1
- [Bug]: Style is prepend, not append HOT 4
- [Docs]: Help wanted! HOT 15
- How to make cssom() inject at the end of the document? HOT 5
- [Bug]: It is not possible to specify the stop position of the gradient color HOT 1
- [Bug]: Twind Intellisense is not working when I create project using fresh HOT 2
- [Feature]:@twind/with-web-components support function components and/or existing element instances using withTwind HOT 1
- [Bug]: no w-fit HOT 1
- [Feature]: flex-shrink-* is deprecated HOT 1
- missing data HOT 1
- How to use tailwindcss plugins? HOT 3
- Is there a way to make tailwind-scrollbar plugin to work with twind? HOT 3
- [Bug]: keyframes added with injectGlobal only contain the last keyframe HOT 2
- [Bug]: Classes added with injectGlobal can't reference each other with @apply HOT 2
- [Bug]: Classes added with injectGlobal can't be used with variants HOT 2
- [Feature]: allow peer dep of typescript v5 HOT 2
- [Bug]: max-w-{number} does not work
- defineConfig / setup mixed up[Docs]:
- Template literals like className={tw`bg-green-${c}`}
- How to style host and slot elements with Lit HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from twind.