Skip to content

Commit 85f232e

Browse files
fix: fix components view with global box-sizing: border-box (#8268)
1 parent a5b436d commit 85f232e

File tree

17 files changed

+33
-7
lines changed

17 files changed

+33
-7
lines changed

packages/vkui/src/components/CustomScrollView/CustomScrollView.e2e-playground.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ export const CustomScrollViewWithBothScrollsPlayground = (props: ComponentPlaygr
1818
borderRadius: 10,
1919
border: '1px solid #000',
2020
padding: 10,
21+
boxSizing: 'content-box',
2122
}}
2223
>
2324
<CustomScrollView {...props} enableHorizontalScroll style={{ height: 300, width: 600 }}>
2425
<Div
2526
style={{
2627
width: 1440,
28+
boxSizing: 'content-box',
2729
}}
2830
>
2931
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed a sollicitudin lectus, a

packages/vkui/src/components/CustomScrollView/CustomScrollView.stories.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const Wrapper = (Story: PartialStoryFn<ReactRenderer>) => (
1313
width: '100%',
1414
maxWidth: '600px',
1515
maxHeight: '300px',
16+
boxSizing: 'content-box',
1617
}}
1718
>
1819
<Story />
@@ -36,6 +37,7 @@ export const Playground: Story = {
3637
<Div
3738
style={{
3839
width: 1440,
40+
boxSizing: 'content-box',
3941
}}
4042
>
4143
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed a sollicitudin lectus, a

packages/vkui/src/components/FormItem/FormItem.e2e-playground.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ export const FormItemPlayground = (props: ComponentPlaygroundProps) => {
7979
},
8080
]}
8181
>
82-
{(props: FormItemProps) => <FormItem {...props} style={{ maxWidth: '300px' }} />}
82+
{(props: FormItemProps) => (
83+
<FormItem {...props} style={{ maxWidth: '300px', boxSizing: 'content-box' }} />
84+
)}
8385
</ComponentPlayground>
8486
);
8587
};
@@ -128,7 +130,7 @@ export const FormItemTopAsidePlayground = (props: ComponentPlaygroundProps) => {
128130
{topAside}
129131
</FormItem.Top>
130132
}
131-
style={{ maxWidth: '300px' }}
133+
style={{ maxWidth: '300px', boxSizing: 'content-box' }}
132134
/>
133135
)}
134136
</ComponentPlayground>

packages/vkui/src/components/HorizontalScroll/HorizontalCellShowMore/HorizontalCellShowMore.module.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
}
1313

1414
.body {
15+
box-sizing: content-box;
1516
display: flex;
1617
flex-direction: column;
1718
align-items: center;

packages/vkui/src/components/IconButton/IconButton.module.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
box-shadow: none;
1919
}
2020

21+
/* stylelint-disable-next-line selector-pseudo-class-disallowed-list */
22+
.host :global(.vkuiIcon) {
23+
box-sizing: content-box;
24+
}
25+
2126
.sizeYCompact {
2227
block-size: 44px;
2328
}

packages/vkui/src/components/Mark/Mark.e2e-playground.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export const MarkPlayground = (props: ComponentPlaygroundProps) => {
55
return (
66
<ComponentPlayground {...props}>
77
{(props: MarkProps) => (
8-
<div style={{ width: 300, padding: 10, lineHeight: '1.6' }}>
8+
<div style={{ width: 300, padding: 10, boxSizing: 'content-box', lineHeight: '1.6' }}>
99
Ведь тебе нужен <Mark {...props}>Марк</Mark>, чтоб <Mark {...props}>получился марк</Mark>
1010
етинг
1111
</div>

packages/vkui/src/components/OnboardingTooltip/OnboardingTooltip.e2e-playground.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export const OnboardingTooltipPlayground = (props: ComponentPlaygroundProps) =>
3131
{(props: OnboardingTooltipProps) => (
3232
<OnboardingTooltipContainer
3333
style={{
34+
boxSizing: 'content-box',
3435
minWidth: '300px',
3536
height: '100px',
3637
position: 'relative',

packages/vkui/src/components/Panel/Panel.e2e-playground.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export const PanelPlayground = (props: ComponentPlaygroundProps) => {
3535
<div
3636
style={{
3737
height: '200px',
38+
boxSizing: 'content-box',
3839
overflow: 'auto',
3940
transform: 'translateZ(0)',
4041
// чтобы было проще видеть разницу скриншотов
@@ -66,7 +67,7 @@ export const PanelModePlayground = (props: ComponentPlaygroundProps) => {
6667
>
6768
{(props: PanelProps) => (
6869
<Panel {...props}>
69-
<div style={{ padding: '8px' }}>
70+
<div style={{ padding: '8px', boxSizing: 'content-box' }}>
7071
<Group mode={props.mode}>
7172
<div style={{ minHeight: '100px', minWidth: '100px' }}>
7273
Text within Group with mode {props.mode}

packages/vkui/src/components/PanelHeaderButton/PanelHeaderButton.module.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
box-shadow: none;
1111
}
1212

13+
/* stylelint-disable-next-line selector-pseudo-class-disallowed-list */
14+
.host :global(.vkuiIcon) {
15+
box-sizing: content-box;
16+
}
17+
1318
.host[disabled] {
1419
opacity: 0.6;
1520
}

packages/vkui/src/components/PullToRefresh/PullToRefresh.e2e-playground.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const PullToRefreshPlayground = (
99
return (
1010
<ComponentPlayground {...playgroundProps} platform="vkcom">
1111
{({ ...props }: PullToRefreshProps) => (
12-
<Div style={{ width: '300px', paddingLeft }}>
12+
<Div style={{ width: '300px', paddingLeft, boxSizing: 'content-box' }}>
1313
<PullToRefresh {...props}>
1414
<div
1515
style={{
@@ -44,7 +44,7 @@ export const PullToRefreshChildrenPositionPlayground = (props: ComponentPlaygrou
4444
return (
4545
<ComponentPlayground {...props} platform="vkcom">
4646
{({ ...props }: PullToRefreshProps) => (
47-
<Div style={{ width: '300px', height: '500px', display: 'flex' }}>
47+
<Div style={{ width: '300px', height: '500px', display: 'flex', boxSizing: 'content-box' }}>
4848
<PullToRefresh {...props}>
4949
<div
5050
style={{

packages/vkui/src/components/Search/Search.module.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.host {
2+
box-sizing: content-box;
23
display: flex;
34
overflow: hidden;
45
-webkit-tap-highlight-color: transparent;

packages/vkui/src/components/SimpleCell/SimpleCell.module.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232

3333
/* stylelint-disable-next-line selector-pseudo-class-disallowed-list */
3434
.before > :global(.vkuiIcon) {
35+
box-sizing: content-box;
3536
padding-inline-end: var(--vkui--spacing_size_xs);
3637
}
3738

@@ -125,6 +126,7 @@
125126

126127
/* stylelint-disable-next-line selector-pseudo-class-disallowed-list */
127128
.after > :global(.vkuiIcon) {
129+
box-sizing: content-box;
128130
padding-inline-start: var(--vkui--spacing_size_m);
129131
}
130132

packages/vkui/src/components/Slider/Slider.e2e-playground.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ export const SliderPlaygroundForTooltipTest = (
113113
<div
114114
style={{
115115
padding: '80px 30px 30px',
116+
boxSizing: 'content-box',
116117
width: '320px',
117118
height: 'auto',
118119
}}

packages/vkui/src/components/Spacing/Spacing.e2e-playground.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { Spacing, type SpacingProps } from './Spacing';
88
const sizes = Object.keys(spacingSizeClassNames) as SpacingSize[];
99
const divStyle: React.CSSProperties & CSSCustomProperties = {
1010
'width': 100,
11+
'boxSizing': 'content-box',
1112
'--my-custom-var': '8px',
1213
};
1314

packages/vkui/src/components/SubnavigationButton/SubnavigationButton.module.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
}
8585

8686
.chevronIcon {
87+
box-sizing: content-box;
8788
margin-block-start: 1px; /* Смещает иконку относительно текста */
8889
margin-inline-start: 8px;
8990
color: var(--vkui--color_icon_secondary);

packages/vkui/src/components/TooltipBase/TooltipBase.module.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
}
44

55
.content {
6+
box-sizing: content-box;
67
display: flex;
78
align-items: center;
89
justify-content: space-between;

packages/vkui/src/components/Typography/EllipsisText/EllipsisText.e2e-playground.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const EllipsisTextPlayground = (props: ComponentPlaygroundProps) => {
1212
]}
1313
>
1414
{(props: EllipsisTextProps) => (
15-
<div style={{ width: 200, padding: 20 }}>
15+
<div style={{ width: 200, padding: 20, boxSizing: 'content-box' }}>
1616
<EllipsisText {...props}>
1717
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
1818
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud

0 commit comments

Comments
 (0)