css variables for n3 interfaces
npm install @n3/css-base@n3/kit.
typescript
import type {
ThemeType,
} from '@n3/css-base';
`
Задание темы
❗❗❗❗❗❗❗❗❗❗❗❗❗❗❗❗❗❗❗❗❗❗❗❗❗❗❗
При использовании @n3/kit это делается автоматически
❗❗❗❗❗❗❗❗❗❗❗❗❗❗❗❗❗❗❗❗❗❗❗❗❗❗❗
`typescript
import {
getTheme,
listenThemeChange,
setTheme,
} from '@n3/css-base';
// установать тему
setTheme(theme);
// получить текущую тему
const theme = getTheme();
// следить за изменениями темы
const unsubscribe = listenThemeChange(() => {
const theme = getTheme();
// применить изменения темы
});
`
Встроенные темы
Стиль компонентов версий от 0.1.x до 0.14.x
`typescript
import { theme } from '@n3/css-base/themes/theme-1';
`
Стиль компонентов, начиная с версии 0.15.x
`typescript
import { theme } from '@n3/css-base/themes/theme-2';
``