0.0.2 • Published 3 years ago

tailwindcss-square v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

tailwindcss-square

A plugin that provides utilities for visually rendering square containers.

Installation

Install the plugin from npm:

# Using npm
npm install tailwindcss-square

# Using Yarn
yarn add tailwindcss-square

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

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

Usage

Use the square-{n} utilities to specify the size of the square

<div class="square-15"></div>
<button class="square-30"></button>
<i class="square-45"></i>

Utilities for 3 square containers are generated by default:

ClassCSS
square-15width: 15px;height: 15px;min-width: 15px;
square-30width: 30px;height: 30px;min-width: 30px;
square-45width: 30px;height: 30px;min-width: 30px;

Configuration

You can configure which values and variants are generated by this plugin under the square key in your tailwind.config.js file:

// tailwind.config.js
module.exports = {
  theme: {
    extend: {
      square: {
        5: '5px',
        10: '10px',
        20: '20px',
        25: '25px',
      }
    }
  },
  variants: {
    square: ['responsive', 'hover']
  }
}