Skip to content

Commit

Permalink
docs(custom-theme): add info for custom icon (#681)
Browse files Browse the repository at this point in the history
  • Loading branch information
10Derozan authored Feb 28, 2024
1 parent 74751bd commit 11361b0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/document/docs/en/guide/advanced/custom-theme.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,18 @@ export * from 'rspress/theme';

Of course, you may need to use page data during the development process, you can get it through the Hook [`usePageData`](/api/client-api/api-runtime#usepagedata).

### 4. Custom Icon

If you want to modify the icons used in the default theme component individually, just put the icons with the same name in the theme/assets directory.

```bash
├── theme
│ └── assets
│ └── xx.svg
```

[Look](https://github.com/web-infra-dev/rspress/tree/main/packages/theme-default/src/assets)All icons used in the default theme.

## Redevelop a custom theme

If you're developing a custom theme from scratch, you need to understand the basic structure of the theme and the runtime API.
Expand Down
12 changes: 12 additions & 0 deletions packages/document/docs/zh/guide/advanced/custom-theme.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,18 @@ export * from 'rspress/theme';

当然,在开发过程可能需要使用页面的数据,你可以通过 [`usePageData`](/api/client-api/api-runtime#usepagedata) 这个 Hook 来获取。

### 4. 自定义图标

如果想要单独修改默认主题组件里用到的图标,只需要将同名图标放在 theme/assets 目录下即可。

```bash
├── theme
│ └── assets
│ └── xx.svg
```

[查看](https://github.com/web-infra-dev/rspress/tree/main/packages/theme-default/src/assets)默认主题中用到的所有图标

## 重新开发自定义主题

如果你要从头开始开发一个自定义主题,你需要了解一下主题的组成。
Expand Down

0 comments on commit 11361b0

Please sign in to comment.