Closed BDOXHN closed 9 months ago
Hi,
Is this link tag included in your HTML?
<link rel="stylesheet" href="path/to/codicon.css" id="vscode-codicon-stylesheet" />
One more thing came to my mind. Maybe your CSP settings are set incorrectly. Check this example: https://github.com/vscode-elements/vscode-vscwe-demo/blob/master/src/extension.ts
Good day! Thank you for your webkit, it is really powerfull! I tried to use vscode icon in my react webview project, but it doesnt work :( What I already tried to do: 1) Downloaded only codicon css and import in my React Component likie import './styles/codeicon.css', but it doesnt work 2) Installed codeicon from npm https://www.npmjs.com/package/@vscode/codicons, imported codeicon css from dist library, ut it doesnt work When i try to use this code (from @vscode/codicons examples)
<div class="icon"><i class="codicon codicon-arrow-left"></i></div>
icons works, but it doesnt with your packageDo you have any example of how to use vscode-icon with react?
my settings rn: 1) global.d.ts `import { Children, DOMAttributes } from 'react'; import { VscodeBadge, VscodeButton, VscodeCheckbox, VscodeCheckboxGroup, VscodeCollapsible, VscodeContextMenu, VscodeContextMenuItem, VscodeFormContainer, VscodeFormGroup, VscodeFormHelper, VscodeIcon, VscodeLabel, VscodeMultiSelect, VscodeOption, VscodeRadio, VscodeRadioGroup, VscodeScrollable, VscodeSingleSelect, VscodeSplitLayout, VscodeTabHeader, VscodeTable, VscodeTableBody, VscodeTableCell, VscodeTableHeader, VscodeTableHeaderCell, VscodeTableRow, VscodeTabPanel, VscodeTabs, VscodeTextarea, VscodeTextfield, VscodeTree, } from '@bendera/vscode-webview-elements';
type CustomElement = Partial<T & DOMAttributes & { children: Children }>;
declare global { namespace React.JSX { interface IntrinsicElements {
} `
how i use it
import '@bendera/vscode-webview-elements/dist/vscode-button/index.js';
<vscode-button icon="play" secondary className="flex flex-row justify-end gap-1">