Skip to content

Commit

Permalink
fix: fix components view with global box-sizing: border-box (#8268) (
Browse files Browse the repository at this point in the history
…#8270)

# Conflicts:
#	packages/vkui/src/components/SubnavigationButton/SubnavigationButton.module.css
  • Loading branch information
EldarMuhamethanov authored Feb 13, 2025
1 parent 02bd7c5 commit 5ec41e7
Show file tree
Hide file tree
Showing 17 changed files with 33 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ export const CustomScrollViewWithBothScrollsPlayground = (props: ComponentPlaygr
borderRadius: 10,
border: '1px solid #000',
padding: 10,
boxSizing: 'content-box',
}}
>
<CustomScrollView {...props} enableHorizontalScroll style={{ height: 300, width: 600 }}>
<Div
style={{
width: 1440,
boxSizing: 'content-box',
}}
>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed a sollicitudin lectus, a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const Wrapper = (Story: PartialStoryFn<ReactRenderer>) => (
width: '100%',
maxWidth: '600px',
maxHeight: '300px',
boxSizing: 'content-box',
}}
>
<Story />
Expand All @@ -36,6 +37,7 @@ export const Playground: Story = {
<Div
style={{
width: 1440,
boxSizing: 'content-box',
}}
>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed a sollicitudin lectus, a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ export const FormItemPlayground = (props: ComponentPlaygroundProps) => {
},
]}
>
{(props: FormItemProps) => <FormItem {...props} style={{ maxWidth: '300px' }} />}
{(props: FormItemProps) => (
<FormItem {...props} style={{ maxWidth: '300px', boxSizing: 'content-box' }} />
)}
</ComponentPlayground>
);
};
Expand Down Expand Up @@ -124,7 +126,7 @@ export const FormItemTopAsidePlayground = (props: ComponentPlaygroundProps) => {
{topAside}
</FormItem.Top>
}
style={{ maxWidth: '300px' }}
style={{ maxWidth: '300px', boxSizing: 'content-box' }}
/>
)}
</ComponentPlayground>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
}

.body {
box-sizing: content-box;
display: flex;
flex-direction: column;
justify-content: center;
Expand Down
5 changes: 5 additions & 0 deletions packages/vkui/src/components/IconButton/IconButton.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
border-radius: 9999px;
}

/* stylelint-disable-next-line selector-pseudo-class-disallowed-list */
.host :global(.vkuiIcon) {
box-sizing: content-box;
}

.sizeYCompact {
block-size: 44px;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/vkui/src/components/Mark/Mark.e2e-playground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const MarkPlayground = (props: ComponentPlaygroundProps) => {
return (
<ComponentPlayground {...props}>
{(props: MarkProps) => (
<div style={{ width: 300, padding: 10, lineHeight: '1.6' }}>
<div style={{ width: 300, padding: 10, boxSizing: 'content-box', lineHeight: '1.6' }}>
Ведь тебе нужен <Mark {...props}>Марк</Mark>, чтоб <Mark {...props}>получился марк</Mark>
етинг
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const OnboardingTooltipPlayground = (props: ComponentPlaygroundProps) =>
{(props: OnboardingTooltipProps) => (
<OnboardingTooltipContainer
style={{
boxSizing: 'content-box',
minWidth: '300px',
height: '100px',
position: 'relative',
Expand Down
3 changes: 2 additions & 1 deletion packages/vkui/src/components/Panel/Panel.e2e-playground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const PanelPlayground = (props: ComponentPlaygroundProps) => {
<div
style={{
height: '200px',
boxSizing: 'content-box',
overflow: 'auto',
transform: 'translateZ(0)',
// чтобы было проще видеть разницу скриншотов
Expand Down Expand Up @@ -66,7 +67,7 @@ export const PanelModePlayground = (props: ComponentPlaygroundProps) => {
>
{(props: PanelProps) => (
<Panel {...props}>
<div style={{ padding: '8px' }}>
<div style={{ padding: '8px', boxSizing: 'content-box' }}>
<Group mode={props.mode}>
<div style={{ minHeight: '100px', minWidth: '100px' }}>
Text within Group with mode {props.mode}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
position: relative;
}

/* stylelint-disable-next-line selector-pseudo-class-disallowed-list */
.host :global(.vkuiIcon) {
box-sizing: content-box;
}

.host[disabled] {
opacity: 0.6;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const PullToRefreshPlayground = (
return (
<ComponentPlayground {...playgroundProps} platform="vkcom">
{({ ...props }: PullToRefreshProps) => (
<Div style={{ width: '300px', paddingLeft }}>
<Div style={{ width: '300px', paddingLeft, boxSizing: 'content-box' }}>
<PullToRefresh {...props}>
<div
style={{
Expand Down Expand Up @@ -44,7 +44,7 @@ export const PullToRefreshChildrenPositionPlayground = (props: ComponentPlaygrou
return (
<ComponentPlayground {...props} platform="vkcom">
{({ ...props }: PullToRefreshProps) => (
<Div style={{ width: '300px', height: '500px', display: 'flex' }}>
<Div style={{ width: '300px', height: '500px', display: 'flex', boxSizing: 'content-box' }}>
<PullToRefresh {...props}>
<div
style={{
Expand Down
1 change: 1 addition & 0 deletions packages/vkui/src/components/Search/Search.module.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.host {
box-sizing: content-box;
display: flex;
overflow: hidden;
-webkit-tap-highlight-color: transparent;
Expand Down
2 changes: 2 additions & 0 deletions packages/vkui/src/components/SimpleCell/SimpleCell.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

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

Expand Down Expand Up @@ -125,6 +126,7 @@

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export const SliderPlaygroundForTooltipTest = (
<div
style={{
padding: '80px 30px 30px',
boxSizing: 'content-box',
width: '320px',
height: 'auto',
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { Spacing, type SpacingProps } from './Spacing';
const sizes = Object.keys(spacingSizeClassNames) as SpacingSize[];
const divStyle: React.CSSProperties & CSSCustomProperties = {
'width': 100,
'boxSizing': 'content-box',
'--my-custom-var': '8px',
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
}

.chevronIcon {
box-sizing: content-box;
margin-inline-start: 8px;
margin-block-start: 1px; /* Смещает иконку относительно текста */
color: var(--vkui--color_icon_secondary);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
}

.content {
box-sizing: content-box;
display: flex;
align-items: center;
justify-content: space-between;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const EllipsisTextPlayground = (props: ComponentPlaygroundProps) => {
]}
>
{(props: EllipsisTextProps) => (
<div style={{ width: 200, padding: 20 }}>
<div style={{ width: 200, padding: 20, boxSizing: 'content-box' }}>
<EllipsisText {...props}>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
Expand Down

0 comments on commit 5ec41e7

Please sign in to comment.