2022-06-10 15:56:15 +02:00
|
|
|
|
import type { CorePluginList } from './generated/corePluginList'
|
2022-03-22 10:24:28 +01:00
|
|
|
|
import type { DefaultColors } from './generated/colors'
|
|
|
|
|
|
|
|
|
|
|
|
// Helpers
|
|
|
|
|
|
type Expand<T> = T extends object
|
|
|
|
|
|
? T extends infer O
|
|
|
|
|
|
? { [K in keyof O]: Expand<O[K]> }
|
|
|
|
|
|
: never
|
|
|
|
|
|
: T
|
|
|
|
|
|
type KeyValuePair<K extends keyof any = string, V = string> = Record<K, V>
|
|
|
|
|
|
interface RecursiveKeyValuePair<K extends keyof any = string, V = string> {
|
|
|
|
|
|
[key: string]: V | RecursiveKeyValuePair<K, V>
|
|
|
|
|
|
}
|
2022-11-30 14:26:15 +01:00
|
|
|
|
export type ResolvableTo<T> = T | ((utils: PluginUtils) => T)
|
2022-10-13 14:01:17 -04:00
|
|
|
|
type CSSRuleObject = RecursiveKeyValuePair<string, null | string | string[]>
|
2022-03-22 10:24:28 +01:00
|
|
|
|
|
|
|
|
|
|
interface PluginUtils {
|
|
|
|
|
|
colors: DefaultColors
|
2022-03-31 23:58:31 +02:00
|
|
|
|
theme(path: string, defaultValue?: unknown): any
|
2022-03-22 10:24:28 +01:00
|
|
|
|
breakpoints<I = Record<string, unknown>, O = I>(arg: I): O
|
|
|
|
|
|
rgb(arg: string): (arg: Partial<{ opacityVariable: string; opacityValue: number }>) => string
|
|
|
|
|
|
hsl(arg: string): (arg: Partial<{ opacityVariable: string; opacityValue: number }>) => string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Content related config
|
|
|
|
|
|
type FilePath = string
|
|
|
|
|
|
type RawFile = { raw: string; extension?: string }
|
|
|
|
|
|
type ExtractorFn = (content: string) => string[]
|
|
|
|
|
|
type TransformerFn = (content: string) => string
|
|
|
|
|
|
type ContentConfig =
|
|
|
|
|
|
| (FilePath | RawFile)[]
|
|
|
|
|
|
| {
|
|
|
|
|
|
files: (FilePath | RawFile)[]
|
2022-09-23 08:09:02 -04:00
|
|
|
|
relative?: boolean
|
2022-03-22 10:24:28 +01:00
|
|
|
|
extract?: ExtractorFn | { [extension: string]: ExtractorFn }
|
|
|
|
|
|
transform?: TransformerFn | { [extension: string]: TransformerFn }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Important related config
|
|
|
|
|
|
type ImportantConfig = boolean | string
|
|
|
|
|
|
|
|
|
|
|
|
// Prefix related config
|
|
|
|
|
|
type PrefixConfig = string
|
|
|
|
|
|
|
|
|
|
|
|
// Separator related config
|
|
|
|
|
|
type SeparatorConfig = string
|
|
|
|
|
|
|
|
|
|
|
|
// Safelist related config
|
2023-03-29 16:54:57 -04:00
|
|
|
|
type SafelistConfig = (string | { pattern: RegExp; variants?: string[] })[]
|
2022-03-22 10:24:28 +01:00
|
|
|
|
|
2023-01-04 10:53:07 +00:00
|
|
|
|
// Blocklist related config
|
|
|
|
|
|
type BlocklistConfig = string[]
|
|
|
|
|
|
|
2022-03-22 10:24:28 +01:00
|
|
|
|
// Presets related config
|
|
|
|
|
|
type PresetsConfig = Config[]
|
|
|
|
|
|
|
|
|
|
|
|
// Future related config
|
2022-09-23 08:09:02 -04:00
|
|
|
|
type FutureConfigValues =
|
|
|
|
|
|
| 'hoverOnlyWhenSupported'
|
|
|
|
|
|
| 'respectDefaultRingColorOpacity'
|
|
|
|
|
|
| 'disableColorOpacityUtilitiesByDefault'
|
|
|
|
|
|
| 'relativeContentPathsByDefault'
|
2023-06-08 14:13:21 +02:00
|
|
|
|
| 'logicalSiblingUtilities'
|
2022-03-22 10:24:28 +01:00
|
|
|
|
type FutureConfig = Expand<'all' | Partial<Record<FutureConfigValues, boolean>>> | []
|
|
|
|
|
|
|
|
|
|
|
|
// Experimental related config
|
2023-06-08 14:13:21 +02:00
|
|
|
|
type ExperimentalConfigValues = 'optimizeUniversalDefaults' | 'oxideParser'
|
2022-03-22 10:24:28 +01:00
|
|
|
|
type ExperimentalConfig = Expand<'all' | Partial<Record<ExperimentalConfigValues, boolean>>> | []
|
|
|
|
|
|
|
|
|
|
|
|
// DarkMode related config
|
|
|
|
|
|
type DarkModeConfig =
|
2022-05-25 10:49:20 +01:00
|
|
|
|
// Use the `media` query strategy.
|
2022-03-22 10:24:28 +01:00
|
|
|
|
| 'media'
|
2022-09-23 08:09:02 -04:00
|
|
|
|
// Use the `class` strategy, which requires a `.dark` class on the `html`.
|
2022-03-22 10:24:28 +01:00
|
|
|
|
| 'class'
|
2022-09-23 08:09:02 -04:00
|
|
|
|
// Use the `class` strategy with a custom class instead of `.dark`.
|
2022-03-22 10:24:28 +01:00
|
|
|
|
| ['class', string]
|
|
|
|
|
|
|
2022-04-05 11:46:50 +01:00
|
|
|
|
type Screen = { raw: string } | { min: string } | { max: string } | { min: string; max: string }
|
|
|
|
|
|
type ScreensConfig = string[] | KeyValuePair<string, string | Screen | Screen[]>
|
|
|
|
|
|
|
2022-03-22 10:24:28 +01:00
|
|
|
|
// Theme related config
|
|
|
|
|
|
interface ThemeConfig {
|
2022-05-25 10:49:20 +01:00
|
|
|
|
// Responsiveness
|
2022-04-05 11:46:50 +01:00
|
|
|
|
screens: ResolvableTo<ScreensConfig>
|
2022-10-20 14:29:00 +02:00
|
|
|
|
supports: ResolvableTo<Record<string, string>>
|
2022-12-09 16:37:42 +01:00
|
|
|
|
data: ResolvableTo<Record<string, string>>
|
2022-03-22 10:24:28 +01:00
|
|
|
|
|
2022-05-25 10:49:20 +01:00
|
|
|
|
// Reusable base configs
|
2022-03-22 10:24:28 +01:00
|
|
|
|
colors: ResolvableTo<RecursiveKeyValuePair>
|
|
|
|
|
|
spacing: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
|
2022-05-25 10:49:20 +01:00
|
|
|
|
// Components
|
2022-03-22 10:24:28 +01:00
|
|
|
|
container: ResolvableTo<
|
|
|
|
|
|
Partial<{
|
2022-04-05 11:46:50 +01:00
|
|
|
|
screens: ScreensConfig
|
2022-03-22 10:24:28 +01:00
|
|
|
|
center: boolean
|
|
|
|
|
|
padding: string | Record<string, string>
|
|
|
|
|
|
}>
|
|
|
|
|
|
>
|
|
|
|
|
|
|
2022-05-25 10:49:20 +01:00
|
|
|
|
// Utilities
|
2022-03-22 10:24:28 +01:00
|
|
|
|
inset: ThemeConfig['spacing']
|
|
|
|
|
|
zIndex: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
order: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
gridColumn: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
gridColumnStart: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
gridColumnEnd: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
gridRow: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
gridRowStart: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
gridRowEnd: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
margin: ThemeConfig['spacing']
|
|
|
|
|
|
aspectRatio: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
height: ThemeConfig['spacing']
|
|
|
|
|
|
maxHeight: ThemeConfig['spacing']
|
|
|
|
|
|
minHeight: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
width: ThemeConfig['spacing']
|
|
|
|
|
|
maxWidth: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
minWidth: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
flex: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
flexShrink: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
flexGrow: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
flexBasis: ThemeConfig['spacing']
|
|
|
|
|
|
borderSpacing: ThemeConfig['spacing']
|
|
|
|
|
|
transformOrigin: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
translate: ThemeConfig['spacing']
|
|
|
|
|
|
rotate: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
skew: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
scale: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
animation: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
keyframes: ResolvableTo<KeyValuePair<string, KeyValuePair<string, KeyValuePair>>>
|
|
|
|
|
|
cursor: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
scrollMargin: ThemeConfig['spacing']
|
|
|
|
|
|
scrollPadding: ThemeConfig['spacing']
|
|
|
|
|
|
listStyleType: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
columns: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
gridAutoColumns: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
gridAutoRows: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
gridTemplateColumns: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
gridTemplateRows: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
gap: ThemeConfig['spacing']
|
|
|
|
|
|
space: ThemeConfig['spacing']
|
|
|
|
|
|
divideWidth: ThemeConfig['borderWidth']
|
|
|
|
|
|
divideColor: ThemeConfig['borderColor']
|
|
|
|
|
|
divideOpacity: ThemeConfig['borderOpacity']
|
|
|
|
|
|
borderRadius: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
borderWidth: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
borderColor: ThemeConfig['colors']
|
|
|
|
|
|
borderOpacity: ThemeConfig['opacity']
|
|
|
|
|
|
backgroundColor: ThemeConfig['colors']
|
|
|
|
|
|
backgroundOpacity: ThemeConfig['opacity']
|
|
|
|
|
|
backgroundImage: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
gradientColorStops: ThemeConfig['colors']
|
|
|
|
|
|
backgroundSize: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
backgroundPosition: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
fill: ThemeConfig['colors']
|
|
|
|
|
|
stroke: ThemeConfig['colors']
|
|
|
|
|
|
strokeWidth: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
objectPosition: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
padding: ThemeConfig['spacing']
|
|
|
|
|
|
textIndent: ThemeConfig['spacing']
|
2022-08-30 12:22:15 +01:00
|
|
|
|
fontFamily: ResolvableTo<
|
|
|
|
|
|
KeyValuePair<
|
|
|
|
|
|
string,
|
|
|
|
|
|
| string
|
|
|
|
|
|
| string[]
|
2023-02-08 17:39:43 +01:00
|
|
|
|
| [
|
|
|
|
|
|
fontFamily: string | string[],
|
|
|
|
|
|
configuration: Partial<{
|
|
|
|
|
|
fontFeatureSettings: string
|
|
|
|
|
|
fontVariationSettings: string
|
|
|
|
|
|
}>
|
|
|
|
|
|
]
|
2022-08-30 12:22:15 +01:00
|
|
|
|
>
|
|
|
|
|
|
>
|
2022-03-22 10:24:28 +01:00
|
|
|
|
fontSize: ResolvableTo<
|
2022-04-04 14:35:33 +01:00
|
|
|
|
KeyValuePair<
|
|
|
|
|
|
string,
|
|
|
|
|
|
| string
|
|
|
|
|
|
| [fontSize: string, lineHeight: string]
|
|
|
|
|
|
| [
|
2022-03-22 10:24:28 +01:00
|
|
|
|
fontSize: string,
|
|
|
|
|
|
configuration: Partial<{
|
|
|
|
|
|
lineHeight: string
|
|
|
|
|
|
letterSpacing: string
|
2022-07-05 05:01:06 +08:00
|
|
|
|
fontWeight: string | number
|
2022-03-22 10:24:28 +01:00
|
|
|
|
}>
|
|
|
|
|
|
]
|
2022-04-04 14:35:33 +01:00
|
|
|
|
>
|
2022-03-22 10:24:28 +01:00
|
|
|
|
>
|
|
|
|
|
|
fontWeight: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
lineHeight: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
letterSpacing: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
textColor: ThemeConfig['colors']
|
|
|
|
|
|
textOpacity: ThemeConfig['opacity']
|
|
|
|
|
|
textDecorationColor: ThemeConfig['colors']
|
|
|
|
|
|
textDecorationThickness: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
textUnderlineOffset: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
placeholderColor: ThemeConfig['colors']
|
|
|
|
|
|
placeholderOpacity: ThemeConfig['opacity']
|
|
|
|
|
|
caretColor: ThemeConfig['colors']
|
|
|
|
|
|
accentColor: ThemeConfig['colors']
|
|
|
|
|
|
opacity: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
boxShadow: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
boxShadowColor: ThemeConfig['colors']
|
|
|
|
|
|
outlineWidth: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
outlineOffset: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
outlineColor: ThemeConfig['colors']
|
|
|
|
|
|
ringWidth: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
ringColor: ThemeConfig['colors']
|
|
|
|
|
|
ringOpacity: ThemeConfig['opacity']
|
|
|
|
|
|
ringOffsetWidth: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
ringOffsetColor: ThemeConfig['colors']
|
|
|
|
|
|
blur: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
brightness: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
contrast: ResolvableTo<KeyValuePair>
|
2022-12-14 21:48:49 +07:00
|
|
|
|
dropShadow: ResolvableTo<KeyValuePair<string, string | string[]>>
|
2022-03-22 10:24:28 +01:00
|
|
|
|
grayscale: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
hueRotate: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
invert: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
saturate: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
sepia: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
backdropBlur: ThemeConfig['blur']
|
|
|
|
|
|
backdropBrightness: ThemeConfig['brightness']
|
|
|
|
|
|
backdropContrast: ThemeConfig['contrast']
|
|
|
|
|
|
backdropGrayscale: ThemeConfig['grayscale']
|
|
|
|
|
|
backdropHueRotate: ThemeConfig['hueRotate']
|
|
|
|
|
|
backdropInvert: ThemeConfig['invert']
|
|
|
|
|
|
backdropOpacity: ThemeConfig['opacity']
|
|
|
|
|
|
backdropSaturate: ThemeConfig['saturate']
|
|
|
|
|
|
backdropSepia: ThemeConfig['sepia']
|
|
|
|
|
|
transitionProperty: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
transitionTimingFunction: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
transitionDelay: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
transitionDuration: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
willChange: ResolvableTo<KeyValuePair>
|
|
|
|
|
|
content: ResolvableTo<KeyValuePair>
|
2022-03-31 23:58:31 +02:00
|
|
|
|
|
2022-05-25 10:49:20 +01:00
|
|
|
|
// Custom
|
2022-03-31 23:58:31 +02:00
|
|
|
|
[key: string]: any
|
2022-03-22 10:24:28 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Core plugins related config
|
|
|
|
|
|
type CorePluginsConfig = CorePluginList[] | Expand<Partial<Record<CorePluginList, boolean>>>
|
|
|
|
|
|
|
|
|
|
|
|
// Plugins related config
|
|
|
|
|
|
type ValueType =
|
|
|
|
|
|
| 'any'
|
|
|
|
|
|
| 'color'
|
|
|
|
|
|
| 'url'
|
|
|
|
|
|
| 'image'
|
|
|
|
|
|
| 'length'
|
|
|
|
|
|
| 'percentage'
|
|
|
|
|
|
| 'position'
|
|
|
|
|
|
| 'lookup'
|
|
|
|
|
|
| 'generic-name'
|
|
|
|
|
|
| 'family-name'
|
|
|
|
|
|
| 'number'
|
|
|
|
|
|
| 'line-width'
|
|
|
|
|
|
| 'absolute-size'
|
|
|
|
|
|
| 'relative-size'
|
|
|
|
|
|
| 'shadow'
|
|
|
|
|
|
export interface PluginAPI {
|
2022-05-25 10:49:20 +01:00
|
|
|
|
// for registering new static utility styles
|
2022-03-22 10:24:28 +01:00
|
|
|
|
addUtilities(
|
2022-07-01 16:48:28 -04:00
|
|
|
|
utilities: CSSRuleObject | CSSRuleObject[],
|
2022-03-22 10:24:28 +01:00
|
|
|
|
options?: Partial<{
|
|
|
|
|
|
respectPrefix: boolean
|
|
|
|
|
|
respectImportant: boolean
|
|
|
|
|
|
}>
|
|
|
|
|
|
): void
|
2022-05-25 10:49:20 +01:00
|
|
|
|
// for registering new dynamic utility styles
|
2022-10-13 14:01:17 -04:00
|
|
|
|
matchUtilities<T = string, U = string>(
|
|
|
|
|
|
utilities: KeyValuePair<
|
|
|
|
|
|
string,
|
|
|
|
|
|
(value: T | string, extra: { modifier: U | string | null }) => CSSRuleObject | null
|
|
|
|
|
|
>,
|
2022-03-22 10:24:28 +01:00
|
|
|
|
options?: Partial<{
|
|
|
|
|
|
respectPrefix: boolean
|
|
|
|
|
|
respectImportant: boolean
|
|
|
|
|
|
type: ValueType | ValueType[]
|
|
|
|
|
|
values: KeyValuePair<string, T>
|
2022-10-13 14:01:17 -04:00
|
|
|
|
modifiers: 'any' | KeyValuePair<string, U>
|
2022-03-22 10:24:28 +01:00
|
|
|
|
supportsNegativeValues: boolean
|
|
|
|
|
|
}>
|
|
|
|
|
|
): void
|
2022-05-25 10:49:20 +01:00
|
|
|
|
// for registering new static component styles
|
2022-03-22 10:24:28 +01:00
|
|
|
|
addComponents(
|
2022-07-01 16:48:28 -04:00
|
|
|
|
components: CSSRuleObject | CSSRuleObject[],
|
2022-03-22 10:24:28 +01:00
|
|
|
|
options?: Partial<{
|
|
|
|
|
|
respectPrefix: boolean
|
|
|
|
|
|
respectImportant: boolean
|
|
|
|
|
|
}>
|
|
|
|
|
|
): void
|
2022-05-25 10:49:20 +01:00
|
|
|
|
// for registering new dynamic component styles
|
2022-10-13 14:01:17 -04:00
|
|
|
|
matchComponents<T = string, U = string>(
|
|
|
|
|
|
components: KeyValuePair<
|
|
|
|
|
|
string,
|
|
|
|
|
|
(value: T | string, extra: { modifier: U | string | null }) => CSSRuleObject | null
|
|
|
|
|
|
>,
|
2022-03-22 10:24:28 +01:00
|
|
|
|
options?: Partial<{
|
|
|
|
|
|
respectPrefix: boolean
|
|
|
|
|
|
respectImportant: boolean
|
|
|
|
|
|
type: ValueType | ValueType[]
|
|
|
|
|
|
values: KeyValuePair<string, T>
|
2022-10-13 14:01:17 -04:00
|
|
|
|
modifiers: 'any' | KeyValuePair<string, U>
|
2022-03-22 10:24:28 +01:00
|
|
|
|
supportsNegativeValues: boolean
|
|
|
|
|
|
}>
|
|
|
|
|
|
): void
|
2022-05-25 10:49:20 +01:00
|
|
|
|
// for registering new base styles
|
2022-07-01 16:48:28 -04:00
|
|
|
|
addBase(base: CSSRuleObject | CSSRuleObject[]): void
|
2022-05-25 10:49:20 +01:00
|
|
|
|
// for registering custom variants
|
2022-03-22 10:24:28 +01:00
|
|
|
|
addVariant(name: string, definition: string | string[] | (() => string) | (() => string)[]): void
|
2022-10-13 14:01:17 -04:00
|
|
|
|
matchVariant<T = string>(
|
2022-10-12 12:24:46 +02:00
|
|
|
|
name: string,
|
2022-10-13 14:01:17 -04:00
|
|
|
|
cb: (value: T | string, extra: { modifier: string | null }) => string | string[],
|
|
|
|
|
|
options?: {
|
|
|
|
|
|
values?: KeyValuePair<string, T>
|
|
|
|
|
|
sort?(
|
|
|
|
|
|
a: { value: T | string; modifier: string | null },
|
|
|
|
|
|
b: { value: T | string; modifier: string | null }
|
2022-10-12 12:24:46 +02:00
|
|
|
|
): number
|
|
|
|
|
|
}
|
|
|
|
|
|
): void
|
2022-05-25 10:49:20 +01:00
|
|
|
|
// for looking up values in the user’s theme configuration
|
2022-03-22 10:24:28 +01:00
|
|
|
|
theme: <TDefaultValue = Config['theme']>(
|
|
|
|
|
|
path?: string,
|
|
|
|
|
|
defaultValue?: TDefaultValue
|
|
|
|
|
|
) => TDefaultValue
|
2022-05-25 10:49:20 +01:00
|
|
|
|
// for looking up values in the user’s Tailwind configuration
|
2022-03-22 10:24:28 +01:00
|
|
|
|
config: <TDefaultValue = Config>(path?: string, defaultValue?: TDefaultValue) => TDefaultValue
|
2022-05-25 10:49:20 +01:00
|
|
|
|
// for checking if a core plugin is enabled
|
2022-03-22 10:24:28 +01:00
|
|
|
|
corePlugins(path: string): boolean
|
2022-05-25 10:49:20 +01:00
|
|
|
|
// for manually escaping strings meant to be used in class names
|
2022-03-22 10:24:28 +01:00
|
|
|
|
e: (className: string) => string
|
|
|
|
|
|
}
|
|
|
|
|
|
export type PluginCreator = (api: PluginAPI) => void
|
2022-05-23 12:35:19 +02:00
|
|
|
|
export type PluginsConfig = (
|
|
|
|
|
|
| PluginCreator
|
2022-10-13 13:46:50 -04:00
|
|
|
|
| { handler: PluginCreator; config?: Partial<Config> }
|
2022-10-13 14:01:17 -04:00
|
|
|
|
| {
|
|
|
|
|
|
(options: any): { handler: PluginCreator; config?: Partial<Config> }
|
|
|
|
|
|
__isOptionsFunction: true
|
|
|
|
|
|
}
|
2022-05-23 12:35:19 +02:00
|
|
|
|
)[]
|
2022-03-22 10:24:28 +01:00
|
|
|
|
|
|
|
|
|
|
// Top level config related
|
|
|
|
|
|
interface RequiredConfig {
|
|
|
|
|
|
content: ContentConfig
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
interface OptionalConfig {
|
2022-03-22 11:53:40 +01:00
|
|
|
|
important: Partial<ImportantConfig>
|
|
|
|
|
|
prefix: Partial<PrefixConfig>
|
|
|
|
|
|
separator: Partial<SeparatorConfig>
|
|
|
|
|
|
safelist: Partial<SafelistConfig>
|
2023-01-04 10:53:07 +00:00
|
|
|
|
blocklist: Partial<BlocklistConfig>
|
2022-03-22 11:53:40 +01:00
|
|
|
|
presets: Partial<PresetsConfig>
|
|
|
|
|
|
future: Partial<FutureConfig>
|
|
|
|
|
|
experimental: Partial<ExperimentalConfig>
|
|
|
|
|
|
darkMode: Partial<DarkModeConfig>
|
2022-05-24 13:26:26 +01:00
|
|
|
|
theme: Partial<ThemeConfig & { extend: Partial<ThemeConfig> }>
|
2022-03-22 11:53:40 +01:00
|
|
|
|
corePlugins: Partial<CorePluginsConfig>
|
|
|
|
|
|
plugins: Partial<PluginsConfig>
|
2022-05-25 10:49:20 +01:00
|
|
|
|
// Custom
|
2022-03-22 10:24:28 +01:00
|
|
|
|
[key: string]: any
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export type Config = RequiredConfig & Partial<OptionalConfig>
|