0.8.1 • Published 5 months ago

@youthfulhps/tailwind-converter v0.8.1

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

tailwind-converter

Extracts the styles of a component defined through styled-components, converts it into a tailwind utility classes, and injects it into the className property of that element.

This is a converter library designed to automate parts of the work process for the productivity of developers working on the transition from styled-components to tailwindCSS.

I've tried to cover a variety of code-writing methods, but I admit it's not perfect. I recommend you to use it to the extent that you get help, and I promise to improve it steadily.

I hope it can be of little help.

Example

  • Before

before

  • After

after

Installation

This library provides a shell script. recommend a global installation for convenience.

~$ npm install -g @youthfulhps/tailwind-converter
~$ yarn add -g @youthfulhps/tailwind-converter
~$ pnpm add -g @youthfulhps/tailwind-converter

Usage

~$ tailwind-converter --target ${target file directory}

# example
~$ tailwind-converter --target ./src/components/Component.jsx

Limitation

Parameters passed to a tagged template literal function (styled) include interpolation for conditional style definitions. In this case, we're thinking about how to approach it, but because there's a lot of room for issues.

The current version replaces the interpolation contained in the style definition with the property 'unset' to convert it into a utility class, and also maintains the components defined by the function 'styled' to address the issue.

0.8.1

5 months ago

0.8.0

7 months ago

0.7.13

8 months ago

0.7.12

8 months ago

0.7.11

8 months ago

0.7.10

8 months ago

0.7.9

8 months ago

0.7.8

8 months ago

0.7.7

8 months ago

0.7.6

8 months ago

0.7.5

8 months ago

0.7.4

8 months ago

0.7.3

8 months ago

0.7.2

8 months ago