Skip to content

Commit

Permalink
feat: add wrap theme to vertical-layout (#8128)
Browse files Browse the repository at this point in the history
  • Loading branch information
DiegoCardoso authored Nov 13, 2024
1 parent 0dee248 commit f31d9af
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/vertical-layout/src/vaadin-vertical-layout.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
* `theme="margin"` | Applies the default amount of CSS margin for the host element (specified by the theme)
* `theme="padding"` | Applies the default amount of CSS padding for the host element (specified by the theme)
* `theme="spacing"` | Applies the default amount of CSS margin between items (specified by the theme)
* `theme="wrap"` | Items wrap to the next row when they exceed the layout height
*/
declare class VerticalLayout extends ThemableMixin(ElementMixin(HTMLElement)) {}

Expand Down
1 change: 1 addition & 0 deletions packages/vertical-layout/src/vaadin-vertical-layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
* `theme="margin"` | Applies the default amount of CSS margin for the host element (specified by the theme)
* `theme="padding"` | Applies the default amount of CSS padding for the host element (specified by the theme)
* `theme="spacing"` | Applies the default amount of CSS margin between items (specified by the theme)
* `theme="wrap"` | Items wrap to the next row when they exceed the layout height
*
* @customElement
* @extends HTMLElement
Expand Down
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 @@ -72,4 +72,10 @@ describe('vertical-layout', () => {
element.setAttribute('theme', 'spacing-xl');
await visualDiff(div, 'theme-spacing-xl');
});

it('theme-wrap', async () => {
element.setAttribute('theme', 'wrap');
element.style.height = '100px';
await visualDiff(div, 'theme-wrap');
});
});
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 @@ -52,4 +52,11 @@ describe('vertical-layout', () => {
element.setAttribute('theme', 'margin padding spacing');
await visualDiff(div, 'theme-margin-padding-spacing');
});

it('theme-wrap', async () => {
element.setAttribute('theme', 'wrap');
element.style.height = '100px';

await visualDiff(div, 'theme-wrap');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ const verticalLayout = css`
:host([theme~='spacing-xl']) {
gap: var(--lumo-space-xl);
}
:host([theme~='wrap']) {
flex-wrap: wrap;
}
`;

registerStyles('vaadin-vertical-layout', verticalLayout, { moduleId: 'lumo-vertical-layout' });
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ const verticalLayout = css`
:host([theme~='spacing-xl']) {
gap: 40px;
}
:host([theme~='wrap']) {
flex-wrap: wrap;
}
`;

registerStyles('vaadin-vertical-layout', verticalLayout, { moduleId: 'material-vertical-layout' });

0 comments on commit f31d9af

Please sign in to comment.