Skip to content

Commit

Permalink
fix: Overflow for switch label (#18948)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjackwhite authored Nov 29, 2023
1 parent 41ba028 commit d1959e3
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 3 deletions.
Binary file modified frontend/__snapshots__/lemon-ui-lemon-checkbox--overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/__snapshots__/lemon-ui-lemon-switch--overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions frontend/src/lib/lemon-ui/LemonCheckbox/LemonCheckbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@
}

&.LemonCheckbox--bordered {
line-height: 1.4;

label {
min-height: 2.5rem;
padding: 0 0.75rem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ export const Overview = (): JSX.Element => {

<LemonCheckbox label="Bordered FullWidth" fullWidth bordered />
<LemonCheckbox label="Bordered small" bordered size="small" />

<div className="w-20">
<LemonCheckbox label="Bordered with a really long label" bordered />
</div>
</div>
)
}
Expand Down
7 changes: 4 additions & 3 deletions frontend/src/lib/lemon-ui/LemonSwitch/LemonSwitch.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,20 @@
}

&.LemonSwitch--bordered {
height: 2.5rem;
min-height: 2.5rem;
padding: 0 0.75rem;
line-height: 1.4;
background: var(--bg-light);
border: 1px solid var(--border);
border-radius: var(--radius);

.posthog-3000 & {
height: calc(2.125rem + 3px); // Medium size button height + button shadow height
min-height: calc(2.125rem + 3px); // Medium size button height + button shadow height
}

&.LemonSwitch--small {
gap: 0.5rem;
height: 2rem;
min-height: 2rem;
padding: 0 0.5rem;
}
}
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/lib/lemon-ui/LemonSwitch/LemonSwitch.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ export const Overview = (): JSX.Element => {
<LemonSwitch label="Bordered FullWidth" fullWidth bordered />
<LemonSwitch label="Bordered FullWidth icon" fullWidth bordered icon={<IconGlobeLock />} />
<LemonSwitch label="Bordered disabled" bordered disabled />

<div className="w-20">
<LemonSwitch label="Bordered with a really long label" bordered />
</div>
</div>
)
}
Expand Down

0 comments on commit d1959e3

Please sign in to comment.