🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

tailwindcss-utils

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

tailwindcss-utils

This is a useful utility for tiny and simple tailwindcss.

0.0.2
unpublished
Source
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

NPM License NPM Downloads

Tailwindcss Utils

This is a useful utility for tiny and simple tailwindcss.

Installation

The easiest way to install tailwindcss-utils is with npm.

npm install tailwindcss-utils

Alternately, download the source.

git clone https://github.com/stegano/tailwindcss-utils.git

Example

repeat(prefix: string, tailwindcssClassNames: string): string

This function returns a tailwindcssClasName with prefix information.

...
tailwindUtils.repeat("after", "p-1 m-1") // ⇒ `after:p-1 after:m-1`
...

merge(classNameList: string[], customRules?: Record<string, RegExp>): string

  • This function can take multiple tailwindcss class values as arguments and merge them, and if there are duplicate class values, it uses the last input value.
...
tailwindUtils.merge("p-1 m-2", "m-2", "m-3") // ⇒ `p-1 m-3`
...

Advanced: Custom pattern

  • You can customize and use patterns that can identify the same class.
...
tailwindUtils.merge("p-1 m-2", "p-[100px]", {
  padding: /^p-(?:\d+|\[\d+?px\])$/,
}) // ⇒ `p-[100px] m-2`
...

convertToTailwindcss(style: CSS.Properties): {className: string; unconvertedStyle: CSS.Properties}

Converts CSS property values to Tailwindcss class. [!] This is an experimental feature.

tailwindUtils.convertToTailwindcss({
  padding: '10px',
  margin: '10px'
}); // ⇒ `p-[10px] m-[10px]`;

Keywords

tailwind

FAQs

Package last updated on 19 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts