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

eleventy-plugin-tailwindcss

v0.3.0

Published

An Eleventy plugin to add Tailwind CSS support for your website

Downloads

93

Readme

Eleventy Plugin Tailwind CSS

npm version

An Eleventy plugin to add Tailwind CSS support for your website.

Installation

Available on npm.

npm install --save eleventy-plugin-tailwindcss

Usage

Open up your Eleventy config file (probably .eleventy.js) and add the plugin like so:

const pluginTailwindCSS = require("eleventy-plugin-tailwindcss");
module.exports = function(eleventyConfig) {
    eleventyConfig.addPlugin(pluginTailwindCSS);
};

You can also pass in options. For example, this will process the CSS file from src/css/main.css to _site/assets/main.css:

// Input directory: src
// Output directory: _site
eleventyConfig.addPlugin(pluginTailwindCSS, {
    src: "src/css/main.css",
    dest: "assets",
    keepFolderStructure: false,
    minify: false
    // See below for other available options
});

Options

src

  • Type: string | string[]
  • Default: your input dir + "**/*.css"

Paths (or glob patterns) to CSS files you want to process with Tailwind CSS, relative to the root of your project. To avoid any errors, we automatically exclude all files except those ending in .css.

:book: We use fast-glob as our low-level library for glob matching.

dest

New in v0.2.0

  • Type: string
  • Default: .

Where processed CSS files should be placed in the output folder.

Take a look at second example above, if you delete dest option, so that it returns to the default value (. which means right below the output folder), then the file will be placed at _site/main.css (Assuming your Eleventy output folder is _site).

configFile

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

Path to tailwind configuration file (if exists), relative to the root of your project.

watchEleventyWatchTargets

New in v0.2.5

  • Type: boolean
  • Default: false

In watch/serve mode with this option set to false (default), CSS will only rebuild when files in src option changes. However, if set to true, CSS will also rebuild when the files Eleventy watches changes, that includes your template files like .html, .njk, .md, etc. Useful when you want to use Tailwind's purge feature during development.

keepFolderStructure

New in v0.2.0

  • Type: boolean
  • Default: true

Indicates whether the input file folder structure will be preserved in the output.

Back to the second example again, if you set keepFolderStructure option to true, then the file will be placed at _site/assets/css/main.css (Assuming your Eleventy output folder is _site).

autoprefixer

  • Type: boolean
  • Default: true

Indicates whether an output file should be added browser specific prefixes (like -webkit or -moz) if needed using Autoprefixer.

autoprefixerOptions

  • Type: object
  • Default: {}

Options to pass to Autoprefixer. See available options here.

minify

  • Type: boolean
  • Default: true

Indicates whether an output file should be minified using cleanCSS.

minifyOptions

  • Type: object
  • Default: {}

Options to pass to cleanCSS. See available options here.

License

MIT © Dafiul Haq