refactor: import styles in treeshakable manner

This commit is contained in:
07akioni 2020-11-07 00:54:03 +08:00
parent f216556231
commit 473470680a
18 changed files with 115 additions and 87 deletions

View File

@ -1,13 +1,15 @@
import create from '../../_styles/utils/create-component-base'
import baseSelectMenuStyle from '../../_base/select-menu/styles/dark'
import inputStyle from '../../input/styles/dark'
import {
baseSelectMenuDark,
inputDark
} from '../../styles'
export default create({
theme: 'dark',
name: 'AutoComplete',
peer: [
baseSelectMenuStyle,
inputStyle
baseSelectMenuDark,
inputDark
],
getDerivedVariables ({ base, derived }) {
return {}

View File

@ -1,13 +1,15 @@
import create from '../../_styles/utils/create-component-base'
import baseSelectMenuStyle from '../../_base/select-menu/styles/light'
import inputStyle from '../../input/styles/light'
import {
baseSelectMenuLight,
inputLight
} from '../../styles'
export default create({
theme: 'light',
name: 'AutoComplete',
peer: [
baseSelectMenuStyle,
inputStyle
baseSelectMenuLight,
inputLight
],
getDerivedVariables ({ base, derived }) {
return {}

View File

@ -1,11 +1,13 @@
import create from '../../_styles/utils/create-component-base'
import baseSlotMachineStyle from '../../_base/slot-machine/styles/dark'
import {
baseSlotMachineDark
} from '../../styles'
export default create({
name: 'Badge',
theme: 'dark',
peer: [
baseSlotMachineStyle
baseSlotMachineDark
],
getDerivedVariables ({ derived }) {
return {

View File

@ -1,11 +1,13 @@
import create from '../../_styles/utils/create-component-base'
import baseSlotMachineStyle from '../../_base/slot-machine/styles/light'
import {
baseSlotMachineLight
} from '../../styles'
export default create({
name: 'Badge',
theme: 'light',
peer: [
baseSlotMachineStyle
baseSlotMachineLight
],
getDerivedVariables ({ derived }) {
return {

View File

@ -1,24 +1,24 @@
import create from '../../_styles/utils/create-component-base'
import sizeVariables from './_common'
import baseMenuMaskStyle from '../../_base/menu-mask/styles/dark'
import baseSelectMenuStyle from '../../_base/select-menu/styles/dark'
import baseSelectionStyle from '../../_base/selection/styles/dark'
import baseLoadingStyle from '../../_base/loading/styles/dark'
import scrollbarStyle from '../../scrollbar/styles/dark'
import radioStyle from '../../radio/styles/dark'
import checkboxStyle from '../../checkbox/styles/dark'
import {
baseMenuMaskDark,
baseSelectMenuDark,
baseSelectionDark,
baseLoadingDark,
scrollbarDark,
checkboxDark
} from '../../styles'
export default create({
theme: 'dark',
name: 'Cascader',
peer: [
baseMenuMaskStyle,
baseSelectMenuStyle,
baseSelectionStyle,
baseLoadingStyle,
scrollbarStyle,
radioStyle,
checkboxStyle
baseMenuMaskDark,
baseSelectMenuDark,
baseSelectionDark,
baseLoadingDark,
scrollbarDark,
checkboxDark
],
getDerivedVariables ({ base, derived }) {
const {

View File

@ -1,24 +1,22 @@
import create from '../../_styles/utils/create-component-base'
import sizeVariables from './_common'
import baseMenuMaskStyle from '../../_base/menu-mask/styles/light'
import baseSelectMenuStyle from '../../_base/select-menu/styles/light'
import baseSelectionStyle from '../../_base/selection/styles/light'
import baseLoadingStyle from '../../_base/loading/styles/light'
import scrollbarStyle from '../../scrollbar/styles/light'
import radioStyle from '../../radio/styles/light'
import checkboxStyle from '../../checkbox/styles/light'
import {
baseMenuMaskLight,
baseSelectMenuLight,
baseLoadingLight,
scrollbarLight,
checkboxLight
} from '../../styles'
export default create({
theme: 'light',
name: 'Cascader',
peer: [
baseMenuMaskStyle,
baseSelectMenuStyle,
baseSelectionStyle,
baseLoadingStyle,
scrollbarStyle,
radioStyle,
checkboxStyle
baseMenuMaskLight,
baseSelectMenuLight,
baseLoadingLight,
scrollbarLight,
checkboxLight
],
getDerivedVariables ({ base, derived }) {
const {

View File

@ -1,12 +1,16 @@
import create from '../../_styles/utils/create-component-base'
import commonVariables from './_common'
import { changeColor } from '../../_utils/color/index'
import suffixStyle from '../../_base/suffix/styles/dark'
import {
baseSuffixDark
} from '../../styles'
export default create({
name: 'Input',
theme: 'dark',
peer: [suffixStyle],
peer: [
baseSuffixDark
],
getDerivedVariables ({ base, derived }) {
const {
textColor2Overlay,

View File

@ -1,12 +1,16 @@
import create from '../../_styles/utils/create-component-base'
import commonVariables from './_common'
import { changeColor } from '../../_utils/color/index'
import suffixStyle from '../../_base/suffix/styles/light'
import {
baseSuffixLight
} from '../../styles'
export default create({
name: 'Input',
theme: 'light',
peer: [suffixStyle],
peer: [
baseSuffixLight
],
getDerivedVariables ({ base, derived }) {
const {
textColor2,

View File

@ -1,13 +1,15 @@
import create from '../../_styles/utils/create-component-base'
import baseLoadingStyle from '../../_base/loading/styles/dark'
import scrollbarStyle from '../../scrollbar/styles/dark'
import {
baseLoadingDark,
scrollbarDark
} from '../../styles'
export default create({
name: 'Log',
theme: 'dark',
peer: [
baseLoadingStyle,
scrollbarStyle
baseLoadingDark,
scrollbarDark
],
getDerivedVariables ({ base, derived }) {
const {

View File

@ -1,13 +1,15 @@
import create from '../../_styles/utils/create-component-base'
import baseLoadingStyle from '../../_base/loading/styles/light'
import scrollbarStyle from '../../scrollbar/styles/light'
import {
baseLoadingLight,
scrollbarLight
} from '../../styles'
export default create({
name: 'Log',
theme: 'light',
peer: [
baseLoadingStyle,
scrollbarStyle
baseLoadingLight,
scrollbarLight
],
getDerivedVariables ({ base, derived }) {
const {

View File

@ -1,11 +1,13 @@
import create from '../../_styles/utils/create-component-base'
import selectMenuStyle from '../../_base/select-menu/styles/dark'
import {
baseSelectMenuDark
} from '../../styles'
export default create({
name: 'Popselect',
theme: 'dark',
peer: [
selectMenuStyle
baseSelectMenuDark
],
getDerivedVariables ({ base, derived }) {
return {

View File

@ -1,11 +1,13 @@
import create from '../../_styles/utils/create-component-base'
import selectMenuStyle from '../../_base/select-menu/styles/light'
import {
baseSelectMenuLight
} from '../../styles'
export default create({
name: 'Popselect',
theme: 'light',
peer: [
selectMenuStyle
baseSelectMenuLight
],
getDerivedVariables ({ base, derived }) {
return {

View File

@ -1,13 +1,15 @@
import create from '../../_styles/utils/create-component-base'
import baseSelectionStyle from '../../_base/selection/styles/dark'
import baseSelectMenuStyle from '../../_base/select-menu/styles/dark'
import {
baseSelectionDark,
baseSelectMenuDark
} from '../../styles'
export default create({
name: 'Select',
theme: 'dark',
peer: [
baseSelectionStyle,
baseSelectMenuStyle
baseSelectionDark,
baseSelectMenuDark
],
getDerivedVariables ({ derived, base }) {
return {}

View File

@ -1,13 +1,15 @@
import create from '../../_styles/utils/create-component-base'
import baseSelectionStyle from '../../_base/selection/styles/light'
import baseSelectMenuStyle from '../../_base/select-menu/styles/light'
import {
baseSelectionLight,
baseSelectMenuLight
} from '../../styles'
export default create({
name: 'Select',
theme: 'light',
peer: [
baseSelectionStyle,
baseSelectMenuStyle
baseSelectionLight,
baseSelectMenuLight
],
getDerivedVariables ({ derived, base }) {
return {}

View File

@ -1,12 +1,14 @@
import create from '../../_styles/utils/create-component-base'
import sizeVariables from './_common'
import baseLoadingStyle from '../../_base/loading/styles/dark'
import {
baseLoadingDark
} from '../../styles'
export default create({
name: 'Spin',
theme: 'dark',
peer: [
baseLoadingStyle
baseLoadingDark
],
getDerivedVariables ({ base, derived }) {
const {

View File

@ -1,12 +1,14 @@
import create from '../../_styles/utils/create-component-base'
import sizeVariables from './_common'
import baseLoadingStyle from '../../_base/loading/styles/light'
import {
baseLoadingLight
} from '../../styles'
export default create({
name: 'Spin',
theme: 'light',
peer: [
baseLoadingStyle
baseLoadingLight
],
getDerivedVariables ({ base, derived }) {
const {

View File

@ -1,6 +1,8 @@
// unified entry for styles
// internal style
export {
scrollbarDark,
scrollbarLight
} from '../scrollbar/styles'
export {
baseMenuMaskDark,
baseMenuMaskLight
@ -30,6 +32,18 @@ export {
baseDark,
baseLight
} from '../_styles/base'
export {
iconDark,
iconLight
} from '../icon/styles'
export {
inputDark,
inputLight
} from '../input/styles'
export {
checkboxDark,
checkboxLight
} from '../checkbox/styles'
export {
tabsDark,
tabsLight
@ -94,10 +108,6 @@ export {
timePickerDark,
timePickerLight
} from '../time-picker/styles'
export {
inputDark,
inputLight
} from '../input/styles'
export {
notificationDark,
notificationLight
@ -122,10 +132,6 @@ export {
cascaderDark,
cascaderLight
} from '../cascader/styles'
export {
checkboxDark,
checkboxLight
} from '../checkbox/styles'
export {
transferDark,
transferLight
@ -246,10 +252,6 @@ export {
breadcrumbDark,
breadcrumbLight
} from '../breadcrumb/styles'
export {
iconDark,
iconLight
} from '../icon/styles'
export {
modalDark,
modalLight
@ -270,10 +272,6 @@ export {
tagDark,
tagLight
} from '../tag/styles'
export {
scrollbarDark,
scrollbarLight
} from '../scrollbar/styles'
export {
affixDark,
affixLight

View File

@ -310,7 +310,7 @@
- [x] wait for new version of rollup-plugin-vue,
https://github.com/vuejs/rollup-plugin-vue/issues/408
- tusimple theme
- clean delegate
- [x] clean delegate
- [x] site production tag (bug)
- [x] demo scrollbar 的问题
- [x] table x scroll 右侧阴影不消失