-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Spacing): fix padding top with spacing tokens (#7632)
h2. Описание Сейчас в компоненте `Spacing` при прокидывании в проп `size` значение типа string('s', 'm', 'l' и т.д) и при добавлении children для компонента, не устанавливается паддинг сверху, есть только снизу h2. Изменения Поисследовав данную проблема, пришел к выводу, что css выражение с рассчетом паддингов `calc(1px * var(--vkui_internal--Spacing_gap) / 2)` при значении css переменной `--vkui_internal--Spacing_gap` в виде `${число}px` неправильно рассчитывается, то есть получается 0. Скорее всего, это из-за того, что мы умножаем значение на 1px. По крайней мере, если его убрать, то проблема пропадает. - Убрал умножение на 1px в css - Чтобы не сломался кейс со значениями типа number, сделал добавление px при прокидывании в css переменную - Убрал установку `height`, так как при добавлении `padding-block` `height` не нужен - Поправил тесты, скриншоты h2. Release notes h2. Исправление - Spacing: Поправлен баг с отсутствием верхнего отступа при прокидывании в `size` значение типа `string`
- Loading branch information
1 parent
3c9fcfe
commit fa75452
Showing
7 changed files
with
14 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
.../components/Spacing/__image_snapshots__/spacing-vkcom-chromium-light-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...c/components/Spacing/__image_snapshots__/spacing-vkcom-firefox-light-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...rc/components/Spacing/__image_snapshots__/spacing-vkcom-webkit-light-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.