Cool UI Preset based on UnoCSS
@coolui/preset
is the core of Cool UI, which defines various logics closely related to UnoCSS, including themes, CSS rules, CSS reference sequence, etc.
Layers
The order of CSS will affect their priorities. While the engine will retain the order of rules, sometimes you may want to group some utilities to have explicit control of their order.
Cool preset customizes the following layers:
ts
export const LAYER_PREFLIGHT = 'cool.preflight'
export const LAYER_BASE = 'cool.base'
export const LAYER_VARIANT = 'cool.variant'
export const LAYER_ICON = 'cool.icon'
export const LAYER_IMPORTANT = 'cool.important'
export const layers = {
[LAYER_PREFLIGHT]: -99,
[LAYER_BASE]: -98,
[LAYER_VARIANT]: -97,
[LAYER_ICON]: -96,
[LAYER_IMPORTANT]: -95,
}
Options
ts
export interface PresetCoolOptions {
// Theme style group that Cool UI depends on
theme: {
// default: blue
primary: string
// default: gray
cool: string
// default: #8c8c8c
info: string
// default: green
success: string
// default: yellow
warning: string
// default: red
error: string
}
// Corresponding preset options
// default: { dark: 'class' }
uno?: PresetUnoOptions
/*
* default:
* {
* extraProperties: {
* 'display': 'inline-block',
* 'vertical-align': 'middle',
* }
* }
*/
icons?: IconsOptions
// default: {}
attributify?: AttributifyOptions
}