Elffuss BraidHub

kikocis/continue public

ff6e3c1dcf5b · 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 border-radius: ${defaultBorderRadius};
73
74 border: none;
75 color: ${vscForeground};
76 background-color: rgba(128, 128, 128, 0.4);
77 &:disabled {
78 color: gray;
79 pointer-events: none;
80 }
81
82 &:hover:enabled {
83 cursor: pointer;
84 filter: brightness(125%);
85 }
86`;
87
88export const InputSubtext = styled.span`
89 font-size: 0.75rem;
90 line-height: 1rem;
91 color: ${lightGray};
92 margin-top: 0.25rem;
93`;
94
95export const ButtonSubtext = styled.span`
96 display: block;
97 margin-top: 0;
98 text-align: center;
99 color: ${lightGray};
100 font-size: 0.75rem;
101`;
102
103export const CustomScrollbarDiv = styled.div`
104 scrollbar-base-color: transparent;
105 scrollbar-width: thin;
106 background-color: ${vscBackground};
107
108 & * {
109 ::-webkit-scrollbar {
110 width: 4px;
111 }
112
113 ::-webkit-scrollbar:horizontal {
114 height: 4px;
115 }
116
117 ::-webkit-scrollbar-thumb {
118 border-radius: 2px;
119 }
120 }
121`;
122
123export const Input = styled.input`
124 width: 100%;
125 padding: 8px 12px;
126 box-sizing: border-box;
127 margin: 4px 0px;
128 border-radius: ${defaultBorderRadius};
129 outline: 1px solid ${lightGray};
130 border: none;
131 background-color: ${vscBackground};
132 color: ${vscForeground};
133
134 &:focus {
135 background: ${vscInputBackground};
136 outline: 1px solid ${lightGray};
137 }
138
139 &:invalid {
140 outline: 1px solid red;
141 }
142`;
143
144export const HeaderButton = styled.button<{
145 inverted: boolean | undefined;
146 backgroundColor?: string;
147 hoverBackgroundColor?: string;
148}>`
149 background-color: ${({ inverted, backgroundColor }) => {
150 return backgroundColor ?? (inverted ? vscForeground : "transparent");
151 }};
152 color: ${({ inverted }) => (inverted ? vscBackground : vscForeground)};
153
154 border: none;
155 border-radius: ${defaultBorderRadius};
156 cursor: ${({ disabled }) => (disabled ? "default" : "pointer")};
157
158 &:focus {
159 outline: none;
160 border: none;
161 }
162
163 &:hover {
164 background-color: ${({ inverted, hoverBackgroundColor }) =>
165 typeof inverted === "undefined" || inverted
166 ? (hoverBackgroundColor ?? vscInputBackground)
167 : "transparent"};
168 }
169
170 display: flex;
171 align-items: center;
172 justify-content: center;
173 gap: 4px;
174 padding: 2px;
175`;
176
177export const StyledActionButton = styled.div`
178 display: flex;
179 justify-content: space-between;
180 align-items: center;
181 cursor: pointer;
182 transition: background-color 200ms;
183 border-radius: ${defaultBorderRadius};
184 padding: 2px 12px;
185 background-color: ${lightGray}33;
186 background-opacity: 0.1;
187
188 &:hover {
189 background-color: ${lightGray}55;
190 }
191`;
192
193export const CloseButton = styled.button`
194 border: none;
195 background-color: inherit;
196 color: ${lightGray};
197 position: absolute;
198 top: 0.6rem;
199 right: 1rem;
200 padding: 0.25rem;
201 display: flex;
202 align-items: center;
203 justify-content: center;
204 cursor: pointer;
205`;
206
207export const AnimatedEllipsis = styled.span`
208 &::after {
209 content: ".";
210 animation: ellipsis 2.5s infinite;
211 animation-fill-mode: forwards;
212 animation-play-state: running;
213 will-change: content;
214 display: inline-block;
215 width: 16px;
216 text-align: left;
217 }
218
219 @keyframes ellipsis {
220 0% {
221 content: ".";
222 }
223 33% {
224 content: "..";
225 }
226 66% {
227 content: "...";
228 }
229 100% {
230 content: ".";
231 }
232 }
233`;