Skip to content

Commit

Permalink
feat(select): add dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
BeADre committed Nov 13, 2021
1 parent befd63c commit 151bfc0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/varlet-ui/src/select/example/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ import AppType from '@varlet/cli/site/mobile/components/AppType'
import { reactive, toRefs } from 'vue'
import { watchLang } from '@varlet/cli/site/utils'
import { use, pack } from './locale'
import { watchDarkMode } from '../../utils/components'
export default {
name: 'SelectExample',
Expand Down Expand Up @@ -136,6 +137,8 @@ export default {
values.value11 = undefined
})
watchDarkMode()
return {
pack,
...toRefs(values),
Expand Down
2 changes: 1 addition & 1 deletion packages/varlet-ui/src/select/select.less
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
@select-placeholder-size: 16px;
@select-icon-padding: 16px 0 0;
@select-icon-size: 20px;
@select-select-text-color: #555;
@select-chip-margin: 5px 5px 0;
@select-line-size: 1px;
@select-line-spread-size: 2px;
Expand Down Expand Up @@ -97,6 +96,7 @@
transition-duration: 0.3s;
transform: translate(0, calc(-50% + var(--select-placeholder-size) / 2)) scale(1);
font-size: var(--select-placeholder-size);
color: var(--select-blur-color);
}

&__select {
Expand Down
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 @@ -14,6 +14,7 @@ import steps from './steps'
import pagination from './pagination'
import table from './talble'
import input from './input'
import select from './select'
import { StyleVars } from '../../style-provider'

export default {
Expand Down Expand Up @@ -43,4 +44,5 @@ export default {
...pagination,
...table,
...input,
...select,
} as StyleVars
5 changes: 5 additions & 0 deletions packages/varlet-ui/src/themes/dark/select.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default {
'--select-select-text-color': '#fff',
'--select-blur-color': 'rgb(255, 255, 255, .7)',
'--select-scroller-background': '#272727',
}

0 comments on commit 151bfc0

Please sign in to comment.