Elffuss BraidHub

kikocis/continue public

94488b344dec · 5.3 KiBRawPermalink
1import styled from "styled-components";
2import { varWithFallback } from "../styles/theme";
3
4export const defaultBorderRadius = "5px";
5export const lightGray = "#999998";
6export const greenButtonColor = "#189e72";
7
8export const vscInputBackground = varWithFallback("input-background");
9export const vscQuickInputBackground = varWithFallback("input-background");
10export const vscBackground = varWithFallback("background");
11export const vscForeground = varWithFallback("foreground");
12export const vscButtonBackground = varWithFallback("primary-background");
13export const vscButtonForeground = varWithFallback("primary-foreground");
14export const vscEditorBackground = varWithFallback("editor-background");
15export const vscListActiveBackground = varWithFallback("list-active");
16export const vscFocusBorder = varWithFallback("border-focus");
17export const vscListActiveForeground = varWithFallback(
18 "list-active-foreground",
19);
20export const vscInputBorder = varWithFallback("input-border");
21export const vscInputBorderFocus = varWithFallback("border-focus");
22export const vscBadgeBackground = varWithFallback("badge-background");
23export const vscBadgeForeground = varWithFallback("badge-foreground");
24export const vscCommandCenterActiveBorder = varWithFallback(
25 "command-border-focus",
26);
27export const vscCommandCenterInactiveBorder = varWithFallback("command-border");
28
29export const Button = styled.button`
30 padding: 6px 12px;
31 margin: 8px 0;
32 border-radius: ${defaultBorderRadius};
33
34 border: none;
35 color: ${vscBackground};
36 background-color: ${vscForeground};
37
38 &:disabled {
39 color: ${vscBackground};
40 opacity: 0.5;
41 pointer-events: none;
42 }
43
44 &:hover:enabled {
45 cursor: pointer;
46 filter: brightness(1.2);
47 }
48`;
49
50export const SecondaryButton = styled.button`
51 padding: 6px 12px;
52 margin: 8px;
53 border-radius: ${defaultBorderRadius};
54
55 border: 1px solid ${lightGray};
56 color: ${vscForeground};
57 background-color: ${vscInputBackground};
58
59 &:disabled {
60 color: gray;
61 }
62
63 &:hover:enabled {
64 cursor: pointer;
65 background-color: ${vscBackground};
66 opacity: 0.9;
67 }
68`;
69
70export const GhostButton = styled.button`
71 padding: 6px 8px;
72 margin: 6px 0;
73 border-radius: ${defaultBorderRadius};
74
75 border: none;
76 color: ${vscForeground};
77 background-color: rgba(128, 128, 128, 0.4);
78 &:disabled {
79 color: gray;
80 pointer-events: none;
81 }
82
83 &:hover:enabled {
84 cursor: pointer;
85 filter: brightness(125%);
86 }
87`;
88
89export const InputSubtext = styled.span`
90 font-size: 0.75rem;
91 line-height: 1rem;
92 color: ${lightGray};
93 margin-top: 0.25rem;
94`;
95
96export const ButtonSubtext = styled.span`
97 display: block;
98 margin-top: 0;
99 text-align: center;
100 color: ${lightGray};
101 font-size: 0.75rem;
102`;
103
104export const CustomScrollbarDiv = styled.div`
105 scrollbar-base-color: transparent;
106 scrollbar-width: thin;
107 background-color: ${vscBackground};
108
109 & * {
110 ::-webkit-scrollbar {
111 width: 4px;
112 }
113
114 ::-webkit-scrollbar:horizontal {
115 height: 4px;
116 }
117
118 ::-webkit-scrollbar-thumb {
119 border-radius: 2px;
120 }
121 }
122`;
123
124export const Input = styled.input`
125 width: 100%;
126 padding: 8px 12px;
127 box-sizing: border-box;
128 margin: 4px 0px;
129 border-radius: ${defaultBorderRadius};
130 outline: 1px solid ${lightGray};
131 border: none;
132 background-color: ${vscBackground};
133 color: ${vscForeground};
134
135 &:focus {
136 background: ${vscInputBackground};
137 outline: 1px solid ${lightGray};
138 }
139
140 &:invalid {
141 outline: 1px solid red;
142 }
143`;
144
145export const HeaderButton = styled.button<{
146 inverted: boolean | undefined;
147 backgroundColor?: string;
148 hoverBackgroundColor?: string;
149}>`
150 background-color: ${({ inverted, backgroundColor }) => {
151 return backgroundColor ?? (inverted ? vscForeground : "transparent");
152 }};
153 color: ${({ inverted }) => (inverted ? vscBackground : vscForeground)};
154
155 border: none;
156 border-radius: ${defaultBorderRadius};
157 cursor: ${({ disabled }) => (disabled ? "default" : "pointer")};
158
159 &:focus {
160 outline: none;
161 border: none;
162 }
163
164 &:hover {
165 background-color: ${({ inverted, hoverBackgroundColor }) =>
166 typeof inverted === "undefined" || inverted
167 ? (hoverBackgroundColor ?? vscInputBackground)
168 : "transparent"};
169 }
170
171 display: flex;
172 align-items: center;
173 justify-content: center;
174 gap: 4px;
175 padding: 2px;
176`;
177
178export const StyledActionButton = styled.div`
179 display: flex;
180 justify-content: space-between;
181 align-items: center;
182 cursor: pointer;
183 transition: background-color 200ms;
184 border-radius: ${defaultBorderRadius};
185 padding: 2px 12px;
186 background-color: ${lightGray}33;
187 background-opacity: 0.1;
188
189 &:hover {
190 background-color: ${lightGray}55;
191 }
192`;
193
194export const CloseButton = styled.button`
195 border: none;
196 background-color: inherit;
197 color: ${lightGray};
198 position: absolute;
199 top: 0.6rem;
200 right: 1rem;
201 padding: 0.25rem;
202 display: flex;
203 align-items: center;
204 justify-content: center;
205 cursor: pointer;
206`;
207
208export const AnimatedEllipsis = styled.span`
209 &::after {
210 content: ".";
211 animation: ellipsis 2.5s infinite;
212 animation-fill-mode: forwards;
213 animation-play-state: running;
214 will-change: content;
215 display: inline-block;
216 width: 16px;
217 text-align: left;
218 }
219
220 @keyframes ellipsis {
221 0% {
222 content: ".";
223 }
224 33% {
225 content: "..";
226 }
227 66% {
228 content: "...";
229 }
230 100% {
231 content: ".";
232 }
233 }
234`;