feat: kubernetes icon

I was never happy with the 'server' icon for Kubernetes context and wanted to
put the new icon contributions to good use. I spent a while finding a path
to convert the official Kubernetes SVG to woff2 - and my icon looked awful.

I tried the entire path again today with the same ugly result, until I
realized it's because all custom icons are set to italics :), which I think
is wrong so I have also fixed it here.

Signed-off-by: Tim deBoer <git@tdeboer.ca>
This commit is contained in:
Tim deBoer 2023-07-18 14:50:47 -04:00
parent e8a97bbf1e
commit 04be4dd5b8
4 changed files with 12 additions and 3 deletions

Binary file not shown.

View file

@ -16,7 +16,16 @@
"command": "kubecontext.switch",
"title": "Kube Context: switch context"
}
]
],
"icons": {
"kube-icon": {
"description": "Kubernetes icon",
"default": {
"fontPath": "kube.woff2",
"fontCharacter": "\\0041"
}
}
}
},
"scripts": {
"build": "rollup --bundleConfigAsCjs --config rollup.config.js --compact --environment BUILD:production && node ./scripts/build.js",

View file

@ -90,7 +90,7 @@ export async function updateContext(
statusBarItem = extensionApi.window.createStatusBarItem();
statusBarItem.command = 'kubecontext.quickpick';
statusBarItem.tooltip = 'Current Kubernetes context';
statusBarItem.iconClass = 'fa fa-server';
statusBarItem.iconClass = '${kube-icon}';
statusBarItem.show();
extensionContext.subscriptions.push(statusBarItem);
}

View file

@ -56,7 +56,7 @@ async function executeCommand(entry: StatusBarEntry) {
class="{opacity(entry)} px-1 {hoverBackground(entry)} {hoverCursor(entry)}"
title="{tooltipText(entry)}">
{#if iconClass(entry)}
<i class="{iconClass(entry)}" aria-hidden="true"></i>
<i class="{iconClass(entry)} not-italic" aria-hidden="true"></i>
{/if}
{#if entry.text}
<span class="ml-1">{entry.text}</span>