Skip to content

Commit 227872c

Browse files
committed
Makes header of the welcome page responsive to the panel width
(#4769, #4773, PLG-138)
1 parent f31629d commit 227872c

File tree

2 files changed

+50
-17
lines changed

2 files changed

+50
-17
lines changed

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

Lines changed: 49 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,22 @@ import { css } from 'lit';
33
const colorScheme = css`
44
:host {
55
--accent-color: #cb64ff;
6+
7+
--hero-gradient: radial-gradient(76.32% 76.32% at 50% 7.24%, #7b00ff 29.72%, rgba(255, 0, 242, 0) 100%);
8+
}
9+
`;
10+
11+
const typography = css`
12+
:host {
13+
--h1-font-size: 1.4rem;
14+
--p-font-size: 1rem;
15+
}
16+
17+
@media (max-width: 640px) {
18+
:host {
19+
--h1-font-size: 0.75rem;
20+
--p-font-size: 0.7rem;
21+
}
622
}
723
`;
824

@@ -15,14 +31,20 @@ const heroGradient = css`
1531
transform: translateX(-50%) translateY(-40%);
1632
z-index: -1;
1733
18-
width: 620px;
19-
height: 517px;
20-
34+
background: var(--hero-gradient);
2135
border-radius: 100%;
22-
background: radial-gradient(76.32% 76.32% at 50% 7.24%, #7b00ff 29.72%, rgba(255, 0, 242, 0) 100%);
2336
opacity: 0.25;
24-
mix-blend-mode: color;
2537
filter: blur(53px);
38+
39+
width: 620px;
40+
height: 517px;
41+
}
42+
43+
@media (max-width: 640px) {
44+
.welcome::before {
45+
width: 328px;
46+
height: 273px;
47+
}
2648
}
2749
`;
2850

@@ -33,17 +55,29 @@ const section = css`
3355
justify-content: center;
3456
align-items: center;
3557
text-align: center;
58+
font-size: var(--p-font-size);
3659
}
3760
.section p {
38-
font-size: larger;
39-
max-width: calc(620px * 0.75);
61+
max-width: 30em;
62+
}
63+
.section .accent {
64+
color: var(--accent-color);
4065
}
4166
`;
4267

4368
const header = css`
69+
.logo {
70+
transform: scale(0.7);
71+
}
72+
@media (max-width: 640px) {
73+
.logo {
74+
transform: scale(0.5);
75+
}
76+
}
77+
4478
.header {
45-
margin-top: 5rem;
46-
margin-bottom: 2rem;
79+
margin-top: 3em;
80+
margin-bottom: 1em;
4781
max-width: 620px;
4882
margin-left: auto;
4983
margin-right: auto;
@@ -53,16 +87,15 @@ const header = css`
5387
}
5488
.header h1 {
5589
margin-bottom: 0;
56-
}
57-
`;
5890
59-
const typography = css`
60-
.accent {
61-
color: var(--accent-color);
91+
font-size: var(--h1-font-size);
92+
}
93+
.header p {
94+
color: var(--vscode-descriptionForeground);
6295
}
6396
`;
6497

6598
export const welcomeStyles = css`
66-
${colorScheme}
67-
${heroGradient} ${section} ${header} ${typography}
99+
${colorScheme} ${typography}
100+
${heroGradient} ${section} ${header}
68101
`;

src/webviews/apps/welcome/welcome.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export class GlWelcomeApp extends GlAppHost<State> {
3131
return html`
3232
<div class="welcome scrollable">
3333
<div class="section header">
34-
<gitlens-logo></gitlens-logo>
34+
<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

0 commit comments

Comments
 (0)