mirror of
https://github.com/zhigang1992/react.git
synced 2026-04-23 11:57:40 +08:00
docs(themes): show all types of theme definitions
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import Layout from 'lib/components/layout'
|
||||
import { Note, Code, Spacer } from 'components'
|
||||
import { Note, Code, Spacer, Link } from 'components'
|
||||
|
||||
export const meta = {
|
||||
title: 'Themes',
|
||||
@@ -72,6 +72,29 @@ const App = () => (
|
||||
)
|
||||
```
|
||||
|
||||
<Spacer y={3} />
|
||||
|
||||
### View all types of Theme definitions
|
||||
|
||||
If you are using TypeScript, you can import various preset types:
|
||||
|
||||
```ts
|
||||
import {
|
||||
ZeitUIThemes,
|
||||
ZeitUIThemesFont,
|
||||
ZeitUIThemesPalette,
|
||||
ZeitUIThemesExpressiveness,
|
||||
ZeitUIThemesLayout,
|
||||
} from '@zeit-ui/react'
|
||||
|
||||
// usage:
|
||||
const myStyles: ZeitUIThemes = { /* ... */ }
|
||||
const myPalette: Partial<ZeitUIThemesPalette> = { /* ... */ }
|
||||
```
|
||||
|
||||
If you don't use TypeScript, to learn more about preset types, see <Link color target="_blank" pure href="https://github.com/zeit-ui/react/blob/master/components/styles/themes/index.ts">here</Link>.
|
||||
|
||||
|
||||
<Spacer y={3} />
|
||||
|
||||
### Customizing components
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Layout from 'lib/components/layout'
|
||||
import { Note, Code, Spacer } from 'components'
|
||||
import { Note, Code, Spacer, Link } from 'components'
|
||||
|
||||
export const meta = {
|
||||
title: '主题',
|
||||
@@ -74,6 +74,28 @@ const App = () => (
|
||||
|
||||
<Spacer y={3} />
|
||||
|
||||
### 查看主题定义的所有类型
|
||||
|
||||
如果你正在使用 TypeScript,可以选择引入各类预置的类型:
|
||||
|
||||
```ts
|
||||
import {
|
||||
ZeitUIThemes,
|
||||
ZeitUIThemesFont,
|
||||
ZeitUIThemesPalette,
|
||||
ZeitUIThemesExpressiveness,
|
||||
ZeitUIThemesLayout,
|
||||
} from '@zeit-ui/react'
|
||||
|
||||
// 使用示例
|
||||
const myStyles: ZeitUIThemes = { /* ... */ }
|
||||
const myPalette: Partial<ZeitUIThemesPalette> = { /* ... */ }
|
||||
```
|
||||
|
||||
如果你没有使用 TypeScript,想要了解更多的预置类型,请看<Link color target="_blank" pure href="https://github.com/zeit-ui/react/blob/master/components/styles/themes/index.ts">这里的类型声明文件</Link>。
|
||||
|
||||
<Spacer y={3} />
|
||||
|
||||
### 定制化组件
|
||||
|
||||
#### 通过 `className` 重写样式
|
||||
|
||||
Reference in New Issue
Block a user