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

styled-wind

v0.0.0-beta.14

Published

Use tailwind like classess in styled components

Downloads

35

Readme

Styled-wind

A magical implementation of tailwind-like classnames into styled-components.

GitHub Workflow Status Prettier Jest

What is styled wind?

Styled-wind is a CSS-in-JS library, written on top of styled-components. It inherits everything from styled-components and also gives you the flexibility to use tailwind classnames along with styled-components. Read the docs to know more.

Motivation

Styled-components is one of the most famous CSS-in-JS library and has been favorite styling tool in the React ecosystem. On the other hand, tailwind css has gained a lot of momentum recently because of the ease of use and quick development of responsive web apps. However, there are few practical issues in using tailwind css. This library is an attempt to get the best of both worlds.

See the Quick start guide for more details.

Why styled-wind?

  • Building Responsive sites becomes a lot easier
  • Very small bundle size to use in existing projects
  • 2 minutes migration to use tailwind in a styled-component project
  • Solving the readability issues of tailwind
  • Build reusable components / UI libraries
  • Dynamic styling using props
  • Benefits of tailwind in Component world of React & Styled-components
  • Remembering or writing CSS is not required
  • Tailwind like development for React Native

Prerequisite

Basic knowledge of styled-components and tailwindcss. The list of tailwind class names can be found here

Features

  • Zero-CSS
  • Responsive
  • Custom Styling/Theme
  • No class name bugs
  • Development speed
  • Automatic critical CSS
  • Easier maintenance of CSS
  • Automatic vendor prefixing
  • Simple dynamic styling
  • Tailwind is not required

Roadmap/TODO:

Contributions & Suggestions welcome

  • Auto intellisense, syntax highlighting and linting
  • Support for React Native
  • Allowing tailwind classes inside prop's conditions
  • CLI/Context for consuming custom styling
  • Add support for animation classes
  • Optimize the library

Caveats

  • React Native support is not added yet

  • Tailwind classnames aren't supported yet inside keyframes and expressions. However you may still use regular CSS for expressions & keyframes

    // Not allowed. Will be implemented in future
    const StyledComponent = styled.div`
            @keyframes mymove{
                from { .top-10 }
                to { .top-16 }
            }
        `;
    
    // Allowed
    const StyledComponent = styled.div`
      @keyframes mymove {
        from {
          top: 0px;
        }
        to {
          top: 200px;
        }
      }
    `;
  • Animation classes aren't supported yet.

  • Custom theme can currently be configured only inside index.html file

  • No support for variants as we find no dominant use case in component world

  • Please report if you happen to find any issues.

Examples

Check out the CodeSandBox to see styled-wind in use.

Community

The creators of the library are always open to discussions/suggestions. Their twitter accounts:

Contributors

Thanks goes to these awesome people for their wonderful contributions!

License

MIT © Product Ride