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

@mw-angular/tailwindcss-builder

v2.0.0

Published

Tailwindcss CLI Builder

Downloads

11

Readme

@mw-angular/tailwindcss-builder

This is the Angular CLI builder for TailwindCSS.

Getting Started

  1. Use the package manager to install library.
$ npm install -D tailwindcss postcss postcss-import autoprefixer @mw-angular/tailwindcss-builder
  1. Create and configure file tailwind.config.js, according to official documentation here.

You can omit purge option, it will be configured or enhanced for particular project automatically.

Example:

module.exports = {
  darkMode: false,
  theme: {
    extend: {},
  },
  variants: {
    extend: {},
  },
  plugins: [],
}
  1. Create CSS file tailwind.css.

Example:

@import "tailwindcss/base";
@import "./custom-base-styles.css";

@import "tailwindcss/components";
@import "./custom-components.css";

@import "tailwindcss/utilities";
@import "./custom-utilities.css";
  1. Configure target in angular.json.
"projects": {
  "website": {
    "architect": {
      ...
      "tailwindcss": {
        "builder": "@mw-angular/tailwindcss-builder:general",
        "options": {
          "themes": [
            {
              "configFile": "libs/design-system/src/styles/tailwind.config.js",
              "cssFile": "libs/design-system/src/styles/tailwind.css",
              "outputPath": "apps/website/src/styles",
              "outputFileName": "my-theme-name"
            }
          ]
        }
      },
      ...
    }
  }
}

As you can see, you can configure multiple themes.

  1. Run ng run website:tailwindcss.

For each theme two files will be created, one for development and one for production.

Don't forget to run this command each time you change tailwind configuration or input css file and before production build.

It is recommended to commit them.

To use this files add them to angular.json file for particular project:

"projects": {
  "website": {
    "architect": {
      ...
      "build": {
        "builder": "...",
        "options": {
          ...
          "styles": [
            "apps/website/src/styles/my-theme-name.dev.css"
          ],
          ...
        },
        "configurations": {
          "production": {
            ...
            "styles": [
              "apps/website/src/styles/my-theme-name.css"
            ],
            ...
          }
        }
      },
      "test": {
        "builder": "...",
        "options": {
          ...
          "styles": [
            "apps/website/src/styles/my-theme-name.dev.css"
          ],
          ...
        }
      },
      ...
    }
  }
}

Contributing

Pull requests to the repository are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Authors

License

This project is licensed under the terms of the MIT license.

You can check out the full license here.