0.1.1 • Published 1 year ago

tailwindcss-contain v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

tailwindcss-contain

A plugin that provides utilities for the contain CSS property.

Installation

Install the plugin from npm:

npm install -D tailwindcss-contain

Then add the plugin to your tailwind.config.js file:

// tailwind.config.js
module.exports = {
  theme: {
    // ...
  },
  plugins: [
    require('tailwindcss-contain'),
    // ...
  ],
};

Usage

<div class="relative rounded-xl contain-paint">
  <div class="absolute inset-0 bg-black"></div>
</div>

All contain keywords are available as utility classes via this plugin.

The contain property also supports the use of multiple keywords. You can use Tailwind's arbitrary values to use multiple keywords with this plugin.

CSS RuleClass
contain: nonecontain-none
contain: strictcontain-strict
contain: contentcontain-content
contain: sizecontain-size
contain: inline-sizecontain-inline-size
contain: layoutcontain-layout
contain: stylecontain-style
contain: paintcontain-paint
contain: size layoutcontain-[size_layout]

Note: If using multiple keywords ensure they are separated by an underscore (_), rather than a space ().

0.1.1

1 year ago

0.1.0

1 year ago