Skip to content

Commit

Permalink
chore create custom tw merge configs
Browse files Browse the repository at this point in the history
  • Loading branch information
ryu-man committed May 13, 2024
1 parent fb34215 commit 5a0fef9
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions packages/core/src/internal/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type ClassValue, clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';
import { extendTailwindMerge } from 'tailwind-merge';

import type { SvelteComponent } from "svelte";
import type { Options as FocusTrapOptions } from "focus-trap";
Expand All @@ -9,6 +9,8 @@ import { bubble, listen } from "svelte/internal";
import { tabbable } from "tabbable";
import { createFocusTrap } from "focus-trap";

import { tailwindcssConfig } from '../../../tailwindcss/src'

// export { default as FlyoutSurface } from "./Flyout/FlyoutSurface.svelte";
// export { default as TooltipSurface } from "./Tooltip/TooltipSurface.svelte";
// export { default as MenuFlyoutSurface } from "./MenuFlyout/MenuFlyoutSurface.svelte";
Expand Down Expand Up @@ -214,6 +216,15 @@ export function createEventForwarder(component: SvelteComponent, exclude: string
};
}


const custom_tw_merge = extendTailwindMerge({
extend:{
theme: {
spacing: Object.keys(tailwindcssConfig.theme.extend.spacing)
}
}
})

export function classnames(...args: ClassValue[]): string {
return twMerge(clsx(...args));
return custom_tw_merge(clsx(...args));
}

0 comments on commit 5a0fef9

Please sign in to comment.