From 15e52e675f0383cdc5269048a950eb53cf82bf75 Mon Sep 17 00:00:00 2001 From: 07akioni <07akioni2@gmail.com> Date: Tue, 2 Feb 2021 11:50:58 +0800 Subject: [PATCH] styles: remove exported light theme, since it is builtin theme --- demo/pages/doc/theme/enUS/element.demo.md | 7 +- .../doc/theme/enUS/provide-theme.demo.md | 7 +- demo/pages/doc/theme/zhCN/element.demo.md | 7 +- .../doc/theme/zhCN/provide-theme.demo.md | 7 +- .../demos/enUS/os-theme.demo.md | 6 +- src/config-provider/demos/enUS/theme.demo.md | 9 +- .../demos/zhCN/os-theme.demo.md | 6 +- src/config-provider/demos/zhCN/theme.demo.md | 9 +- src/config-provider/src/interface.ts | 2 +- src/element/demos/enUS/basic.demo.md | 9 +- src/element/demos/zhCN/basic.demo.md | 9 +- src/index.ts | 2 +- src/themes/dark.ts | 3 +- src/themes/index.ts | 1 - src/themes/interface.ts | 6 + src/themes/light.ts | 133 ------------------ 16 files changed, 44 insertions(+), 179 deletions(-) create mode 100644 src/themes/interface.ts delete mode 100644 src/themes/light.ts diff --git a/demo/pages/doc/theme/enUS/element.demo.md b/demo/pages/doc/theme/enUS/element.demo.md index 2d43c17ec..b9d63592f 100644 --- a/demo/pages/doc/theme/enUS/element.demo.md +++ b/demo/pages/doc/theme/enUS/element.demo.md @@ -6,7 +6,7 @@ Naive UI has `n-element` component. See [Element](n-element). Dark - Light + Light @@ -23,14 +23,13 @@ Naive UI has `n-element` component. See [Element](n-element). ```js import { ref } from 'vue' -import { darkTheme, lightTheme } from 'naive-ui' +import { darkTheme } from 'naive-ui' export default { setup () { return { darkTheme, - lightTheme, - theme: ref(lightTheme) + theme: ref() } } } diff --git a/demo/pages/doc/theme/enUS/provide-theme.demo.md b/demo/pages/doc/theme/enUS/provide-theme.demo.md index af25f7754..e63381376 100644 --- a/demo/pages/doc/theme/enUS/provide-theme.demo.md +++ b/demo/pages/doc/theme/enUS/provide-theme.demo.md @@ -7,7 +7,7 @@ Use `n-config-provider` to set the theme of all its descedant components. Dark - Light + Light @@ -15,14 +15,13 @@ Use `n-config-provider` to set the theme of all its descedant components. ```js import { ref } from 'vue' -import { darkTheme, lightTheme } from 'naive-ui' +import { darkTheme } from 'naive-ui' export default { setup () { return { darkTheme, - lightTheme, - theme: ref(lightTheme) + theme: ref() } } } diff --git a/demo/pages/doc/theme/zhCN/element.demo.md b/demo/pages/doc/theme/zhCN/element.demo.md index 84c473d02..1b82f756e 100644 --- a/demo/pages/doc/theme/zhCN/element.demo.md +++ b/demo/pages/doc/theme/zhCN/element.demo.md @@ -6,7 +6,7 @@ Naive UI 提供 `n-element` 组件,参考 [Element](n-element)。 深色 - 浅色 + 浅色 @@ -23,14 +23,13 @@ Naive UI 提供 `n-element` 组件,参考 [Element](n-element)。 ```js import { ref } from 'vue' -import { darkTheme, lightTheme } from 'naive-ui' +import { darkTheme } from 'naive-ui' export default { setup () { return { darkTheme, - lightTheme, - theme: ref(lightTheme) + theme: ref() } } } diff --git a/demo/pages/doc/theme/zhCN/provide-theme.demo.md b/demo/pages/doc/theme/zhCN/provide-theme.demo.md index 6a1463203..868b6aa6d 100644 --- a/demo/pages/doc/theme/zhCN/provide-theme.demo.md +++ b/demo/pages/doc/theme/zhCN/provide-theme.demo.md @@ -7,7 +7,7 @@ 深色 - 浅色 + 浅色 @@ -15,14 +15,13 @@ ```js import { ref } from 'vue' -import { darkTheme, lightTheme } from 'naive-ui' +import { darkTheme } from 'naive-ui' export default { setup () { return { darkTheme, - lightTheme, - theme: ref(lightTheme) + theme: ref() } } } diff --git a/src/config-provider/demos/enUS/os-theme.demo.md b/src/config-provider/demos/enUS/os-theme.demo.md index bd8d1f47b..f3cbed905 100644 --- a/src/config-provider/demos/enUS/os-theme.demo.md +++ b/src/config-provider/demos/enUS/os-theme.demo.md @@ -3,21 +3,21 @@ Naive UI provides `useOsTheme` to get the current theme of your OS. ```html - + Your current system theme is {{ osTheme }}. ``` ```js import { computed } from 'vue' -import { useOsTheme, lightTheme, darkTheme } from 'naive-ui' +import { useOsTheme, darkTheme } from 'naive-ui' export default { setup () { const osThemeRef = useOsTheme() return { theme: computed(() => - osThemeRef.value === 'dark' ? darkTheme : lightTheme + osThemeRef.value === 'dark' ? darkTheme : undefined ), osTheme: osThemeRef } diff --git a/src/config-provider/demos/enUS/theme.demo.md b/src/config-provider/demos/enUS/theme.demo.md index 2991157db..c8e7f5956 100644 --- a/src/config-provider/demos/enUS/theme.demo.md +++ b/src/config-provider/demos/enUS/theme.demo.md @@ -3,11 +3,11 @@ Set theme of inner components of `n-config-provider`. ```html - + Dark - Light + Light @@ -15,14 +15,13 @@ Set theme of inner components of `n-config-provider`. ```js import { ref } from 'vue' -import { darkTheme, lightTheme } from 'naive-ui' +import { darkTheme } from 'naive-ui' export default { setup () { return { darkTheme, - lightTheme, - theme: ref(lightTheme) + theme: ref() } } } diff --git a/src/config-provider/demos/zhCN/os-theme.demo.md b/src/config-provider/demos/zhCN/os-theme.demo.md index 49eac06a5..e21ec79ef 100644 --- a/src/config-provider/demos/zhCN/os-theme.demo.md +++ b/src/config-provider/demos/zhCN/os-theme.demo.md @@ -3,21 +3,21 @@ Naive UI 提供 `useOsTheme` 来获取当前操作系统的主题。 ```html - + 当前操作系统的主题是 {{ osTheme }}。 ``` ```js import { computed } from 'vue' -import { useOsTheme, lightTheme, darkTheme } from 'naive-ui' +import { useOsTheme, darkTheme } from 'naive-ui' export default { setup () { const osThemeRef = useOsTheme() return { theme: computed(() => - osThemeRef.value === 'dark' ? darkTheme : lightTheme + osThemeRef.value === 'dark' ? darkTheme : undefined ), osTheme: osThemeRef } diff --git a/src/config-provider/demos/zhCN/theme.demo.md b/src/config-provider/demos/zhCN/theme.demo.md index 81605dff8..db456cdec 100644 --- a/src/config-provider/demos/zhCN/theme.demo.md +++ b/src/config-provider/demos/zhCN/theme.demo.md @@ -3,11 +3,11 @@ 设置 `n-config-provider` 内部组件的主题。 ```html - + 深色 - 浅色 + 浅色 @@ -15,14 +15,13 @@ ```js import { ref } from 'vue' -import { darkTheme, lightTheme } from 'naive-ui' +import { darkTheme } from 'naive-ui' export default { setup () { return { darkTheme, - lightTheme, - theme: ref(lightTheme) + theme: ref() } } } diff --git a/src/config-provider/src/interface.ts b/src/config-provider/src/interface.ts index 6154ef5de..5aff3e00b 100644 --- a/src/config-provider/src/interface.ts +++ b/src/config-provider/src/interface.ts @@ -70,7 +70,7 @@ import type { ExtractThemeOverrides } from '../../_mixins/use-theme' import type { Hljs } from '../../_mixins' export interface GlobalTheme { - common: ThemeCommonVars + common?: ThemeCommonVars Alert?: AlertTheme Anchor?: AnchorTheme AutoComplete?: AutoCompleteTheme diff --git a/src/element/demos/enUS/basic.demo.md b/src/element/demos/enUS/basic.demo.md index 9a7630fa2..7834b05f9 100644 --- a/src/element/demos/enUS/basic.demo.md +++ b/src/element/demos/enUS/basic.demo.md @@ -6,9 +6,9 @@ It is very useful to create themed component. Dark - Light + Light - + 深色 - 浅色 + 浅色 - + , +'InternalSelectMenu' | 'InternalSelection' +> diff --git a/src/themes/light.ts b/src/themes/light.ts deleted file mode 100644 index e32ceba8f..000000000 --- a/src/themes/light.ts +++ /dev/null @@ -1,133 +0,0 @@ -import { commonLight } from '../_styles/common' -import { alertLight } from '../alert/styles' -import { anchorLight } from '../anchor/styles' -import { autoCompleteLight } from '../auto-complete/styles' -import { avatarLight } from '../avatar/styles' -import { backTopLight } from '../back-top/styles' -import { badgeLight } from '../badge/styles' -import { breadcrumbLight } from '../breadcrumb/styles' -import { buttonLight } from '../button/styles' -import { cardLight } from '../card/styles' -import { cascaderLight } from '../cascader/styles' -import { checkboxLight } from '../checkbox/styles' -import { codeLight } from '../code/styles' -import { collapseLight } from '../collapse/styles' -import { dataTableLight } from '../data-table/styles' -import { datePickerLight } from '../date-picker/styles' -import { descriptionsLight } from '../descriptions/styles' -import { dialogLight } from '../dialog/styles' -import { dividerLight } from '../divider/styles' -import { drawerLight } from '../drawer/styles' -import { dropdownLight } from '../dropdown/styles' -import { dynamicInputLight } from '../dynamic-input/styles' -import { dynamicTagsLight } from '../dynamic-tags/styles' -import { elementLight } from '../element/styles' -import { emptyLight } from '../empty/styles' -import { formLight } from '../form/styles' -import { gradientTextLight } from '../gradient-text/styles' -import { iconLight } from '../icon/styles' -import { inputLight } from '../input/styles' -import { inputNumberLight } from '../input-number/styles' -import { layoutLight } from '../layout/styles' -import { listLight } from '../list/styles' -import { loadingBarLight } from '../loading-bar/styles' -import { logLight } from '../log/styles' -import { menuLight } from '../menu/styles' -import { messageLight } from '../message/styles' -import { modalLight } from '../modal/styles' -import { notificationLight } from '../notification/styles' -import { paginationLight } from '../pagination/styles' -import { popconfirmLight } from '../popconfirm/styles' -import { popoverLight } from '../popover/styles' -import { popselectLight } from '../popselect/styles' -import { progressLight } from '../progress/styles' -import { radioLight } from '../radio/styles' -import { rateLight } from '../rate/styles' -import { resultLight } from '../result/styles' -import { scrollbarLight } from '../scrollbar/styles' -import { sliderLight } from '../slider/styles' -import { spaceLight } from '../space/styles' -import { spinLight } from '../spin/styles' -import { statisticLight } from '../statistic/styles' -import { stepsLight } from '../steps/styles' -import { switchLight } from '../switch/styles' -import { tableLight } from '../table/styles' -import { tabsLight } from '../tabs/styles' -import { tagLight } from '../tag/styles' -import { thingLight } from '../thing/styles' -import { timePickerLight } from '../time-picker/styles' -import { timelineLight } from '../timeline/styles' -import { tooltipLight } from '../tooltip/styles' -import { transferLight } from '../transfer/styles' -import { typographyLight } from '../typography/styles' -import { treeLight } from '../tree/styles' -import { uploadLight } from '../upload/styles' -import { selectLight } from '../select/styles' - -export const lightTheme = { - common: commonLight, - Alert: alertLight, - Anchor: anchorLight, - AutoComplete: autoCompleteLight, - Avatar: avatarLight, - BackTop: backTopLight, - Badge: badgeLight, - Breadcrumb: breadcrumbLight, - Button: buttonLight, - Card: cardLight, - Cascader: cascaderLight, - Checkbox: checkboxLight, - Code: codeLight, - Collapse: collapseLight, - DataTable: dataTableLight, - DatePicker: datePickerLight, - Descriptions: descriptionsLight, - Dialog: dialogLight, - Divider: dividerLight, - Drawer: drawerLight, - Dropdown: dropdownLight, - DynamicInput: dynamicInputLight, - DynamicTags: dynamicTagsLight, - Element: elementLight, - Empty: emptyLight, - Form: formLight, - GradientText: gradientTextLight, - Icon: iconLight, - Input: inputLight, - InputNumber: inputNumberLight, - Layout: layoutLight, - List: listLight, - LoadingBar: loadingBarLight, - Log: logLight, - Menu: menuLight, - Message: messageLight, - Modal: modalLight, - Notification: notificationLight, - Pagination: paginationLight, - Popconfirm: popconfirmLight, - Popover: popoverLight, - Popselect: popselectLight, - Progress: progressLight, - Radio: radioLight, - Rate: rateLight, - Result: resultLight, - Scrollbar: scrollbarLight, - Select: selectLight, - Slider: sliderLight, - Space: spaceLight, - Spin: spinLight, - Statistic: statisticLight, - Steps: stepsLight, - Switch: switchLight, - Table: tableLight, - Tabs: tabsLight, - Tag: tagLight, - Thing: thingLight, - TimePicker: timePickerLight, - Timeline: timelineLight, - Tooltip: tooltipLight, - Transfer: transferLight, - Tree: treeLight, - Typography: typographyLight, - Upload: uploadLight -}