Coder Social home page Coder Social logo

thien-do / typed.tw Goto Github PK

View Code? Open in Web Editor NEW
411.0 4.0 10.0 11.18 MB

Brings types to TailwindCSS via TypeScript.

Home Page: https://typed.tw

HTML 2.03% TypeScript 69.72% CSS 22.19% JavaScript 6.06%
typescript tailwind typed css tailwind-css purgecss tailwindcss

typed.tw's People

Contributors

hadeeb avatar ldhnam avatar phthhieu avatar stephenh avatar thien-do avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

typed.tw's Issues

Separate Tailwind config converting logic from web app

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).

Add error boundary

Currently whole page is blank. The easy way to "fix" is just to clear local storage

Simplify method chain

The current API calls are like this:

image

Would it be better to have something simpler.

Tw().bgfff.lt960FlexNone.lt960WFull.$()

The implementation could be done with Proxy.

Consider providing a cli for local generation

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.