Skip to content

Commit 247b428

Browse files
committed
Enhances welcome UI for better scaling and narrow view support
Refines font sizing and spacing units from rem to em to improve consistency and responsiveness across devices. Updates carousel and feature card layouts for better display on small screens, including improved media queries and more flexible padding. Adjusts section and header styling to ensure readability and visual alignment, especially on mobile. (#4769, #4773, PLG-138)
1 parent 3321aea commit 247b428

File tree

3 files changed

+62
-20
lines changed

3 files changed

+62
-20
lines changed

src/webviews/apps/welcome/components/feature-carousel.ts

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ export class GlFeatureCarousel extends LitElement {
1717
:host {
1818
--gl-carousel-border-radius: 0;
1919
--gl-carousel-background-color: transparent;
20-
--gl-carousel-padding: 1rem;
20+
--gl-carousel-padding: 1em;
2121
2222
display: block;
2323
width: 100%;
2424
}
2525
2626
.carousel {
2727
display: flex;
28-
gap: 1rem;
28+
gap: 1em;
2929
justify-content: center;
3030
}
3131
@@ -124,19 +124,39 @@ export class GlFeatureCard extends LitElement {
124124
css`
125125
:host {
126126
display: flex;
127-
gap: 1rem;
127+
gap: 1em;
128128
}
129129
130130
.image {
131131
width: 50%;
132132
}
133133
134134
.content {
135-
margin-top: 0.5rem;
135+
margin-top: 0.5em;
136136
flex: 1;
137137
display: flex;
138138
flex-direction: column;
139-
gap: 0.5rem;
139+
gap: 0.5em;
140+
}
141+
142+
@media (max-width: 640px) {
143+
:host {
144+
flex-direction: column;
145+
}
146+
147+
.image {
148+
width: 100%;
149+
}
150+
151+
.content {
152+
margin-top: 0;
153+
margin-left: 0.3em;
154+
margin-right: 0.3em;
155+
}
156+
157+
::slotted(*) {
158+
width: 100%;
159+
}
140160
}
141161
`,
142162
];

src/webviews/apps/welcome/welcome.css.ts

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,25 @@ const colorScheme = css`
1313

1414
const typography = css`
1515
:host {
16-
--h1-font-size: 1.4rem;
17-
--p-font-size: 1rem;
18-
--card-font-size: var(--vscode-font-size);
16+
font-size: var(--vscode-font-size);
17+
18+
--h1-font-size: 1.7em;
19+
--p-font-size: 1.23em;
20+
--card-font-size: 1em;
1921
}
2022
2123
@media (max-width: 640px) {
2224
:host {
23-
--h1-font-size: 0.75rem;
24-
--p-font-size: 0.7rem;
25-
--card-font-size: var(--vscode-editor-font-size);
25+
font-size: var(--vscode-editor-font-size);
26+
--h1-font-size: 1em;
27+
--p-font-size: 1em;
28+
--card-font-size: 1em;
29+
}
30+
}
31+
32+
@media (max-width: 300px) {
33+
:host {
34+
font-size: calc(var(--vscode-editor-font-size) * 0.8);
2635
}
2736
}
2837
`;
@@ -60,14 +69,15 @@ const section = css`
6069
justify-content: center;
6170
align-items: center;
6271
text-align: center;
63-
font-size: var(--p-font-size);
64-
}
65-
.section p {
66-
max-width: 30em;
6772
}
6873
.section .accent {
6974
color: var(--accent-color);
7075
}
76+
77+
.section.plain p {
78+
max-width: 30em;
79+
font-size: var(--p-font-size);
80+
}
7181
`;
7282

7383
const header = css`
@@ -104,26 +114,38 @@ const header = css`
104114
const carousel = css`
105115
gl-feature-carousel {
106116
text-align: initial;
107-
--gl-carousel-border-radius: 0.65rem;
117+
--gl-carousel-border-radius: 0.63em;
118+
--gl-carousel-padding: 1.8em;
108119
--gl-carousel-background-color: var(--vscode-textBlockQuote-background);
109120
}
110121
122+
@media (max-width: 640px) {
123+
gl-feature-carousel {
124+
--gl-carousel-padding: 1em;
125+
}
126+
}
127+
128+
@media (max-width: 300px) {
129+
gl-feature-carousel {
130+
--gl-carousel-padding: 0.5em;
131+
}
132+
}
133+
111134
gl-feature-carousel h1 {
112135
margin: 0;
113136
font-size: var(--card-font-size);
114137
color: var(--em-color);
115138
}
116139
117140
gl-feature-carousel p {
118-
margin: 0.4em 0;
141+
margin: 0.4em 0 0;
119142
font-size: var(--card-font-size);
120143
color: var(--text-color);
121144
}
122145
123146
gl-feature-carousel img {
124147
max-width: 100%;
125148
height: auto;
126-
border-radius: 0.4rem;
127149
}
128150
129151
gl-feature-carousel a {

src/webviews/apps/welcome/welcome.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ export class GlWelcomeApp extends GlAppHost<State> {
3030
override render(): unknown {
3131
return html`
3232
<div class="welcome scrollable">
33-
<div class="section header">
33+
<div class="section plain header">
3434
<div class="logo"><gitlens-logo></gitlens-logo></div>
3535
<h1>GitLens is now installed in Cursor</h1>
3636
<p>
3737
Understand every line of code — instantly. GitLens reveals authorship, activity, and history
3838
inside the editor
3939
</p>
4040
</div>
41-
<div class="section">
41+
<div class="section plain">
4242
<p>With <span class="accent">PRO</span> subscription you get more</p>
4343
</div>
4444

0 commit comments

Comments
 (0)