nderscore / prettier-plugin-nativewind Goto Github PK
View Code? Open in Web Editor NEWThis project forked from tailwindlabs/prettier-plugin-tailwindcss
prettier-plugin-tailwindcss fork with support for NativeWind & more
License: MIT License
This project forked from tailwindlabs/prettier-plugin-tailwindcss
prettier-plugin-tailwindcss fork with support for NativeWind & more
License: MIT License
Hey, can we include this commit also?
It adds integration with https://github.com/ianvs/prettier-plugin-sort-imports
Thank you for making this fork and upstreaming your changes 🎉
There’s a couple use cases I think would be wonderful to have:
cva
array syntaxwindstitch
/ stylemapper
syntaxtw
syntaxI think you already support the tw
syntax via tailwindTaggedTemplates
. That’s already a really good escape hatch 😄 unfortunately, I couldn’t try it since I couldn’t get the fork to work locally
The cva
array syntax could be an additional option named something like tailwindArrayTemplates
and looks like:
import { cva } from "class-variance-authority";
const button = cva(["font-semibold", "border", "rounded"], {
variants: {
intent: {
primary: [
"bg-blue-500",
"text-white",
"border-transparent",
"hover:bg-blue-600",
],
// **or**
// primary: "bg-blue-500 text-white border-transparent hover:bg-blue-600",
secondary: [
"bg-white",
"text-gray-800",
"border-gray-400",
"hover:bg-gray-100",
],
},
size: {
small: ["text-sm", "py-1", "px-2"],
medium: ["text-base", "py-2", "px-4"],
},
},
compoundVariants: [
{
intent: "primary",
size: "medium",
class: "uppercase",
// **or** if you're a React.js user, `className` may feel more consistent:
// className: "uppercase"
},
],
defaultVariants: {
intent: "primary",
size: "medium",
},
});
The windstitch
syntax with w.componentname
doesn’t seem to be supported with tailwindCustomFunctions
, and I was unable to get your fork with tailwindFunctionCalls
working locally. I think the same option name could be used, or another one like tailwindMethodCalls
could be added. The syntax looks like:
import { w } from '@wind/react';
const Button = w.button('text-sm', {
variants: {
color: {
red: 'text-red-500',
blue: 'text-blue-500',
},
size: {
small: 'text-sm',
large: 'text-lg',
},
},
defaultVariants: {
size: 'small',
},
});
Currently, all props are hardcoded to ['class', 'className', 'tw']
It would be nice to have the ability to extend them.
Thanks for the fork 🤗
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.