doc: add colorScheme
parent
d783c4e913
commit
414338bafd
|
@ -2,6 +2,6 @@
|
|||
// This will be replaced in webpack bundle
|
||||
// @root-entry-name: variable;
|
||||
|
||||
@import './default.less';
|
||||
// @import './default.less';
|
||||
// @import './variable.less';
|
||||
// @import './@{root-entry-name}.less';
|
||||
@import './@{root-entry-name}.less';
|
||||
|
|
|
@ -89,9 +89,11 @@ export default defineComponent({
|
|||
if (theme.value === 'dark') {
|
||||
document.getElementsByTagName('html')[0].setAttribute('data-doc-theme', 'dark');
|
||||
document.getElementsByTagName('body')[0].setAttribute('data-theme', 'dark');
|
||||
document.getElementsByTagName('html')[0].style.colorScheme = 'dark';
|
||||
} else {
|
||||
document.getElementsByTagName('html')[0].setAttribute('data-doc-theme', 'light');
|
||||
document.getElementsByTagName('body')[0].setAttribute('data-theme', 'light');
|
||||
document.getElementsByTagName('html')[0].style.colorScheme = 'light';
|
||||
}
|
||||
},
|
||||
{ immediate: true },
|
||||
|
|
|
@ -13,6 +13,7 @@ const themeConfig = [
|
|||
'gray-8': '@text-color',
|
||||
'background-color-base': '#555',
|
||||
'skeleton-color': 'rgba(0,0,0,0.8)',
|
||||
'root-entry-name': 'dark',
|
||||
},
|
||||
},
|
||||
];
|
||||
|
|
|
@ -49,6 +49,7 @@ export default {
|
|||
modifyVars: {
|
||||
hack: `true;@import "${require.resolve('../components/style/color/colorPalette.less')}";`,
|
||||
...defaultVar,
|
||||
'root-entry-name': 'variable',
|
||||
},
|
||||
javascriptEnabled: true,
|
||||
// includePaths: ["node_modules/"],
|
||||
|
|
Loading…
Reference in New Issue