Elffuss BraidHub

kikocis/continue public

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