Skip to content

Commit d15fe7c

Browse files
committed
Add home icon to header and refine target button and tab styles
- restore the header [Commit] - in not hovered state, target button should have gradient: left side - nominal hover color to transparent - the color of left-side web/api text should be always in its hover color, so it stays the same, no matter if hovered or not - compact target should not have gradient, but the default state from before changes [Changes] ├── apps │ └── editor │ └── src │ └── views │ └── prompt │ └── frontend │ └── Home │ ├── Home.module.scss │ └── Home.tsx └── packages └── ui └── src └── components └── editor ├── common │ └── Icon │ └── Icon.tsx └── prompt ├── Tabs │ └── Tabs.module.scss └── TargetButton ├── TargetButton.module.scss ├── TargetButton.stories.tsx ├── TargetButton.tsx └── index.ts
1 parent edd8709 commit d15fe7c

4 files changed

Lines changed: 59 additions & 20 deletions

File tree

‎apps/editor/src/views/prompt/frontend/Home/Home.module.scss‎

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@
99
inset: 0;
1010
display: flex;
1111
align-items: center;
12-
justify-content: center;
13-
gap: 4px;
14-
padding: 0 22px;
12+
justify-content: space-between;
13+
gap: 12px;
14+
padding: 0 12px;
1515
opacity: 1;
1616
transform: translateY(0);
1717
transition:
1818
transform var(--transition-duration-250) var(--transition-timing-function),
1919
opacity var(--transition-duration-250) var(--transition-timing-function);
2020

2121
:global([data-modern-ui='true']) & {
22-
padding: 0 20px;
22+
padding: 0 10px;
2323
}
2424

2525
&--hidden {
@@ -29,6 +29,23 @@
2929
}
3030
}
3131

32+
&__left {
33+
display: flex;
34+
align-items: center;
35+
justify-content: center;
36+
border-radius: 5px;
37+
--size: 20px;
38+
width: var(--size);
39+
height: var(--size);
40+
color: var(--vscode-icon-foreground);
41+
}
42+
43+
&__right {
44+
display: flex;
45+
align-items: center;
46+
gap: 4px;
47+
}
48+
3249
&__targets {
3350
position: absolute;
3451
inset: 0;
@@ -70,6 +87,7 @@
7087
&__target {
7188
display: flex;
7289
flex-direction: column;
90+
gap: 6px;
7391
margin: 0 12px;
7492
overflow: hidden;
7593
border-radius: 10px;

‎apps/editor/src/views/prompt/frontend/Home/Home.tsx‎

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -142,18 +142,23 @@ export const Home: React.FC<Props> = (props) => {
142142
})}
143143
ref={container_ref}
144144
>
145-
<CompactableActionButton
146-
label={discord_label}
147-
href="https://discord.gg/KJySXsrSX5"
148-
icon="DISCORD"
149-
is_compact={compact_step >= 1}
150-
/>
151-
<CompactableActionButton
152-
label={coffee_label}
153-
on_click={props.on_donate_click}
154-
codicon="coffee"
155-
is_compact={compact_step >= 2}
156-
/>
145+
<div className={styles['header__left']}>
146+
<span className="codicon codicon-home" />
147+
</div>
148+
<div className={styles['header__right']}>
149+
<CompactableActionButton
150+
label={discord_label}
151+
href="https://discord.gg/KJySXsrSX5"
152+
icon="DISCORD"
153+
is_compact={compact_step >= 1}
154+
/>
155+
<CompactableActionButton
156+
label={coffee_label}
157+
on_click={props.on_donate_click}
158+
codicon="coffee"
159+
is_compact={compact_step >= 2}
160+
/>
161+
</div>
157162
</div>
158163

159164
<div

‎packages/ui/src/components/editor/prompt/Tabs/Tabs.module.scss‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
&__tab {
2121
@include accent-font;
2222
font-size: 16px;
23-
padding: 4px 10px 3px 10px;
23+
padding: 4px 8px 3px 8px;
2424
display: flex;
2525
align-items: center;
2626
text-transform: none;

‎packages/ui/src/components/editor/prompt/TargetButton/TargetButton.module.scss‎

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,30 @@
3636

3737
&.button--hover-blue {
3838
--ascii-color: var(--cwc-blue-foreground);
39+
40+
&:not(.button--compact) {
41+
background: linear-gradient(90deg, var(--cwc-blue-background) 0%, transparent 100%);
42+
43+
.button__label {
44+
color: var(--cwc-blue-foreground);
45+
}
46+
}
3947
}
4048

4149
&.button--hover-purple {
4250
--ascii-color: var(--cwc-purple-foreground);
51+
52+
&:not(.button--compact) {
53+
background: linear-gradient(90deg, var(--cwc-purple-background) 0%, transparent 100%);
54+
55+
.button__label {
56+
color: var(--cwc-purple-foreground);
57+
}
58+
}
4359
}
4460

4561
&:not(:disabled):hover {
46-
background-color: var(--vscode-toolbar-hoverBackground);
62+
background: var(--vscode-toolbar-hoverBackground);
4763

4864
.button__label-char {
4965
animation: wave 0.5s ease-in-out;
@@ -55,7 +71,7 @@
5571
}
5672

5773
&.button--hover-blue {
58-
background-color: var(--cwc-blue-background);
74+
background: var(--cwc-blue-background);
5975
color: var(--cwc-blue-foreground);
6076

6177
.button__description {
@@ -64,7 +80,7 @@
6480
}
6581

6682
&.button--hover-purple {
67-
background-color: var(--cwc-purple-background);
83+
background: var(--cwc-purple-background);
6884
color: var(--cwc-purple-foreground);
6985

7086
.button__description {

0 commit comments

Comments
 (0)