hymhub / css-to-tailwind Goto Github PK
View Code? Open in Web Editor NEWConvert CSS code to Tailwindcss syntax in real time
Home Page: https://hymhub.github.io/css-to-tailwind/
License: MIT License
Convert CSS code to Tailwindcss syntax in real time
Home Page: https://hymhub.github.io/css-to-tailwind/
License: MIT License
Love this repo, incredible job with it! I think it has a ton of potential.
If you're accepting community contributions, I could open a PR to fix this myself. Lmk what you think!
height
doesn't use default values in the same way width
does.
Taken from the online demo
Input:
* {
width: 2rem;
height: 2rem;
}
Output:
w-8
h-[2rem]
The height
configuration has no reference to default values:
val => (isUnit(val) ? `h-${getUnitMetacharactersVal(val, [CustomSelect.vw]) || `[${val}]`}` : '')
On the other hand, the width
configuration does:
val => (isUnit(val) ? `w-${(useAllDefaultValues && getRemDefaultVal(val)) || getUnitMetacharactersVal(val, [CustomSelect.vh]) || `[${val}]`}` : '')
Thus, I believe we can fix this issue by using the useAllDefaultValues
function in the height configuration as well.
Could you convert the default values like 0.5rem/8px to 2 for padding for example.
So if you put in:
padding: 0.5rem;
it converts to:
p-2
Same for the margin attribute. Like you did for the width attributes.
font-size:3rem
output:
text-[3rem]
expected:
text-5xl
Hello @hymhub!
First of all, thank you for building this package! I've been going through some experiments with it and found out the dark
modifier isn't detected, is that expected behavior?
Hey this is a handy tool, thank you for building it! Curious if there's a way (or you already have plans to support this) to specify the output should use a given prefix. It's common in large projects that are migrating to Tailwind to use a prefix in the Tailwind config file in order to avoid style conflicts, so I could see it being very useful to have an option to configure this.
If you type a box-shadow in CSS. For example:
box-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
It turns into:
[box-shadow:inset_0_2px_4px_0_rgb(0_0_0_/_0.05)]
It should be:
shadow-inner
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.