Giter Site home page Giter Site logo

dgknca / tailwindcss-full-bleed Goto Github PK

View Code? Open in Web Editor NEW
48.0 1.0 1.0 81 KB

A tailwindcss plugin that provides utilities for extended backgrounds and borders.

Home Page: https://dgknca.github.io/tailwindcss-full-bleed/

License: MIT License

JavaScript 52.69% HTML 6.75% CSS 40.56%
tailwindcss tailwindcss-plugin

tailwindcss-full-bleed's Introduction

tailwindcss-full-bleed

A plugin that provides utilities for extended backgrounds and borders.

Installation

Install the plugin from npm:

npm install -D tailwindcss-full-bleed

or

yarn add -D tailwindcss-full-bleed

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

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

Usage

Class Description
bleed-{color} Any tailwind color to specify the bleed color.
bleed-bg A background that extends to the left and right.
bleed-bg-l A background that extends to the left.
bleed-bg-r A background that extends to the right.
bleed-border 1px top and bottom border that extends to the left and right.
bleed-border-t 1px top border that extends to the left and right.
bleed-border-b 1px bottom border that extends to the left and right.
bleed-border-l 1px top and bottom border that extends to the left.
bleed-border-r 1px top and bottom border that extends to the right.
bleed-border-tl 1px top border that extends to the left.
bleed-border-tr 1px top border that extends to the right.
bleed-border-bl 1px bottom border that extends to the left.
bleed-border-br 1px bottom border that extends to the right.
bleed-border-br-2 2px bottom border that extends to the right.
bleed-border-br-4 4px bottom border that extends to the right.
bleed-border-br-8 8px bottom border that extends to the right.
bleed-border-br-[14px] 14px bottom border that extends to the right.
bleed-none To remove any full-bleeding.

Extending the Plugin

bleed-{color} and bleed-border-{borderWidth} values are using Tailwind's colors and borderWidth configuration. If you want to extend the classes provided by this plugin, you will need to extend the colors (or bleedColors) and borderWidth (or bleedBorderWidth) utilities in your tailwind.config.js file.

For example, to add a new color to the bleed-{color} utility, add the color to your colors configuration:

module.exports = {
  theme: {
    extend: {
      colors: {
        primary: {
          DEFAULT: '#4f46e5'
        }
      }
    }
  },
  // ...
}

Similarly, to add a new border width to the bleed-border utility, add the width to your borderWidth configuration:

module.exports = {
  theme: {
    extend: {
      borderWidth: {
        10: '10px'
      }
    }
  },
  // ...
}

If you want to add colors that only apply to bleed utilities, use bleedColors property instead:

module.exports = {
  theme: {
    extend: {
      bleedColors: {
        primary: {
          DEFAULT: '#4f46e5' // <- only avaiable for bleed-{color} classes
        }
      }
    }
  },
  // ...
}

If the same color is avaiable in colors, bleedColors will override the color value for bleed-{color} classes. Use bleedBorderWidth property for bleed only border widths as well.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.