1.0.2 • Published 5 months ago

tailwindcss-text-autospace v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

tailwindcss-text-autospace

Tailwind CSS plugin, add text-autospace CSS property.

Installation

Install the plugin from npm:

# Using npm
npm install -D tailwindcss-text-autospace

# Using Yarn
yarn add tailwindcss-text-autospace

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

/** @type {import('tailwindcss').Config} */
module.exports = {
  theme: {
    // ...
  },
  plugins: [
    require("tailwindcss-text-autospace"),
    // ...
  ],
}

Usage

autospace-{keyword} class to controls spacing between adjacent characters on the same line within the same inline formatting context using a set of character-class-based rules, allowing for automatic control over inter-script spacing and for spacing around punctuation.

<p class="autospace-none ...">
  <!-- ... -->
</p>
ClassProperties
autospace-normaltext-autospace: normal
autospace-nonetext-autospace: no-autospace
autospace-inserttext-autospace: insert
autospace-replacetext-autospace: replace
autospace-alphatext-autospace: ideograph-alpha
autospace-numerictext-autospace: ideograph-numeric
autospace-punctuationtext-autospace: punctuation
autospace-autotext-autospace: auto

Note: text-autospace CSS property is currently behind a flag in Chrome. To test it, enable the Experimental Web Platform features flag (found at chrome://flags/#enable-experimental-web-platform-features) in Chrome 120 or later.

Configuration

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

/** @type {import('tailwindcss').Config} */
module.exports = {
  theme: {
    textAutospace: {
      'normal': 'normal',
      'no': 'no-autospace',
      'auto': 'auto',
    },
  },
}

Extending the default theme

If you’d like to preserve the default values for a theme option but also add new values, add your extensions under the theme.extend key in your configuration file.

/** @type {import('tailwindcss').Config} */
module.exports = {
  theme: {
    extend: {
      textAutospace: {
        'future': 'future_value',
      },
    },
  },
}
1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago