tailwindcss-theme-variants
Advanced tools
Comparing version 0.3.1 to 0.4.0
@@ -1,86 +0,2 @@ | ||
import { AcceptedPlugin, AtRule, AtRuleNewProps, CommentNewProps, Container, Declaration, DeclarationNewProps, Parser, PluginInitializer, Processor, Stringifier, Root, Rule, RuleNewProps } from "postcss"; | ||
export declare type ThemeValue = string | string[] | number | { | ||
[key: string]: ThemeValue; | ||
} | undefined; | ||
export interface Theme { | ||
[key: string]: { | ||
[value: string]: NonNullable<ThemeValue>; | ||
}; | ||
} | ||
export declare type CorePluginsArray = string[]; | ||
export interface CorePluginsObject { | ||
[k: string]: boolean; | ||
} | ||
export declare type CorePlugins = boolean | CorePluginsArray | CorePluginsObject; | ||
export interface NestedObject { | ||
[k: string]: string | NestedObject; | ||
} | ||
export interface AddComponentsOptionsObject { | ||
respectPrefix?: boolean; | ||
variants?: VariantsValue; | ||
} | ||
export declare type AddComponentsOptions = AddComponentsOptionsObject | VariantsValue; | ||
export declare type VariantsValue = VariantsObject[keyof VariantsObject]; | ||
export interface AddUtilitiesOptionsObject { | ||
respectPrefix?: boolean; | ||
respectImportant?: boolean; | ||
variants?: VariantsValue; | ||
} | ||
export declare type AddUtilitiesOptions = AddUtilitiesOptionsObject | VariantsValue; | ||
export interface ModifySelectorsOptions { | ||
className: string; | ||
} | ||
export interface AddVariantGeneratorOptions { | ||
container: Container; | ||
modifySelectors: (modifierFunction: (options: ModifySelectorsOptions) => string) => void; | ||
separator: string; | ||
} | ||
export declare type AddVariantGenerator = (options: AddVariantGeneratorOptions) => void; | ||
export declare type ConfigValue = Theme | ThemeValue | CorePlugins | Plugin[] | undefined; | ||
export interface PostCSS { | ||
(plugins?: AcceptedPlugin[] | undefined): Processor; | ||
plugin<T>(name: string, initializer: PluginInitializer<T>): Plugin<T>; | ||
stringify: Stringifier; | ||
parse: Parser; | ||
comment(defaults?: CommentNewProps): Comment; | ||
atRule(defaults?: AtRuleNewProps): AtRule; | ||
decl(defaults?: DeclarationNewProps): Declaration; | ||
rule(defaults?: RuleNewProps): Rule; | ||
root(defaults?: any): Root; | ||
} | ||
export declare type PluginTools = { | ||
addBase: (baseStyles: NestedObject) => void; | ||
addComponents: (components: NestedObject, options: AddComponentsOptions) => void; | ||
addUtilities: (utilities: NestedObject, options: AddUtilitiesOptions) => void; | ||
addVariant: (name: string, generator: AddVariantGenerator) => void; | ||
config: (path: string, defaultValue: ConfigValue) => ConfigValue; | ||
e: (className: string) => string; | ||
postcss: PostCSS; | ||
prefix: (selector: string) => string; | ||
theme: <Default extends ThemeValue>(path: string, defaultValue: Default) => ThemeValue | Default; | ||
variants: <Default>(path: string, defaultValue: Default) => (VariantsObject[keyof VariantsObject]) | Default; | ||
}; | ||
export declare type BasicPlugin = (args: PluginTools) => void; | ||
export interface WrappedPlugin { | ||
handler: BasicPlugin; | ||
config: TailwindCSSConfig; | ||
} | ||
export declare type PluginFunction<Options> = (options: Options) => BasicPlugin; | ||
export declare type ConfigFunction<Options> = (options: Options) => TailwindCSSConfig; | ||
export declare type PluginWithOptions<Options> = (pluginFunction: PluginFunction<Options>, configFunction?: ConfigFunction<Options>) => BasicPlugin; | ||
export declare type Plugin<Options = null> = Options extends null ? (BasicPlugin | WrappedPlugin) : PluginWithOptions<Options>; | ||
export interface CreatePlugin { | ||
(plugin: BasicPlugin, config?: TailwindCSSConfig): WrappedPlugin; | ||
withOptions<Options>(pluginFunction: PluginFunction<Options>, configFunction?: ConfigFunction<Options>): (options: Options) => WrappedPlugin; | ||
} | ||
export interface VariantsObject { | ||
[utility: string]: string[]; | ||
} | ||
export interface TailwindCSSConfig { | ||
separator?: string; | ||
theme?: Theme; | ||
corePlugins?: CorePlugins; | ||
plugins?: Plugin[]; | ||
variants?: VariantsObject; | ||
} | ||
import { WrappedPlugin } from "@navith/tailwindcss-plugin-author-types"; | ||
export interface ThisPluginThemeSelectorAndMediaQuery { | ||
@@ -93,3 +9,3 @@ selector: string; | ||
}[Keys]; | ||
export declare type ThisPluginTheme = RequireAtLeastOne<ThisPluginThemeSelectorAndMediaQuery, "selector" | "mediaQuery">; | ||
export declare type ThisPluginTheme = RequireAtLeastOne<ThisPluginThemeSelectorAndMediaQuery>; | ||
export interface ThisPluginOptions { | ||
@@ -96,0 +12,0 @@ themes: { |
{ | ||
"name": "tailwindcss-theme-variants", | ||
"version": "0.3.1", | ||
"version": "0.4.0", | ||
"description": "JavaScript- or media-query-based theme variants with fallback for Tailwind CSS", | ||
@@ -31,10 +31,11 @@ "keywords": [ | ||
"postcss-selector-parser": "^6.0.2", | ||
"tailwindcss": "^1.5.1" | ||
"tailwindcss": "^1.5.2" | ||
}, | ||
"devDependencies": { | ||
"@navith/tailwindcss-plugin-author-types": "^0.0.4", | ||
"@types/assert": "^1.5.1", | ||
"@types/lodash": "^4.14.157", | ||
"@types/lodash": "^4.14.158", | ||
"@types/mocha": "^8.0.0", | ||
"@typescript-eslint/eslint-plugin": "^3.6.1", | ||
"@typescript-eslint/parser": "^3.6.1", | ||
"@typescript-eslint/eslint-plugin": "^3.7.0", | ||
"@typescript-eslint/parser": "^3.7.0", | ||
"cross-env": "^7.0.2", | ||
@@ -41,0 +42,0 @@ "eslint": "^7.5.0", |
28751
17
281
Updatedtailwindcss@^1.5.2