Skip to content

Commit 5b9d2d2

Browse files
authored
Merge pull request #14 from vscode-elements/update-badge-docs
Update badge docs
2 parents a09f7f4 + 0b32183 commit 5b9d2d2

File tree

6 files changed

+59
-8
lines changed

6 files changed

+59
-8
lines changed

astro.config.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { defineConfig } from "astro/config";
33
import starlight from "@astrojs/starlight";
44
import { pluginLineNumbers } from "@expressive-code/plugin-line-numbers";
5+
import starlightImageZoom from "starlight-image-zoom";
56

67
const analytics = `
78
(function(window, document, dataLayerName, id) {
@@ -32,8 +33,8 @@ export default defineConfig({
3233
tag: "meta",
3334
attrs: {
3435
name: "google-site-verification",
35-
content: "xQEXVaL5aIe6GfMlfVDFzRqf0f4_XgL4son-Lk9RPQM"
36-
}
36+
content: "xQEXVaL5aIe6GfMlfVDFzRqf0f4_XgL4son-Lk9RPQM",
37+
},
3738
},
3839
{
3940
tag: "script",
@@ -160,6 +161,7 @@ export default defineConfig({
160161
"./src/styles/restore-defaults.css",
161162
"./src/styles/custom.css",
162163
],
164+
plugins: [starlightImageZoom()],
163165
}),
164166
],
165167
});

package-lock.json

Lines changed: 22 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@
1414
"@astrojs/check": "^0.9.4",
1515
"@astrojs/starlight": "^0.31.1",
1616
"@expressive-code/plugin-line-numbers": "^0.40.1",
17-
"@vscode-elements/elements": "^1.12.0",
17+
"@vscode-elements/elements": "^1.13.0",
1818
"@vscode-elements/webview-playground": "^1.6.0",
1919
"astro": "^5.2.5",
2020
"marked": "^15.0.6",
2121
"sharp": "^0.33.5",
22+
"starlight-image-zoom": "^0.10.1",
2223
"typescript": "^5.7.3"
2324
},
2425
"devDependencies": {

src/assets/badge-types.png

187 KB
Loading

src/content/docs/components/badge.mdx

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,30 @@
22
title: Badge
33
---
44

5+
import { Image } from "astro:assets";
56
import Demo from "@components/Demo.astro";
67
import PageSwitcher from "@components/PageSwitcher.astro";
78
import Imports from "@components/examples/badge/Imports.astro";
9+
import badgeTypes from "@assets/badge-types.png";
810

911
<Imports />
1012
<PageSwitcher />
1113

12-
## Basic example
14+
## Explanation of badge styles
15+
16+
The following badge styles have been implemented based on the VSCode UI:
17+
18+
1. Default style
19+
2. Activity bar counter
20+
3. Counter
21+
4. Tab bar counter
22+
23+
<Image
24+
src={badgeTypes}
25+
alt="Visual explanation of various badge styles"
26+
/>
27+
28+
## Default style
1329

1430
<Demo>
1531
<vscode-badge>308 Settings Found</vscode-badge>
@@ -41,3 +57,14 @@ import Imports from "@components/examples/badge/Imports.astro";
4157
```
4258
</Fragment>
4359
</Demo>
60+
61+
## Tab bar counter
62+
63+
<Demo>
64+
<vscode-badge variant="activity-bar-counter">42</vscode-badge>
65+
<Fragment slot="html">
66+
```html
67+
<vscode-badge variant="tab-bar-counter">42</vscode-badge>
68+
```
69+
</Fragment>
70+
</Demo>

tsconfig.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
"@data/*": [
1111
"src/data/*"
1212
],
13+
"@assets/*": [
14+
"src/assets/*"
15+
],
1316
}
1417
}
1518
}

0 commit comments

Comments
 (0)