-
Notifications
You must be signed in to change notification settings - Fork 7
Working with webviews
Webviews like the cache properties view and the data viewer views are built with React. Fluent UI React is used for the styled UI components.
Fluent UI Styles
Fluent UI Controls
Fluent UI icons are bundled locally with the extension so that even in restricted network environments (e.g. inside a VNET), all icons can be rendered correctly (by default Fluent UI will retrieve the icon font from a CDN). This is done using the Fabric Icon subset tool to generate a subset of the Fluent UI font glyphs.
The generated bundle contains the font along with CSS and TypeScript integration code. The extension uses a modified version of the bundled TypeScript integration code. These files are located in src-webview\fabric-icons
.
-
Keep a note of the existing icons in the project. E.g. see
src-webview\fabric-icons\config\fabric-icons.json
. -
Use the icon subset tool to select all the icons to add, including the icons from Step 1.
-
Click Get subset and a ZIP file will be downloaded.
-
Extract and copy the
fabric-icons.woff
andfabric-icons.json
, overwriting the current ones. -
Modify
src-webview\fabric-icons\src\fabric-icons.ts
and overwrite theicons
property ofsubset
with what's in thefabric-icons.ts
from the ZIP file.E.g. Old
fabric-icons.ts
... icons: { 'ChevronDownMed': '\uE972', 'ChevronRightMed': '\uE974' } ...
E.g. New
fabric-icons.ts
... icons: { 'ChevronDownMed': '\uE972', 'ChevronRightMed': '\uE974', 'SocialListeningLogo': '\uED7C' } ...
If using the icon in a button, refer to this.
If using the icon just by itself, refer to this.
- Make sure the webview is visible.
- Open the Command Palette (
Ctrl+Shift+P
orCmd+Shift+P
) and select the command Developer: Open Webview Developer Tools. - Use the Developer Tools window to inspect elements, use console, etc.
More info here.