Skip to content

Commit

Permalink
Merge pull request #66 from prezly/feature/dev-11397-long-text-with-b…
Browse files Browse the repository at this point in the history
…utton-causes-the-button-overflow-outside-the-container

[DEV-11397] Long text with button causes the button overflow outside the story container in themes
  • Loading branch information
fgyimah authored Aug 17, 2023
2 parents 1a1faa1 + 166658e commit f15bfcb
Show file tree
Hide file tree
Showing 14 changed files with 69 additions and 0 deletions.
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.
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.
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.
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.
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.
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.
64 changes: 64 additions & 0 deletions src/elements/ButtonBlock/ButtonBlock.slate.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,67 @@ export const WithoutHref: Story = () => (
]}
/>
);

export const WithCenterLayoutButLongText: Story = () => (
<Renderer
nodes={[
{
type: 'button-block',
href: 'https://prezly.com',
new_tab: true,
layout: ButtonBlockNode.Layout.CENTER,
uuid: TEST_UUID,
label: 'Some long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long text',
variant: ButtonBlockNode.Variant.DEFAULT,
},
]}
/>
);

export const WithWideLayoutButLongText: Story = () => (
<Renderer
nodes={[
{
type: 'button-block',
href: 'https://prezly.com',
new_tab: true,
layout: ButtonBlockNode.Layout.WIDE,
uuid: TEST_UUID,
label: 'Some long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long text',
variant: ButtonBlockNode.Variant.DEFAULT,
},
]}
/>
);

export const WithRightLayoutButLongText: Story = () => (
<Renderer
nodes={[
{
type: 'button-block',
href: 'https://prezly.com',
new_tab: true,
layout: ButtonBlockNode.Layout.RIGHT,
uuid: TEST_UUID,
label: 'Some long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long text',
variant: ButtonBlockNode.Variant.DEFAULT,
},
]}
/>
);

export const WithLeftLayoutButLongText: Story = () => (
<Renderer
nodes={[
{
type: 'button-block',
href: 'https://prezly.com',
new_tab: true,
layout: ButtonBlockNode.Layout.LEFT,
uuid: TEST_UUID,
label: 'Some long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long textSome long text',
variant: ButtonBlockNode.Variant.DEFAULT,
},
]}
/>
);
5 changes: 5 additions & 0 deletions src/elements/ButtonBlock/ButtonBlockNode.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ $white: #fff;
font-size: $font-size-m;
line-height: $line-height;
font-weight: 600;
max-width: 100%;

&--outlined {
background-color: $white;
Expand All @@ -25,17 +26,21 @@ $white: #fff;

&--wide {
width: auto;
text-align: justify;
}

&--left {
margin-right: auto;
text-align: left;
}

&--right {
margin-left: auto;
text-align: right;
}

&--center {
margin: $block-spacing-vertical auto;
text-align: center;
}
}

0 comments on commit f15bfcb

Please sign in to comment.