thien-do / typed.tw Goto Github PK
View Code? Open in Web Editor NEWBrings types to TailwindCSS via TypeScript.
Home Page: https://typed.tw
Brings types to TailwindCSS via TypeScript.
Home Page: https://typed.tw
Currently the code to convert a Tailwind config to tw.ts
lies somewhere within the code of web application https://typed-tailwind.com/ . Since web app is only an interface to use the core converting, I suggest to separate the converting code into another place (e.g. lib/convert-tw.ts
).
With this separation, tests can be written to test only the Tailwind config converting logic. Or develop other interfaces on top of it (e.g. cli).
Currently whole page is blank. The easy way to "fix" is just to clear local storage
As title, the s
character is ...
The tool works with "-m4" but not "focus:-m4" because it checks class.startsWith("-")
. Should have a better check
Currently classes (and the instances of Style) are generated at run time. Performance-wise, it could be better if we can do it at compile time (and technically it's possible to do so).
Could be something like a Babel plugin or a Webpack loader.
Duplicate method names are generated for classes like md:w-2/4
and md:w-24
. The method for both is mdW24
.
Test case: https://gist.github.com/dvkndn/ab434cae1ee42528723f05159172f69f
As far as I remember it's because typed.tw only parses the part inside module.export.. which is so wrong..
I set up a quick script to avoid using the web service:
#!/usr/bin/env node
const { getSource } = require("typed-tailwind-convert");
const stdin = process.openStdin();
function convert() {
stdin.setEncoding("utf8");
stdin.on("data", data => {
getSource(data)
.then(console.log)
.catch(console.error);
});
}
convert();
Usage:
./convert < tailwind.config.js > src/tw.ts
Maybe it would be handy to include something like this to typed-tailwind-convert
?
Need to update the library so it works with latest version..
Either with:
Tw()...$()
(https://www.purgecss.com/extractors), or:Tw()...$()
at compile time so we get normal JS files with string-based class namesA 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.