feat: tusimple config provider work with dark theme

This commit is contained in:
07akioni 2021-03-05 00:39:10 +08:00
parent d673561463
commit 0bf117ca95
5 changed files with 10 additions and 10 deletions

View File

@ -3,6 +3,7 @@
:is="configProvider"
class="demo"
namespace="naive-ui-doc"
:theme-name="themeName"
:theme="theme"
:locale="locale"
:date-locale="dateLocale"

View File

@ -122,6 +122,7 @@ export function siteSetup () {
return {
configProvider: configProviderRef,
hljs,
themeName: themeNameRef,
theme: themeRef,
locale: localeRef,
dateLocale: dateLocaleRef

View File

@ -8,7 +8,8 @@ import {
import { NConfigProvider, configProviderProps } from 'naive-ui'
import { renderFilter, renderSorter } from './data-table'
import { unconfigurableStyle, mountSvgDefs } from './unconfigurable-style-light'
import { themeOverrides } from './theme-overrides-light'
import { themeOverridesLight } from './theme-overrides-light'
import { themeOverridesDark } from './theme-overrides-dark'
import { icons } from './icons'
export default defineComponent({
@ -56,7 +57,9 @@ export default defineComponent({
<NConfigProvider
class={`ts-${this.themeName}-theme`}
{...this.$props}
themeOverrides={themeOverrides}
themeOverrides={
this.themeName === 'light' ? themeOverridesLight : themeOverridesDark
}
componentOptions={this.componentOptions}
icons={icons}
>

View File

@ -50,23 +50,18 @@ export const colors = {
textColor2: '#D6D6D6'
}
export const themeOverrides: GlobalThemeOverrides = {
export const themeOverridesDark: GlobalThemeOverrides = {
common: {
fontSize: '16px',
fontSizeMedium: '16px',
fontWeightStrong: '700',
borderRadius: '16px',
borderColor: '#D6D6D6',
borderColor: '#5B5B5B',
opacity1: '0.8',
opacity2: '0.6',
opacity3: '0.4',
opacity4: '0.2',
opacity5: '0.2',
// dividerColor: '#EBEDF0',
// tableHeaderColor: '#EBEDF0',
// inputColorDisabled: '#EBEDF0',
// actionColor: '#EBEDF0',
// hoverColor: composite(colors.primaryColor, 'rgba(255, 255, 255, .1)'),
baseColor: '#FFFFFF',
dividerColor: '#5B5B5B',
popoverColor: '#333333',

View File

@ -35,7 +35,7 @@ export const colors = {
textColor2: '#333'
}
export const themeOverrides: GlobalThemeOverrides = {
export const themeOverridesLight: GlobalThemeOverrides = {
common: {
fontSize: '16px',
fontSizeMedium: '16px',