1.0.0 • Published 9 months ago

svelte-twc v1.0.0

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

svelte-twc

Overview

svelte-twc is a Svelte library that provides a way to use Tailwind CSS classes as components, inspired by TWC.

Motivation

Svelte is a great framework for building web applications, but it is difficult to use a lot of components with Tailwind CSS classes.

With svelte-twc, you can create components with Tailwind CSS classes easily.

Installation

This library supports only Svelte v5.

npm install svelte@next # Use Svelte v5
npm install svelte-twc

If you are using VSCode, you can use auto-completion. Please check TWC documentation.

Usage

<script lang="ts">
	import { twc } from 'svelte-twc';
	const Button = twc.button`bg-blue-500 text-white px-4 py-2 rounded-md`;
	const HoverableButton = twc(Button)`hover:bg-blue-600`;
</script>

<Button onclick={() => alert('hi')}>Click me</Button>
<HoverableButton>Hover me</HoverableButton>

License

MIT

1.0.0

9 months ago

0.4.3

9 months ago

0.4.1

1 year ago

0.4.0

1 year ago

0.3.1

1 year ago

0.4.2

11 months ago

0.3.0

1 year ago

0.2.0

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago