feat(tabs): add icon support for tabs (#926)

* feat(tabs): add icon support for tabs

- Introduced an `icon` property for tabs to display icons alongside tab labels.
- Updated the tabs shortcode and HTML partials to accommodate the new icon feature.
- Enhanced documentation for tabs to include examples of using icons in tab definitions.

* chore: rebuild css

* doc(tabs): add icon support in tab documentation for multiple languages

- Enhanced documentation for tabs to include examples of using the `icon` parameter in Persian, Japanese, and Simplified Chinese.
- Updated the tab shortcode examples to demonstrate how to display icons alongside tab labels.

* chore: regenerate compiled css

* fix(a11y): add aria-hidden to decorative tab icons

Add aria-hidden="true" to tab icon SVGs so screen readers skip
decorative icons and only announce the tab name. Update @example
docblock in tab.html to demonstrate the icon parameter.

* doc(tabs): improve icon section with better examples and icon page link

Rename "Tabs With Icons" heading to "Add Icons" for consistency with
other action-oriented section titles. Replace JSON/YAML/TOML icon
example with Photos/Music/Videos using photograph, music-note, and
film icons that naturally match their labels. Add link to the Icon
shortcode page so users can discover available icon names.
This commit is contained in:
Xin
2026-02-14 21:23:25 +00:00
committed by GitHub
parent 88aa6098f0
commit 62196dd666
9 changed files with 107 additions and 11 deletions

View File

@@ -52,6 +52,30 @@ next: /docs/guide/deploy-site
{{< /tabs >}}
### افزودن آیکون
با استفاده از پارامتر `icon` برای هر `tab` می‌توانید قبل از عنوان تب آیکون نمایش دهید.
برای مشاهده لیست آیکون‌های موجود، صفحه [شورت‌کد آیکون](../icon) را ببینید.
```
{{</* tabs */>}}
{{</* tab name="Photos" icon="photograph" */>}}مدیریت و سازماندهی کتابخانه عکس‌های شما.{{</* /tab */>}}
{{</* tab name="Music" icon="music-note" */>}}مرور و پخش آهنگ‌های مورد علاقه شما.{{</* /tab */>}}
{{</* tab name="Videos" icon="film" */>}}تماشا و پخش محتوای ویدیویی.{{</* /tab */>}}
{{</* /tabs */>}}
```
{{< tabs >}}
{{< tab name="Photos" icon="photograph" >}}مدیریت و سازماندهی کتابخانه عکس‌های شما.{{< /tab >}}
{{< tab name="Music" icon="music-note" >}}مرور و پخش آهنگ‌های مورد علاقه شما.{{< /tab >}}
{{< tab name="Videos" icon="film" >}}تماشا و پخش محتوای ویدیویی.{{< /tab >}}
{{< /tabs >}}
### استفاده از Markdown
نحو Markdown شامل بلوک کد نیز پشتیبانی می‌شود:
@@ -122,4 +146,4 @@ params:
{{</* tab name="B" */>}}محتوای دوم B{{</* /tab */>}}
{{</* /tabs */>}}
```
```

View File

@@ -52,6 +52,30 @@ next: /docs/guide/deploy-site
{{< /tabs >}}
### アイコンを追加する
各タブに `icon` を指定すると、ラベルの前にアイコンを表示できます。
利用可能なアイコンの一覧は [Icon ショートコード](../icon) ページを参照してください。
```
{{</* tabs */>}}
{{</* tab name="Photos" icon="photograph" */>}}写真ライブラリを管理・整理します。{{</* /tab */>}}
{{</* tab name="Music" icon="music-note" */>}}お気に入りの曲を閲覧・再生します。{{</* /tab */>}}
{{</* tab name="Videos" icon="film" */>}}動画コンテンツを視聴・ストリーミングします。{{</* /tab */>}}
{{</* /tabs */>}}
```
{{< tabs >}}
{{< tab name="Photos" icon="photograph" >}}写真ライブラリを管理・整理します。{{< /tab >}}
{{< tab name="Music" icon="music-note" >}}お気に入りの曲を閲覧・再生します。{{< /tab >}}
{{< tab name="Videos" icon="film" >}}動画コンテンツを視聴・ストリーミングします。{{< /tab >}}
{{< /tabs >}}
### Markdown の使用
コードブロックを含む Markdown 構文もサポートされています:
@@ -122,4 +146,4 @@ params:
{{</* tab name="B" */>}}2 番目の B の内容{{</* /tab */>}}
{{</* /tabs */>}}
```
```

View File

@@ -47,6 +47,27 @@ The `YAML` tab will be selected by default.
{{< tab name="TOML" >}}**TOML**: TOML aims to be a minimal configuration file format that's easy to read due to obvious semantics.{{< /tab >}}
{{< /tabs >}}
### Add Icons
Use the `icon` property on each `tab` to display an icon before the label.
See the [Icon shortcode](../icon) page for the list of available icons.
```
{{</* tabs */>}}
{{</* tab name="Photos" icon="photograph" */>}}Manage and organize your photo library.{{</* /tab */>}}
{{</* tab name="Music" icon="music-note" */>}}Browse and play your favorite tracks.{{</* /tab */>}}
{{</* tab name="Videos" icon="film" */>}}Watch and stream video content.{{</* /tab */>}}
{{</* /tabs */>}}
```
{{< tabs >}}
{{< tab name="Photos" icon="photograph" >}}Manage and organize your photo library.{{< /tab >}}
{{< tab name="Music" icon="music-note" >}}Browse and play your favorite tracks.{{< /tab >}}
{{< tab name="Videos" icon="film" >}}Watch and stream video content.{{< /tab >}}
{{< /tabs >}}
### Use Markdown

View File

@@ -52,6 +52,30 @@ next: /docs/guide/deploy-site
{{< /tabs >}}
### 添加图标
在每个 `tab` 上使用 `icon` 参数,可以在标签文本前显示图标。
可用图标列表请参阅 [Icon 短代码](../icon) 页面。
```
{{</* tabs */>}}
{{</* tab name="Photos" icon="photograph" */>}}管理和整理您的照片库。{{</* /tab */>}}
{{</* tab name="Music" icon="music-note" */>}}浏览和播放您喜爱的曲目。{{</* /tab */>}}
{{</* tab name="Videos" icon="film" */>}}观看和串流视频内容。{{</* /tab */>}}
{{</* /tabs */>}}
```
{{< tabs >}}
{{< tab name="Photos" icon="photograph" >}}管理和整理您的照片库。{{< /tab >}}
{{< tab name="Music" icon="music-note" >}}浏览和播放您喜爱的曲目。{{< /tab >}}
{{< tab name="Videos" icon="film" >}}观看和串流视频内容。{{< /tab >}}
{{< /tabs >}}
### 使用Markdown
支持包括代码块在内的Markdown语法
@@ -122,4 +146,4 @@ params:
{{</* tab name="B" */>}}第二个B内容{{</* /tab */>}}
{{</* /tabs */>}}
```
```