Skip to content

Commit 123777a

Browse files
committed
Adding some style, remove devcontainer from package
1 parent a07141f commit 123777a

File tree

4 files changed

+42
-4
lines changed

4 files changed

+42
-4
lines changed

.vscodeignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ gulp.js
1313
node_modules/**
1414
.github/**
1515
sample-data/**
16-
version.json
16+
version.json
17+
.devcontainer/**

media/codicon.css

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
@font-face {
7+
font-family: "codicon";
8+
font-display: block;
9+
src: url("./codicon.ttf?2ab61cbaefbdf4c7c5589068100bee0c") format("truetype");
10+
}
11+
12+
.codicon[class*='codicon-'] {
13+
font: normal normal normal 16px/1 codicon;
14+
display: inline-block;
15+
text-decoration: none;
16+
text-rendering: auto;
17+
text-align: center;
18+
-webkit-font-smoothing: antialiased;
19+
-moz-osx-font-smoothing: grayscale;
20+
user-select: none;
21+
-webkit-user-select: none;
22+
-ms-user-select: none;
23+
}
24+
25+
/*---------------------
26+
* Icons
27+
*-------------------*/
28+
29+
.codicon-add:before {
30+
content: "\ea60"
31+
}

media/codicon.ttf

71.8 KB
Binary file not shown.

src/resxProvider.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export class ResxProvider implements vscode.CustomTextEditorProvider {
3030
this.currentPanel = webviewPanel;
3131
webviewPanel.webview.options = {
3232
enableScripts: true,
33-
localResourceRoots: [vscode.Uri.joinPath(this.context.extensionUri, 'out')]
33+
localResourceRoots: [vscode.Uri.joinPath(this.context.extensionUri, 'out'), vscode.Uri.joinPath(this.context.extensionUri, 'media')]
3434
};
3535
webviewPanel.webview.html = this._getWebviewContent(webviewPanel.webview);
3636
webviewPanel.onDidChangeViewState(e => {
@@ -127,6 +127,8 @@ export class ResxProvider implements vscode.CustomTextEditorProvider {
127127
private _getWebviewContent(webview: vscode.Webview) {
128128
const webviewUri = webview.asWebviewUri(vscode.Uri.joinPath(this.context.extensionUri, 'out', 'webview.js'));
129129
const nonce = getNonce();
130+
const codiconsUri = webview.asWebviewUri(vscode.Uri.joinPath(this.context.extensionUri, 'media', 'codicon.css'));
131+
const codiconsFont = webview.asWebviewUri(vscode.Uri.joinPath(this.context.extensionUri, 'media', 'codicon.ttf'));
130132

131133
return /*html*/ `
132134
<!DOCTYPE html>
@@ -136,12 +138,16 @@ export class ResxProvider implements vscode.CustomTextEditorProvider {
136138
<meta name="viewport" content="width=device-width, initial-scale=1.0">
137139
<meta
138140
http-equiv="Content-Security-Policy"
139-
content="default-src 'none'; img-src ${webview.cspSource} https:; script-src ${webview.cspSource}; style-src ${webview.cspSource}; script-src 'nonce-${nonce}';"
141+
content="default-src 'none'; img-src ${webview.cspSource} https:; script-src 'nonce-${nonce}'; style-src ${webview.cspSource} 'nonce-${nonce}'; style-src-elem ${webview.cspSource} 'unsafe-inline'; font-src ${webview.cspSource};"
140142
/>
143+
<link href="${codiconsUri}" rel="stylesheet" nonce="${nonce}">
141144
</head>
142145
<body>
143146
<vscode-data-grid id="resource-table" aria-label="Basic" generate-header="sticky" aria-label="Sticky Header"></vscode-data-grid>
144-
<vscode-button id="add-resource-button" style="position:fixed;bottom:0;left:0">Add New Resource</vscode-button>
147+
<vscode-button id="add-resource-button">
148+
Add New Resource
149+
<span slot="start" class="codicon codicon-add"></span>
150+
</vscode-button>
145151
<script type="module" nonce="${nonce}" src="${webviewUri}"></script>
146152
</body>
147153
</html>

0 commit comments

Comments
 (0)