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 1 commit
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
22 changes: 22 additions & 0 deletions styleguide/pages/platforms_and_themes.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,28 @@ const appearance = useAppearance();
<Div>{appearance === 'light' ? 'Out of the blue' : 'And into the black'}</Div>;
```

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

<br/>

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