1.0.0 • Published 4 years ago

tailwindcss-outline v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

TailwindCSS-Outline

TailwindCSS plugin to create outline utility classes, analog to those for border.

ClassProperties
.outline-2outline-width: 1px;
.outline-2outline-width: 2px;
.outline-4outline-width: 4px;
.outline-8outline-width: 8px;
.outline-solidoutline-style: solid;
.outline-dashedoutline-style: dashed;
.outline-dottedoutline-style: dotted;
.outline-doubleoutline-style: double;
.outline-offset-1outline-offset: 2px;
.outline-offset-2outline-offset: 4px;
.outline-offset-3outline-offset: 8px;
.outline-offset-4outline-offset: 12px;
.-outline-offset-1outline-offset: -2px;
.-outline-offset-2outline-offset: -4px;
.-outline-offset-3outline-offset: -8px;
.-outline-offset-4outline-offset: -12px;
.outline-blackoutline-color: black;
.outline-whiteoutline-color: white;
.outline-{color}-{modifier}outline-color: {value}

Responsive

To control the outline style of an element at a specific breakpoint, add a {screen}: prefix to any existing outline style utility. For example, use md:outline-dotted to apply the outline-dotted utility at only medium screen sizes and above.

For more information about Tailwind's responsive design features, check out the Responsive Design documentation.

Customizing

By default, only responsive variants are generated for outline style utilities.

You can control which variants are generated for the outline style utilities by modifying the outlineWidth, outlineStyle, outlineOffset, and/or outlineColor properties in the variants section of your tailwind.config.js file.

For example, this config will also generate hover and focus variants for all utilities, except for outline-style:

// tailwind.config.js
module.exports = {
  variants: {
    // ...
    outlineWidth: ["responsive", "hover", "focus"],
    outlineStyle: ["responsive"],
    outlineOffset: ["responsive", "hover", "focus"],
    outlineColor: ["responsive", "hover", "focus"],
  }
}

Installation

# Install using npm
npm install --save-dev tailwindcss-outline

# Install using yarn
yarn add -D tailwindcss-outline

Usage

In your tailwind.config.js:

module.exports = {
  // …
  plugins: [
    // …
    require("tailwindcss-outline")
  ]
};