Skip to content

Commit

Permalink
feat(divider): support dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
BeADre committed Nov 15, 2021
1 parent ad053cc commit fa7e5ab
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/varlet-ui/src/divider/divider.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@divider-color: #bcc2cb;
@divider-color: rgba(0, 0, 0, 0.12);
@divider-text-color: #888;
@divider-text-margin: 8px 0;
@divider-text-padding: 0 8px;
Expand Down
2 changes: 1 addition & 1 deletion packages/varlet-ui/src/divider/docs/en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Here are the CSS variables used by the component, Styles can be customized using

| Variable | Default |
| --- | --- |
| `--divider-color` | `#bcc2cb` |
| `--divider-color` | `rgba(0, 0, 0, 0.12)` |
| `--divider-text-color` | `#888`|
| `--divider-text-margin` | `8px 0`|
| `--divider-text-padding` | `0 8px`|
Expand Down
2 changes: 1 addition & 1 deletion packages/varlet-ui/src/divider/docs/zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ createApp().use(Divider)

| 变量名 | 默认值 |
| --- | --- |
| `--divider-color` | `#bcc2cb` |
| `--divider-color` | `rgba(0, 0, 0, 0.12)` |
| `--divider-text-color` | `#888`|
| `--divider-text-margin` | `8px 0`|
| `--divider-text-padding` | `0 8px`|
Expand Down
2 changes: 2 additions & 0 deletions packages/varlet-ui/src/divider/example/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import VarDivider from '..'
import VarIcon from '../../icon'
import { pack, use } from './locale'
import { watchLang } from '@varlet/cli/site/utils'
import { watchDarkMode } from '../../utils/components'
export default {
name: 'DividerExample',
Expand All @@ -51,6 +52,7 @@ export default {
},
setup() {
watchLang(use)
watchDarkMode()
return {
pack,
Expand Down
3 changes: 3 additions & 0 deletions packages/varlet-ui/src/themes/dark/divider.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
'--divider-color': 'rgba(255, 255, 255, 0.12)',
}
2 changes: 2 additions & 0 deletions packages/varlet-ui/src/themes/dark/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import switchThemes from './switch'
import steps from './steps'
import pagination from './pagination'
import table from './table'
import divider from './divider'
import { StyleVars } from '../../style-provider'

export default {
Expand Down Expand Up @@ -47,4 +48,5 @@ export default {
...steps,
...pagination,
...table,
...divider,
} as StyleVars

0 comments on commit fa7e5ab

Please sign in to comment.