JSPM

@tkh/tailwind-plugin-logical-padding

1.2.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q29721F
  • License MIT

Tailwindcss plugin for padding utilities with logical properties

Package Exports

  • @tkh/tailwind-plugin-logical-padding

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@tkh/tailwind-plugin-logical-padding) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@tkh/tailwind-plugin-logical-padding

Tailwindcss plugin for padding utilities with logical properties.

Install

npm install @tkh/tailwind-plugin-logical-padding

Usage

Merge the plugin configuration with your tailwind.config.js

module.exports = {
  corePlugins: {
    padding: false,
  },
  variants: {
    padding: ['responsive', 'hover', 'focus'],
  },
  plugins: [require('@tkh/tailwind-plugin-logical-padding')()],
}

Adding padding

Adding padding is the same as a default Tailwindcss padding utilities except the tokens for selecting which side of an element to apply the padding.

Positional to logical mapping

positional (ltr) logical
t (top) bs (block-start)
r (right) ie (inline-end)
b (bottom) be (block-end)
l (left) is (inline-start)

Class names

padding class
all sides p-{size}
horizontal px-{size}
vertical py-{size}
single side `p{bs
negative `-p{bs