Skip to content
Tailwind CSS plugin to generate custom triangle components
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Initial commit Feb 17, 2019
.release-it.json
CHANGELOG.md
README.md
index.js
package-lock.json
package.json
test.js

README.md

Triangles Plugin for Tailwind CSS

Installation

npm install tailwindcss-triangles

Usage

// tailwind.config.js
{
  theme: {
    triangles: {
      'left': {
        direction: 'left',      // one of 'left', 'right', 'up', 'down', 'left-up', 'left-down', 'right-up', and 'right-down'
        size: '1em',            // defaults to defaultSize
        height: '0.5em',        // defaults to half the size; has no effect on the diagonal directions (e.g. 'left-up')
        color: 'currentColor',  // defaults to defaultColor
      },
    },
  },
  plugins: [
    require('tailwindcss-triangles')({
      componentPrefix: 'c-',        // defaults to 'c-'
      defaultSize: '1em',           // defaults to '1em'
      defaultColor: 'currentColor', // defaults to 'currentColor'
    }),
  ],
}

The above configuration would generate the following CSS:

.c-triangle-left {
  width: 0;
  height: 0;
  border-right: .5em solid currentColor;
  border-top: .5em solid transparent;
  border-bottom: .5em solid transparent;
}
You can’t perform that action at this time.