JSPM

@tkh/tailwind-plugin-logical-margin

1.3.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q15808F
  • License MIT

Tailwindcss plugin for margin utilities with logical properties

Package Exports

  • @tkh/tailwind-plugin-logical-margin

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-margin) 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-margin

Tailwindcss plugin for margin utilities with logical properties.

Install

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

Usage

Merge the plugin configuration with your tailwind.config.js

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

Adding margins

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

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

margin class
all sides m-{size}
horizontal mx-{size}
vertical my-{size}
single side `m{bs
negative `-m{bs