npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tailwindcss-ts

v0.5.0

Published

Type-safe and professional structure to use tailwind in your project including custom tailwind configuration

Downloads

55

Readme

⚠️ Important note

The package still in its early stage and not ready for large scale use. The current versions only for testing the feasibility of that package

We are happy to hear from you all! For any recommendation or feedback, please find me on twitter @mramadanahmed

📚 Tailwindcss-ts

Tailwindcss-ts follow the simple concept of tailwind of generate the utility classes on demand to create a type-safe for it. In addition to utility functions help you to implement your tailwindcss and never use 'className' prop as normal string. The main focus of tailwindcss-ts library is consider your custom tailwindcss configuration ...Read more

🚀 Get Started

  1. Once you have your website ready with tailwindcss installed
  2. Install and run tailwind-ts
    npm i tailwindcss-ts@latest
  3. Run generate clis
    npx tailwindcss-ts
  4. Once it is done, src/tws folder will be generated on the root with the tailwind types and utilities for creating your classes
  5. In tailwind.config.js modify the content property to watch only the files of type ./src/**/*.tws.ts
  6. Create as many as tws.ts files as following
     import tws from "./tws";
    
     export const styles = tws.twsCreateStyleSheet({
         title: ["p-9", "text-amber-400"],
         subTitle: {
             default: ["text-green-300"],
             hover: ["hover:text-amber-700"],
             md: ["md:!text-black"],
             "2xl": ["2xl:mb-1"],
         },
     });
    
  7. Start using your styles as following
     import { styles } from "./App.tws";
    
     function App() {
         return (
             <div className={styles.title}>
             Hello World
             <div className={styles.subTitle}>Subtitle</div>
             </div>
         );
     }
    
     export default App;

🎛️ Features

  1. Type-safe
  2. Tailwind Custom Configuration
  3. Variants
  4. Conditional Styles

⚙️ Configuration

Create a file with name tws.json so you can customize tailwindcss-ts main functionality as following

{
  "tailwindConfig": "./tailwind.config.js",
  "tempDir":"./tws-temp"
  "outputSrc": "./src/tws",
  "customClasses": [
    "pt-[150px]"
  ]
}

🥷 Contributions

Every one is welcomed to contribute on that package by raising a PR. Here is steps to run it locally

  1. Clone the github repo
  2. Run pnpm i
  3. Run pnpm start

🧵 Bugs, Issues and Feedback

Please submit a new issue at github for any kind of discussion related to that package. Looking forward to get in touch very soon