From c35f1f6519e6f6955956143e32e53e6f9c6292cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20Tv=C3=A6rmose=20Gleerup?= Date: Mon, 18 Sep 2023 19:00:10 +0200 Subject: [PATCH] feat: Enable tailwind theme variables in twindv1 Options (#1776) --- plugins/twindv1/shared.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/plugins/twindv1/shared.ts b/plugins/twindv1/shared.ts index 0e3e9934..fb03888f 100644 --- a/plugins/twindv1/shared.ts +++ b/plugins/twindv1/shared.ts @@ -1,11 +1,18 @@ import { JSX, options as preactOptions, VNode } from "preact"; -import { setup as twSetup, Sheet, tw, TwindConfig } from "../twindv1_deps.ts"; +import { + BaseTheme, + setup as twSetup, + Sheet, + tw, + TwindConfig, +} from "$fresh/plugins/twindv1_deps.ts"; type PreactOptions = typeof preactOptions & { __b?: (vnode: VNode) => void }; export const STYLE_ELEMENT_ID = "__FRSH_TWIND"; -export interface Options extends TwindConfig { +export interface Options + extends TwindConfig { /** The import.meta.url of the module defining these options. */ selfURL: string; } @@ -19,7 +26,10 @@ declare module "preact" { } } -export function setup({ selfURL: _selfURL, ...config }: Options, sheet: Sheet) { +export function setup( + { selfURL: _selfURL, ...config }: Options, + sheet: Sheet, +) { twSetup(config, sheet); // Hook into options._diff which is called whenever a new comparison