Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Commit

Permalink
[terra-button] Button left align wrapped text (#4081)
Browse files Browse the repository at this point in the history
  • Loading branch information
cm9361 authored Apr 4, 2024
1 parent 8bca06e commit a02a456
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/terra-button/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

* Changed
* Updated styles to ensure span content is left aligned when wrapping.

## 3.76.0 - (March 20, 2024)

* Added
Expand Down
1 change: 1 addition & 0 deletions packages/terra-button/src/Button.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@

&.is-left-aligned {
justify-content: start;
text-align: start;
}
}

Expand Down
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.
1 change: 1 addition & 0 deletions packages/terra-button/tests/wdio/button-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ Terra.describeViewports('Button', ['tiny'], () => {
$('#root').moveTo();

Terra.validates.element('long text', { selector: '#long-text' });
Terra.validates.element('long text left aligned', { selector: '#long-text-left-block' });
});

it('displays Button with left aligned text', () => {
Expand Down
1 change: 1 addition & 0 deletions packages/terra-core-docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* Changed
* Updated documentation for `terra-signature`.
* Updated long text example for `terra-button` to show left alignment for wrapping button text.

## 1.69.0 - (March 27, 2024)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@ const words = 'Art artisan blog future next level odd park party polaroid truffa

const LongTextButton = () => <Button id="long-text" text={text} />;
const LongTextBlockButton = () => <Button id="long-text-block" text={text} isBlock />;
const LongTextLeftBlockButton = () => <Button id="long-text-left-block" text={`Left Aligned: ${words}`} isBlock isLeftAligned />;

export default () => (
<div>
<LongTextButton />
<div className={cx('spacing')} />
<LongTextBlockButton />
<div className={cx('spacing')} />
<LongTextLeftBlockButton />
<div className={cx('spacing')} />
<Button id="long-word" text={words} />
<div className={cx('spacing')} />
<Button id="long-word-block" text={words} isBlock />
Expand Down

0 comments on commit a02a456

Please sign in to comment.