Skip to content

Commit f56c531

Browse files
authored
refactor: update login-form to use column flex on slotted form (#9689)
1 parent c598d80 commit f56c531

File tree

4 files changed

+14
-15
lines changed

4 files changed

+14
-15
lines changed

dev/login-form.html

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,11 @@
6060

6161
<body>
6262
<style>
63-
#wrapper {
64-
background-color: var(--lumo-contrast-5pct);
65-
justify-content: center;
66-
padding: var(--lumo-space-l);
67-
display: flex !important;
68-
}
69-
7063
.controls {
7164
display: grid;
7265
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
7366
gap: 2rem;
7467
margin-bottom: 2rem;
75-
font-size: 0.875rem;
7668
}
7769

7870
.control-group {

packages/login/src/vaadin-login-form.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,6 @@ class LoginForm extends LoginFormMixin(ElementMixin(ThemableMixin(PolylitMixin(L
7171
/** @protected */
7272
render() {
7373
return html`
74-
<style>
75-
vaadin-login-form-wrapper > form > * {
76-
width: 100%;
77-
}
78-
</style>
7974
<vaadin-login-form-wrapper
8075
id="vaadinLoginFormWrapper"
8176
theme="${ifDefined(this._theme)}"

packages/login/theme/lumo/vaadin-login-form-wrapper-styles.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,20 @@ import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themab
66

77
const loginFormWrapper = css`
88
:host {
9-
max-width: calc(var(--lumo-size-m) * 10);
9+
width: calc(var(--lumo-size-m) * 10);
10+
max-width: 100%;
1011
background: var(--lumo-base-color) linear-gradient(var(--lumo-tint-5pct), var(--lumo-tint-5pct));
1112
}
1213
1314
[part='form'] {
1415
padding: var(--lumo-space-l);
1516
}
1617
18+
::slotted(form) {
19+
display: flex;
20+
flex-direction: column;
21+
}
22+
1723
[part='form-title'] {
1824
margin-top: calc(var(--lumo-font-size-xxxl) - var(--lumo-font-size-xxl));
1925
color: var(--lumo-header-text-color);

packages/vaadin-lumo-styles/src/components/login-form-wrapper.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
-webkit-text-size-adjust: 100%;
1414
-webkit-font-smoothing: antialiased;
1515
-moz-osx-font-smoothing: grayscale;
16-
max-width: calc(var(--lumo-size-m) * 10);
16+
width: calc(var(--lumo-size-m) * 10);
17+
max-width: 100%;
1718
background: var(--lumo-base-color) linear-gradient(var(--lumo-tint-5pct), var(--lumo-tint-5pct));
1819
}
1920

@@ -29,6 +30,11 @@
2930
padding: var(--lumo-space-l);
3031
}
3132

33+
::slotted(form) {
34+
display: flex;
35+
flex-direction: column;
36+
}
37+
3238
[part='form-title'] {
3339
margin: 0;
3440
margin-top: calc(var(--lumo-font-size-xxxl) - var(--lumo-font-size-xxl));

0 commit comments

Comments
 (0)