feat: twind plugin (#513)
This adds a first-party twind plugin to use twind for styling.
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
import { h } from "preact";
|
||||
import { useState } from "preact/hooks";
|
||||
import { IS_BROWSER } from "$fresh/runtime.ts";
|
||||
import { tw } from "@twind";
|
||||
import { RoundedButton } from "../components/Button.tsx";
|
||||
import { IconMinus, IconPlus } from "../components/Icons.tsx";
|
||||
|
||||
@@ -13,9 +12,7 @@ interface CounterProps {
|
||||
export default function Counter(props: CounterProps) {
|
||||
const [count, setCount] = useState(props.start);
|
||||
return (
|
||||
<div
|
||||
class={tw`bg-gray-100 p-4 border border-gray-200 flex items-center justify-around`}
|
||||
>
|
||||
<div class="bg-gray-100 p-4 border border-gray-200 flex items-center justify-around">
|
||||
<RoundedButton
|
||||
title="Subtract 1"
|
||||
onClick={() => setCount(count - 1)}
|
||||
@@ -23,7 +20,7 @@ export default function Counter(props: CounterProps) {
|
||||
>
|
||||
<IconMinus />
|
||||
</RoundedButton>
|
||||
<div class={tw`text-3xl tabular-nums`}>{count}</div>
|
||||
<div class="text-3xl tabular-nums">{count}</div>
|
||||
<RoundedButton
|
||||
title="Add 1"
|
||||
onClick={() => setCount(count + 1)}
|
||||
|
||||
Reference in New Issue
Block a user