feat: twind plugin (#513)

This adds a first-party twind plugin to use twind for styling.
This commit is contained in:
Luca Casonato
2022-08-09 21:41:11 +02:00
committed by GitHub
parent fd4e2bbe17
commit 660e0f5fef
20 changed files with 296 additions and 238 deletions
+3 -4
View File
@@ -1,6 +1,5 @@
/** @jsx h */
import { h } from "preact";
import { tw } from "@twind";
export default function NavigationBar(props: { active: string }) {
const items = [
@@ -15,13 +14,13 @@ export default function NavigationBar(props: { active: string }) {
];
return (
<nav class={tw`bg-green-200 py-2`}>
<ul class={tw`flex justify-center gap-8 mx-4`}>
<nav class="bg-green-200 py-2">
<ul class="flex justify-center gap-8 mx-4">
{items.map((item) => (
<li>
<a
href={item.href}
class={tw`text-gray-600 hover:underline ${
class={`text-gray-600 hover:underline ${
props.active == item.href ? "font-bold" : ""
}`}
>