Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

### Added

- Added fallback styles to **Textarea**, **Collapsible**, **Checkbox**.
- Added fallback styles to **Textarea**, **Collapsible**, **Checkbox**, **Radio**.
- Added support for handling multiple versions of registered custom elements.
If a tag name is already registered in the CustomElementRegistry, the browser error is prevented,
and a warning is displayed. This warning can be suppressed.
Expand Down
31 changes: 31 additions & 0 deletions dev/vscode-radio/fallback-styles.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>VSCode Elements</title>
<link
rel="stylesheet"
href="/node_modules/@vscode/codicons/dist/codicon.css"
id="vscode-codicon-stylesheet"
>
<script type="module" src="/dist/main.js"></script>
<script>
const logEvents = (selector, eventType) => {
document.querySelector(selector).addEventListener(eventType, (ev) => {
console.log(ev);
});
};
</script>
</head>

<body style="background-color: #1f1f1f">
<h1>%%TITLE%%</h1>
<main>
<vscode-radio-group>
<vscode-radio name="radio" required>Lorem</vscode-radio>
<vscode-radio name="radio">Ipsum</vscode-radio>
</vscode-radio-group>
</main>
</body>
</html>
4 changes: 2 additions & 2 deletions src/vscode-radio/vscode-radio.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const styles: CSSResultGroup = [
css`
:host(:invalid) .icon,
:host([invalid]) .icon {
background-color: var(--vscode-inputValidation-errorBackground);
background-color: var(--vscode-inputValidation-errorBackground, #5a1d1d);
border-color: var(--vscode-inputValidation-errorBorder, #be1100);
}

Expand All @@ -29,7 +29,7 @@ const styles: CSSResultGroup = [
}

:host(:focus):host(:not([disabled])) .icon {
outline: 1px solid var(--vscode-focusBorder);
outline: 1px solid var(--vscode-focusBorder, #0078d4);
outline-offset: -1px;
}
`,
Expand Down
17 changes: 9 additions & 8 deletions src/vscode-radio/vscode-radio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ import {AssociatedFormControl} from '../includes/AssociatedFormControl.js';
*
* [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event)
*
* @cssprop --vscode-font-family
* @cssprop --vscode-font-size
* @cssprop --vscode-font-weight
* @cssprop --vsc-foreground-translucent - Label font color. 90% transparency version of `--vscode-foreground` by default.
* @cssprop --vscode-settings-checkboxBackground
* @cssprop --vscode-settings-checkboxBorder
* @cssprop --vscode-settings-checkboxForeground
* @cssprop --vscode-focusBorder
* @cssprop [--vscode-font-family=sans-serif]
* @cssprop [--vscode-font-size=13px]
* @cssprop [--vscode-font-weight=normal]
* @cssprop [--vscode-settings-checkboxBackground=#313131]
* @cssprop [--vscode-settings-checkboxBorder=#3c3c3c]
* @cssprop [--vscode-settings-checkboxForeground=#cccccc]
* @cssprop [--vscode-focusBorder=#0078d4]
* @cssprop [--vscode-inputValidation-errorBackground=#5a1d1d]
* @cssprop [--vscode-inputValidation-errorBorder=#be1100]
*/
@customElement('vscode-radio')
export class VscodeRadio
Expand Down