Bug fixes
This commit is contained in:
44
src/index.ts
44
src/index.ts
@ -17,30 +17,6 @@ export type BuildStyleFile = (
|
||||
path: string
|
||||
) => Promise<readonly ["css", string] | readonly ["js", string]>;
|
||||
|
||||
interface RecursiveStringObject {
|
||||
[modifier: string]: string | RecursiveStringObject;
|
||||
}
|
||||
|
||||
export type CSSAttributeValue = string | (string | RecursiveStringObject)[];
|
||||
|
||||
/**
|
||||
* Tagged template macro function combining Tailwind classes
|
||||
* @example "tw" => tw`p-2 text-center`
|
||||
*/
|
||||
export interface TailwindFunction {
|
||||
(strings: TemplateStringsArray): string;
|
||||
(...args: (string | RecursiveStringObject)[]): string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tagged template macro function compiling Tailwind styles
|
||||
* @example "tws" => tws`p-2 text-center` // { padding: 2, textAlign: "center" }
|
||||
*/
|
||||
export interface TailwindStyleFunction<Output = React.CSSProperties> {
|
||||
(strings: TemplateStringsArray): Output;
|
||||
(...args: (string | RecursiveStringObject)[]): Output;
|
||||
}
|
||||
|
||||
export interface TailwindPluginOptions {
|
||||
/**
|
||||
* Tailwind CSS configuration
|
||||
@ -74,22 +50,6 @@ export interface TailwindPluginOptions {
|
||||
*/
|
||||
jsxAttributeAction?: "delete" | "preserve" | ["rename", string];
|
||||
|
||||
/**
|
||||
* Template macro function to combine Tailwind classes
|
||||
* @example
|
||||
* declare const tw: TailwindFunction;
|
||||
* "tw" => tw`p-2 text-center`
|
||||
*/
|
||||
macroFunction?: string | undefined;
|
||||
|
||||
/**
|
||||
* Template macro function to compile Tailwind classes
|
||||
* @example
|
||||
* declare const tws: TailwindStyleFunction;
|
||||
* "tws" => tws`p-2 text-center` // { padding: 2, textAlign: "center" }
|
||||
*/
|
||||
macroStyleFunction?: string | undefined;
|
||||
|
||||
/**
|
||||
* The prefix to use for the generated class names.
|
||||
* @default className => `tw-${hash(className)}`
|
||||
@ -127,8 +87,6 @@ export type ResolveTailwindOptions = SetRequired<
|
||||
| "postCSSPlugins"
|
||||
| "styleMap"
|
||||
| "tailwindConfig"
|
||||
| "macroFunction"
|
||||
| "macroStyleFunction"
|
||||
>;
|
||||
|
||||
/**
|
||||
@ -160,8 +118,6 @@ export function getTailwindPlugins(options: TailwindPluginOptions) {
|
||||
jsxAttributeName: "css",
|
||||
postCSSPlugins: [],
|
||||
styleMap: new Map(),
|
||||
macroFunction: undefined,
|
||||
macroStyleFunction: undefined,
|
||||
tailwindConfig: {},
|
||||
...options,
|
||||
};
|
||||
|
Reference in New Issue
Block a user