Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(platforms_and_themes.md): extend appearance override info #7584

Merged
merged 3 commits into from
Sep 16, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions styleguide/pages/platforms_and_themes.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,34 @@ const appearance = useAppearance();
<Div>{appearance === 'light' ? 'Out of the blue' : 'And into the black'}</Div>;
```

> Стоит иметь ввиду, что некоторые компоненты делегируют цвет фона родителю выше, например, это
> компонент [Cell](#/Cell) и его производные.
>
> На примере [SimpleCell](#/SimpleCell) рассмотрим решение проблемы через допустимое определения
> фона посредством `className` или `style`:
>
> ```jsx static
> <Group header={<Header>Настройка тем</Header>}>
> <SimpleCell before={<Icon20PalleteOutline />}>Системная тема</SimpleCell>
> <AppearanceProvider value="dark">
> <SimpleCell
> before={<Icon20MoonOutline />}
> style={{ backgroundColor: 'var(--vkui--color_background_content)' }}
> >
> Тёмная тема
> </SimpleCell>
> </AppearanceProvider>
> <AppearanceProvider value="light">
> <SimpleCell
> before={<Icon20SunOutline />}
> style={{ backgroundColor: 'var(--vkui--color_background_content)' }}
> >
> Светлая тема
> </SimpleCell>
> </AppearanceProvider>
> </Group>
inomdzhon marked this conversation as resolved.
Show resolved Hide resolved
> ```

<br/>

### [@vkontakte/vkui-tokens](https://github.com/VKCOM/vkui-tokens)
Expand Down