PluginAPI Type — tailwindcss Architecture
Architecture documentation for the PluginAPI type/interface in plugin-api.ts from the tailwindcss codebase.
Entity Profile
Dependency Diagram
graph TD 9b0e9e75_cc92_676d_a093_b9dccc675093["PluginAPI"] af1a6ece_0432_a556_fd63_8cb4a91f12ad["plugin-api.ts"] 9b0e9e75_cc92_676d_a093_b9dccc675093 -->|defined in| af1a6ece_0432_a556_fd63_8cb4a91f12ad style 9b0e9e75_cc92_676d_a093_b9dccc675093 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/tailwindcss/src/compat/plugin-api.ts lines 38–89
export type PluginAPI = {
addBase(base: CssInJs): void
addVariant(name: string, variant: string | string[] | CssInJs): void
matchVariant<T = string>(
name: string,
cb: (value: T | string, extra: { modifier: string | null }) => string | string[],
options?: {
values?: Record<string, T>
sort?(
a: { value: T | string; modifier: string | null },
b: { value: T | string; modifier: string | null },
): number
},
): void
addUtilities(
utilities: Record<string, CssInJs | CssInJs[]> | Record<string, CssInJs | CssInJs[]>[],
options?: {},
): void
matchUtilities(
utilities: Record<
string,
(value: string, extra: { modifier: string | null }) => CssInJs | CssInJs[]
>,
options?: Partial<{
type: string | string[]
supportsNegativeValues: boolean
values: Record<string, string> & {
__BARE_VALUE__?: (value: NamedUtilityValue) => string | undefined
}
modifiers: 'any' | Record<string, string>
}>,
): void
addComponents(utilities: Record<string, CssInJs> | Record<string, CssInJs>[], options?: {}): void
matchComponents(
utilities: Record<string, (value: string, extra: { modifier: string | null }) => CssInJs>,
options?: Partial<{
type: string | string[]
supportsNegativeValues: boolean
values: Record<string, string> & {
__BARE_VALUE__?: (value: NamedUtilityValue) => string | undefined
}
modifiers: 'any' | Record<string, string>
}>,
): void
theme(path: string, defaultValue?: any): any
config(path?: string, defaultValue?: any): any
prefix(className: string): string
}
Source
Frequently Asked Questions
What is the PluginAPI type?
PluginAPI is a type/interface in the tailwindcss codebase, defined in packages/tailwindcss/src/compat/plugin-api.ts.
Where is PluginAPI defined?
PluginAPI is defined in packages/tailwindcss/src/compat/plugin-api.ts at line 38.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free