Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

tailwindcss-trump

AndyOGo152MIT1.1.2TypeScript support: included

Increase Tailwind CSS Specificity

tailwind, tailwindcss, trump, CSS specificity, plugin

readme

tailwindcss-trump

Increase Tailwind CSS Specificity - without ! important modifier.

Note: Repeated occurrences of the same simple selector are allowed and do increase specificity. https://www.w3.org/TR/selectors-3/#specificity

Installation

# npm
npm install tailwindcss-trump --save-dev

# yarn
yarn add --dev tailwindcss-trump

Configuration

Add the plugin to the plugins array of the tailwind config file.

// tailwind.config.js
module.exports = {
  // ...

  plugins: [
    // ...
    require("tailwindcss-trump"),
  ],
};

Optionally set your trump name in the config.

// tailwind.config.js
module.exports = {
  theme: {
    // ...
    trumpName: "bump",
    // will result in bump: variant
  },
  // ...
};

Usage

Use the trump: modifier (you can play with it here:

<div class="bg-red-500 bg-sky-500 h-4"></div>

<div class="trump:bg-red-500 bg-sky-500 h-4"></div>

<div class="trump:bg-red-500 trump:bg-sky-500 h-4"></div>

<div class="trump:trump:bg-red-500 trump:bg-sky-500 h-4"></div>

<div class="bg-red-500 bg-sky-500 trump:hover:bg-green-500 hover:bg-yellow-500 h-4"></div>

<div class="bg-red-500 bg-sky-500 trump:md:bg-green-500 md:bg-yellow-500 h-4"></div>

changelog

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

1.1.2 (2023-04-05)

1.1.1 (2023-04-04)

1.1.0 (2023-04-04)

Features

  • add tailwindcss trump plugin (b2cecb7)