Skip to content

Commit e9f85b0

Browse files
committed
Add ActionButton component
1 parent 56bc3b4 commit e9f85b0

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
.vscode-action-button {
2+
align-items: center;
3+
background-color: transparent;
4+
border-color: transparent;
5+
border-style: solid;
6+
border-width: 1px;
7+
border-radius: 5px;
8+
color: var(--vscode-foreground);
9+
display: inline-flex;
10+
cursor: pointer;
11+
padding: 0;
12+
user-select: none;
13+
}
14+
15+
.vscode-action-button:disabled {
16+
color: var(--vscode-disabledForeground);
17+
cursor: default;
18+
pointer-events: none;
19+
}
20+
21+
.vscode-action-button .codicon,
22+
.vscode-action-button svg {
23+
color: var(--vscode-icon-foreground);
24+
display: block;
25+
padding: 2px;
26+
}
27+
28+
.vscode-action-button svg {
29+
box-sizing: content-box;
30+
height: 16px;
31+
width: 16px;
32+
}
33+
34+
.vscode-action-button:disabled .codicon,
35+
.vscode-action-button:disabled svg {
36+
color: var(--vscode-disabledForeground);
37+
}
38+
39+
.vscode-action-button:hover {
40+
background-color: var(--vscode-toolbar-hoverBackground);
41+
}
42+
43+
.vscode-action-button:active {
44+
background-color: var(--vscode-toolbar-activeBackground);
45+
}
46+
47+
.vscode-action-button:focus {
48+
outline: none;
49+
}
50+
51+
.vscode-action-button:focus-visible {
52+
border-color: var(--vscode-focusBorder);
53+
}
54+
55+
.label {
56+
display: block;
57+
padding: 0 5px 0 2px;
58+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import "./ActionButton.css";
2+
3+
// This is needed because vscode-elements/elements does not implement
4+
// the same styles for icon buttons as vscode/webview-ui-toolkit
5+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
6+
export const ActionButton = (props: any) => {
7+
return (
8+
<button type="button" className="vscode-action-button" {...props}>
9+
{props.children}
10+
</button>
11+
);
12+
};

0 commit comments

Comments
 (0)