-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.ts
66 lines (60 loc) 路 1.79 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import { CatppuccinFlavors } from '@catppuccin/palette';
import type { PresetOptions } from '@unocss/core';
/**
* Which mode to use the preset with.
*
* `extend` mode will create new colours for current preset by using `extendTheme` function from UnoCSS.
*/
export type Modes = 'extend';
export interface UnoCSSCatppuccinOptions extends PresetOptions {
/**
* Which mode to use the preset with.
*
* `extend` mode will create new colours for current preset by using `extendTheme` function from UnoCSS.
*
* @default 'extend'
*/
mode: Modes;
/**
* Prefix for matching Catppuccin colours.
*
* @example
* ```html
* <!-- If the prefix is `ctp` -->
* <p class='text-ctp-mocha-red'>Hello world!</p>
* <p class='border-ctp-latte-base'>Hello world!</p>
* ```
*
* @default 'ctp'
*/
prefix?: string;
/**
* Default flavour for using Catppuccin colours
* directly with according colour labels.
*
* Note: If {@link ExtenderOptions.prefix} is set to `undefined`,
* and the desired colour already exists on the current preset,
* the Catppuccin colour will be prefixed with `ctp`.
*
* @example
* ```html
* <!-- Default prefix is `ctp` -->
* <p class='text-ctp-flamingo'>Hello world!</p>
* <!-- Let's make it `meow` -->
* <p class='text-meow-flamingo'>Hello world!</p>
*
* <!-- Lets make it a falsy value except `undefined`, for example `false` -->
* <!-- This will use current preset's colour! -->
* <p class='bg-red'>Hello world!</p>
* <!-- To use Catppuccin's colour, add the `ctp` prefix -->
* <p class='bg-ctp-red'>Hello world!</p>
* ```
*
* @default undefined
*/
defaultFlavour?: keyof CatppuccinFlavors;
}
export type ExtendOptions = Pick<
UnoCSSCatppuccinOptions,
'prefix' | 'defaultFlavour'
>;