Skip to content

Commit b9ceadd

Browse files
authored
Make UI vscode styled and refactor webview js (#730)
1 parent 6dd5363 commit b9ceadd

14 files changed

Lines changed: 1234 additions & 1484 deletions

vscode-wpilib/.prettierrc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"singleQuote": true,
3+
"endOfLine": "crlf",
4+
"trailingComma": "es5"
5+
}

vscode-wpilib/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ TODO
1616

1717
## Release Notes
1818

19+
## Third Party Licenses
20+
"vscode-codicons" by Microsoft is licensed under [Creative Commons Attribution 4.0 International](https://github.com/microsoft/vscode-codicons/blob/main/LICENSE)
21+

vscode-wpilib/media/codicon.ttf

1.51 KB
Binary file not shown.

vscode-wpilib/media/icons.css

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
/* This file contains cherrypicked icons from codicons for size */
7+
/* Currently built with everything but the below removed from mappings
8+
- trash
9+
*/
10+
11+
@font-face {
12+
font-family: "codicon";
13+
font-display: block;
14+
src: url("./codicon.ttf?fb200efcd350cfb53f94163fb5066b25") format("truetype");
15+
}
16+
17+
.codicon[class*="codicon-"] {
18+
font: normal normal normal 16px/1 codicon;
19+
display: inline-block;
20+
text-decoration: none;
21+
text-rendering: auto;
22+
text-align: center;
23+
-webkit-font-smoothing: antialiased;
24+
-moz-osx-font-smoothing: grayscale;
25+
user-select: none;
26+
-webkit-user-select: none;
27+
-ms-user-select: none;
28+
}
29+
30+
/*---------------------
31+
* Modifiers
32+
*-------------------*/
33+
34+
@keyframes codicon-spin {
35+
100% {
36+
transform: rotate(360deg);
37+
}
38+
}
39+
40+
.codicon-sync.codicon-modifier-spin,
41+
.codicon-loading.codicon-modifier-spin,
42+
.codicon-gear.codicon-modifier-spin {
43+
/* Use steps to throttle FPS to reduce CPU usage */
44+
animation: codicon-spin 1.5s steps(30) infinite;
45+
}
46+
47+
.codicon-modifier-disabled {
48+
opacity: 0.5;
49+
}
50+
51+
.codicon-modifier-hidden {
52+
opacity: 0;
53+
}
54+
55+
/* custom speed & easing for loading icon */
56+
.codicon-loading {
57+
animation-duration: 1s !important;
58+
animation-timing-function: cubic-bezier(0.53, 0.21, 0.29, 0.67) !important;
59+
}
60+
61+
/*---------------------
62+
* Icons
63+
*-------------------*/
64+
65+
.codicon-trash:before {
66+
content: "\ea81";
67+
}

vscode-wpilib/media/main.css

Lines changed: 44 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,53 @@
1-
body {
2-
background-color: transparent;
1+
.installed-dependency,
2+
.available-dependency {
3+
margin-bottom: 10px;
4+
&:first-of-type {
5+
margin-top: 10px;
6+
}
37
}
4-
5-
.color-list {
6-
list-style: none;
7-
padding: 0;
8+
.top-line {
9+
display: flex;
10+
justify-content: space-between;
11+
align-items: center;
12+
margin-bottom: 8px;
13+
&:has(#updateall-action) {
14+
margin-top: 4px;
15+
}
816
}
917

10-
.color-entry {
11-
width: 100%;
12-
display: flex;
13-
margin-bottom: 0.4em;
14-
border: 1px solid var(--vscode-input-border);
18+
#updateall-action {
19+
width: 100%;
1520
}
16-
17-
.color-preview {
18-
width: 2em;
19-
height: 2em;
21+
.name {
22+
font-weight: 600;
2023
}
21-
22-
.color-preview:hover {
23-
outline: inset white;
24+
.downloads {
25+
display: flex;
26+
align-items: center;
2427
}
25-
26-
.color-input {
27-
display: block;
28-
flex: 1;
29-
width: 100%;
30-
color: var(--vscode-input-foreground);
31-
background-color: var(--vscode-input-background);
32-
border: none;
33-
padding: 0 0.6em;
28+
.icon {
29+
margin-left: 5px;
30+
}
31+
.details {
32+
margin-top: 5px;
33+
color: var(--vscode-descriptionForeground);
34+
}
35+
.update {
36+
display: flex;
37+
gap: 4px;
38+
}
39+
.uninstall-button {
40+
padding: 4px;
41+
& > vscode-icon {
42+
margin-right: 4px !important;
43+
margin-left: 4px !important;
44+
}
3445
}
3546

36-
.add-color-button {
37-
display: block;
38-
border: none;
39-
margin: 0 auto;
47+
vscode-collapsible::part(body) {
48+
overflow: visible;
4049
}
50+
51+
vscode-single-select {
52+
flex-shrink: 2;
53+
}

0 commit comments

Comments
 (0)