diff --git a/site/tests/index.test.ts b/site/tests/index.test.ts index 28baaee..6f0ec47 100644 --- a/site/tests/index.test.ts +++ b/site/tests/index.test.ts @@ -3,6 +3,5 @@ import { expect, test } from '@playwright/test'; test('render images with each plugins', async ({ page }) => { await page.goto('/'); - expect(await page.innerHTML('html')).toMatchSnapshot(); await expect(page).toHaveScreenshot({ fullPage: true }); }); diff --git a/site/tests/index.test.ts-snapshots/render-images-with-each-plugins-1-linux.txt b/site/tests/index.test.ts-snapshots/render-images-with-each-plugins-1-linux.txt deleted file mode 100644 index 1b6657c..0000000 --- a/site/tests/index.test.ts-snapshots/render-images-with-each-plugins-1-linux.txt +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - - - - - - - - - - svelte-twc - - -

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.

-

Setup

-

Setup tailwind.css in your project yourself.

-

You need to add the plugin to your Vite config like this:

-
import { sveltekit } from '@sveltejs/kit/vite';
-import { sveltetwc } from 'svelte-twc/vite';
-import { defineConfig } from 'vite';
-
-export default defineConfig({
-	plugins: [sveltekit(), sveltetwc()]
-});
-
-

Usage

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

Result:

- -
<script lang="ts">
-	import { twc } from 'svelte-twc';
-	const colorClass = "bg-gray-200 text-gray-800";
-	const centeredClass = "flex items-center justify-center";
-	const Container = twc.div([colorClass, centeredClass].join(" "));
-</script>
-
-<Container class="font-bold">...</Container>
-
-

Result:

-
<div class="bg-gray-200 text-gray-800 flex items-center justify-center font-bold">...</div>
-
- - -
- - - \ No newline at end of file