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

@averjs/tailwind

v3.0.1

Published

tailwind plugin for averjs

Downloads

49

Readme

@averjs/tailwind

This Plugin gets you started with tailwind. It adds tailwind as postcss plugin, changes the process-env stage to 1.

Installation

You just have to install the package and add it to the aver.config.js file to the plugins array.

yarn add @averjs/tailwind
// aver.config.js
{
  plugins: [
    '@averjs/tailwind'
  ]
}

Usage

By just running the aver command, the plugin checks if there are the following files (paths are relative to project root folder):

  • ./tailwind.config.js
  • ./src/tailwind.css

If they are not present, they are getting generated. The last thing you have to do is, to import the css file anywhere in your project.

Configuration

skipCreation

  • Type: boolean
  • Default: false

By setting this param to true, the creation of the tailwind.config.js and tailwind.css files are skipped and you have to set it up by yourself.

cssPath

  • Type: string
  • Default: ./

Change the path where the tailwind.css file should be created.

configPath

  • Type: string
  • Default: tailwind.config.js

Change the default path to the tailwind config file.

resolveConfig

  • Type: boolean | string | string[]
  • Default: false

Sometimes you need your tailwind config in javascript. Doing it yourself you cannot install tailwind in devDependencies, tailwind.config.js and the tailwind plugin is bundled into production. This adds unecessary KBs into your production files. This parameter helps you with this by creating a json file inside the aver cache folder and adds an alias to the webpack config for you to require it.

By just passing true, the whole config is resolved and saved inside a tailwind.config.json file. This json file can be referenced by require @tailwind.config.json.

You can also pass a string or an array of strings. This lets you resolve a specific path inside your tailwind config. This is helpfull when you just need eg. the colors from the config. This also saves KBs because the whole resolved config could take up quite some space. Interally we resolve those paths by using the lodash get function.

{
  plugins: [
    [ '@averjs/tailwind', { resolveConfig: 'theme.colors' } ]
  ]
}

This generates a tailwind.theme.colors.json file with the alias @tailwind.theme.colors.json, just holding the configured colors.

{
  plugins: [
    [ '@averjs/tailwind', { resolveConfig: [ 'theme.colors', 'theme.fontSize' ] } ]
  ]
}

This generates tailwind.theme.colors.json and tailwind.theme.fontSize.json files with the aliases @tailwind.theme.colors.json and @tailwind.theme.fontSize.json. Each file holds the given configuration.