Skip to content

Commit

Permalink
feat(picker): picker support dark mode
Browse files Browse the repository at this point in the history
affects: @varlet/ui
  • Loading branch information
classmatewu authored and BeADre committed Nov 17, 2021
1 parent 647467f commit 2d404d7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 19 deletions.
2 changes: 2 additions & 0 deletions packages/varlet-ui/src/picker/example/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import context from '../../context'
import { onUnmounted, ref } from 'vue'
import { use, pack } from './locale'
import { watchLang, watchPlatform } from '@varlet/cli/site/utils'
import { watchDarkMode } from '../../utils/components'
export default {
name: 'PickerExample',
Expand Down Expand Up @@ -54,6 +55,7 @@ export default {
}
watchLang(use)
watchDarkMode()
const prevTouchmoveForbid = context.touchmoveForbid
watchPlatform((platform) => {
Expand Down
40 changes: 21 additions & 19 deletions packages/varlet-ui/src/themes/dark/index.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
import { StyleVars } from '../../style-provider'
import actionSheet from './actionSheet'
import badge from './badge'
import button from './button'
import cell from './cell'
import card from './card'
import timePicker from './timePicker'
import datePicker from './datePicker'
import skeleton from './skeleton'
import tab from './tab'
import tabItem from './tab-item'
import popup from './popup'
import dialog from './dialog'
import actionSheet from './actionSheet'
import cell from './cell'
import checkbox from './checkbox'
import chip from './chip'
import badge from './badge'
import uploader from './uploader'
import collapse from './collapse'
import datePicker from './datePicker'
import dialog from './dialog'
import divider from './divider'
import input from './input'
import pagination from './pagination'
import picker from './picker'
import popup from './popup'
import pullRefresh from './pullRefresh'
import switchThemes from './switch'
import radio from './radio'
import select from './select'
import skeleton from './skeleton'
import steps from './steps'
import pagination from './pagination'
import switchThemes from './switch'
import tab from './tab'
import tabItem from './tab-item'
import table from './table'
import input from './input'
import select from './select'
import radio from './radio'
import checkbox from './checkbox'
import divider from './divider'
import { StyleVars } from '../../style-provider'
import timePicker from './timePicker'
import uploader from './uploader'

export default {
// common
Expand Down Expand Up @@ -61,4 +62,5 @@ export default {
...radio,
...checkbox,
...divider,
...picker,
} as StyleVars
4 changes: 4 additions & 0 deletions packages/varlet-ui/src/themes/dark/picker.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default {
'--picker-background': '#272727',
'--picker-mask-background-image': `linear-gradient(180deg, hsl(0deg 0% 15%), hsl(0deg 7% 14% / 40%)), linear-gradient(0deg, hsl(0deg 0% 15%), hsl(0deg 7% 14% / 40%))`,
}

0 comments on commit 2d404d7

Please sign in to comment.