File tree Expand file tree Collapse file tree 3 files changed +26
-1
lines changed
Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ function useTheme<T extends ThemeKeys>(
4848 return context ;
4949}
5050
51- type TWType = typeof tw ;
51+ export type TWType = typeof tw ;
5252
5353const AdaptUIProvider : React . FC <
5454 Partial < ThemeContextType & { children : React . ReactNode } >
Original file line number Diff line number Diff line change 11export * from "./context" ;
2+ export * from "./useTailwind" ;
Original file line number Diff line number Diff line change 1+ import { TWType , useTheme } from "./context" ;
2+
3+ type TailwindFunctions = {
4+ /**
5+ * ts is a function that takes any number of string/CSS classnames
6+ * as arguments and returns a Style object.
7+ */
8+ ts : TWType [ "style" ] ;
9+ /**
10+ * `gc` is a function that takes a Tailwind Color Classname
11+ * and returns the Hexcode.
12+ */
13+ gc : TWType [ "color" ] ;
14+ sc : TWType [ "setColorScheme" ] ;
15+ } ;
16+
17+ export const useTailwind = ( ) : TailwindFunctions => {
18+ const tailwind = useTheme ( ) ;
19+ return {
20+ ts : tailwind . style ,
21+ gc : tailwind . getColor ,
22+ sc : tailwind . setColorScheme ,
23+ } ;
24+ } ;
You can’t perform that action at this time.
0 commit comments