mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-03-01 13:36:55 +08:00
feat: tusimple config provider work with dark theme
This commit is contained in:
parent
d673561463
commit
0bf117ca95
@ -3,6 +3,7 @@
|
||||
:is="configProvider"
|
||||
class="demo"
|
||||
namespace="naive-ui-doc"
|
||||
:theme-name="themeName"
|
||||
:theme="theme"
|
||||
:locale="locale"
|
||||
:date-locale="dateLocale"
|
||||
|
@ -122,6 +122,7 @@ export function siteSetup () {
|
||||
return {
|
||||
configProvider: configProviderRef,
|
||||
hljs,
|
||||
themeName: themeNameRef,
|
||||
theme: themeRef,
|
||||
locale: localeRef,
|
||||
dateLocale: dateLocaleRef
|
||||
|
@ -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}
|
||||
>
|
||||
|
@ -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',
|
||||
|
@ -35,7 +35,7 @@ export const colors = {
|
||||
textColor2: '#333'
|
||||
}
|
||||
|
||||
export const themeOverrides: GlobalThemeOverrides = {
|
||||
export const themeOverridesLight: GlobalThemeOverrides = {
|
||||
common: {
|
||||
fontSize: '16px',
|
||||
fontSizeMedium: '16px',
|
||||
|
Loading…
Reference in New Issue
Block a user