diff --git a/packages/components/button/style/index.less b/packages/components/button/style/index.less index 96dbb4878..d7d67ac11 100644 --- a/packages/components/button/style/index.less +++ b/packages/components/button/style/index.less @@ -118,6 +118,7 @@ background-color: transparent; border-color: transparent; padding: 0; + min-width: auto; &:focus, &:hover { diff --git a/packages/site/src/components/global/GlobalTheme.vue b/packages/site/src/components/global/GlobalTheme.vue index 168ee923b..a79a23a4f 100644 --- a/packages/site/src/components/global/GlobalTheme.vue +++ b/packages/site/src/components/global/GlobalTheme.vue @@ -25,15 +25,22 @@ const dataSource: MenuData[] = [ ] const themeKey = 'idux_theme' -const selectedKeys = ref([localStorage.getItem(themeKey) || 'default']) +const currTheme = localStorage.getItem(themeKey) || 'default' +const selectedKeys = ref([currTheme]) -watch(selectedKeys, ([currTheme]) => { - localStorage.setItem(themeKey, currTheme) +const loadTheme = (theme: string) => { if (window.changeTheme) { - window.changeTheme(currTheme) + window.changeTheme(theme) } else { - fetch('/themes/s/' + currTheme) + fetch(`/themes/s/${theme}`) } +} + +loadTheme(currTheme) + +watch(selectedKeys, ([theme]) => { + localStorage.setItem(themeKey, theme) + loadTheme(theme) }) diff --git a/packages/site/src/styles/themes/index.less b/packages/site/src/styles/themes/index.less index e27f5ee82..c0cc275f1 100644 --- a/packages/site/src/styles/themes/index.less +++ b/packages/site/src/styles/themes/index.less @@ -1,2 +1,2 @@ // auto generated file -@import './default.less'; +@import './seer.less';