Home > @xypnox/themescura

themescura package

Functions

Function

Description

convertToVar(theme, prefix)

Input a nested object and prefix Returns a new object with the keys replaced with css variables made from the prefix and the keys

cssConverter(theme)

Final css should be :root { // Base vars } (prefers-color-scheme: dark) { :root { // Dark mode vars } } (prefers-color-scheme: light) { :root { // Light mode vars } } .dark-mode { // This is added to the body tag } .light-mode { // This is added to the body tag } The class is selected last to override preference when it is set specifically by user

deepMerge(theme1, theme2)

flattenCss(theme)

Flatten a nested object to a flat object, The keys are replaced and joined with the newKey function that gives a key starting with — and joined with -

flattenObject(theme, newKey)

forObjectReplace(obj, replace)

generateTheme(palette, baseFn, modeFn)

Generate a theme from a palette

getShades(color, steps, shift)

invertLightness(color)

shiftLCH(color, shift)

typeScale(params)

Interfaces

Interface

Description

Palette

Theme

Variables

Variable

Description

defaultTypeScale

utopia

Type Aliases

Type Alias

Description

BaseTheme

Fn

PaletteFn

ThemeFn