Skip to content

Commit

Permalink
feat(Item): clamp composite bar item (#342)
Browse files Browse the repository at this point in the history
* feat(Item): moved action title margin to base [#342]

* chore(AsideHeader): updated visual tests [#342]

* feat(Item): wrapped title text in 2 lines [#342]

* chore(AsideHeader): updated visual tests w/ 2 title lines [#342]

* chore(AsideHeader): added line clamp visual test [#342]

---------

Co-authored-by: Vladimir Kubantsev <[email protected]>
  • Loading branch information
vladimir-kuba and Vladimir Kubantsev authored Jan 14, 2025
1 parent 95e7100 commit 9e71cad
Show file tree
Hide file tree
Showing 26 changed files with 16 additions and 6 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.
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.
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,13 @@ test.describe('AsideHeader', () => {

await expectScreenshot();
});

test('render story: <LineClamp>', async ({mount, expectScreenshot}) => {
await mount(<AsideHeaderStories.LineClamp />, undefined, {
width: 1200,
height: 720,
});

await expectScreenshot();
});
});
13 changes: 7 additions & 6 deletions src/components/CompositeBar/Item/Item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,17 @@ $block: '.#{variables.$ns}composite-bar-item';

&__title {
display: flex;
align-items: center;
overflow: hidden;
margin-right: 16px;
}

&__title-text {
white-space: nowrap;
text-overflow: ellipsis;
/* stylelint-disable-next-line value-no-vendor-prefix */
display: -webkit-box;
-webkit-box-orient: vertical;
/* NOTE @vladimir-kuba: 2 lines fits in container height, more lines leads overflow container */
-webkit-line-clamp: 2;
overflow: hidden;

color: var(--gn-aside-header-item-text-color, var(--_--item-text-color));
Expand Down Expand Up @@ -181,10 +186,6 @@ $block: '.#{variables.$ns}composite-bar-item';
& #{$class}__icon-place {
width: var(--gn-composite-bar-item-action-size);
}

& #{$class}__title {
margin-right: 16px;
}
}

&__icon-tooltip_item-type_action {
Expand Down

0 comments on commit 9e71cad

Please sign in to comment.