diff --git a/src/_mixins/use-theme.js b/src/_mixins/use-theme.js index e2b683263..97b9ce1ff 100644 --- a/src/_mixins/use-theme.js +++ b/src/_mixins/use-theme.js @@ -51,7 +51,11 @@ export default function useTheme ( } = {} } = NConfigProvider const mergedCommon = merge( - common || injectedCommon || injectedGlobalCommon || defaultTheme.common, + common || + injectedCommon || + injectedGlobalCommon || + defaultTheme.common || + {}, injectedGlobalCommonOverrides, injectedCommonOverrides, commonOverrides @@ -59,7 +63,7 @@ export default function useTheme ( return { common: mergedCommon, self: merge( - (self || injectedSelf || defaultTheme.self)(mergedCommon), + (self || injectedSelf || defaultTheme.self || {})(mergedCommon), injectedSelfOverrides, selfOverrides ), diff --git a/src/affix/src/Affix.vue b/src/affix/src/Affix.vue index f392d6802..aeb56f0a5 100644 --- a/src/affix/src/Affix.vue +++ b/src/affix/src/Affix.vue @@ -1,25 +1,27 @@ diff --git a/src/affix/src/styles/base.cssr.js b/src/affix/src/styles/base.cssr.js deleted file mode 100644 index 22bc9a564..000000000 --- a/src/affix/src/styles/base.cssr.js +++ /dev/null @@ -1,18 +0,0 @@ -import { c, cB, cM } from '../../../_utils/cssr' - -export default c([ - () => { - return cB( - 'affix', - [ - cM('affixed', { - position: 'fixed' - }, [ - cM('absolute-positioned', { - position: 'absolute' - }) - ]) - ] - ) - } -]) diff --git a/src/affix/src/styles/index.cssr.js b/src/affix/src/styles/index.cssr.js new file mode 100644 index 000000000..2e371b0fe --- /dev/null +++ b/src/affix/src/styles/index.cssr.js @@ -0,0 +1,14 @@ +import { cB, cM } from '../../../_utils/cssr' + +export default cB( + 'affix', + [ + cM('affixed', { + position: 'fixed' + }, [ + cM('absolute-positioned', { + position: 'absolute' + }) + ]) + ] +) diff --git a/src/affix/src/styles/index.js b/src/affix/src/styles/index.js deleted file mode 100644 index 72ffee344..000000000 --- a/src/affix/src/styles/index.js +++ /dev/null @@ -1,9 +0,0 @@ -import baseStyle from './base.cssr.js' - -export default [ - { - key: 'mergedTheme', - watch: ['mergedTheme'], - CNode: baseStyle - } -] diff --git a/src/affix/styles/dark.js b/src/affix/styles/dark.js index b45532b34..b1c6ea436 100644 --- a/src/affix/styles/dark.js +++ b/src/affix/styles/dark.js @@ -1,11 +1 @@ -import create from '../../_styles/utils/create-component-base' -import { baseDark } from '../../_styles/base' - -export default create({ - theme: 'dark', - name: 'Affix', - peer: [baseDark], - getLocalVars () { - return {} - } -}) +export default {} diff --git a/src/affix/styles/light.js b/src/affix/styles/light.js index 824bcf48b..b1c6ea436 100644 --- a/src/affix/styles/light.js +++ b/src/affix/styles/light.js @@ -1,11 +1 @@ -import create from '../../_styles/utils/create-component-base' -import { baseLight } from '../../_styles/base' - -export default create({ - theme: 'light', - name: 'Affix', - peer: [baseLight], - getLocalVars () { - return {} - } -}) +export default {} diff --git a/src/divider/src/styles/index.cssr.js b/src/divider/src/styles/index.cssr.js index e8816a432..7ff0face9 100644 --- a/src/divider/src/styles/index.cssr.js +++ b/src/divider/src/styles/index.cssr.js @@ -1,92 +1,90 @@ -import { c, cB, cNotM, cE, cM } from '../../../_utils/cssr' +import { cB, cNotM, cE, cM } from '../../../_utils/cssr' // vars: // --bezier // --color // --text-color // --font-weight -export default c([ - cB( - 'divider', ` - position: relative; - display: flex; - width: 100%; - box-sizing: border-box; - font-size: 16px; - color: var(--text-color); - transition: - color .3s var(--bezier), - background-color .3s var(--bezier); +export default cB( + 'divider', ` + position: relative; + display: flex; + width: 100%; + box-sizing: border-box; + font-size: 16px; + color: var(--text-color); + transition: + color .3s var(--bezier), + background-color .3s var(--bezier); + `, + [ + cNotM('vertical', ` + margin-top: 24px; + margin-bottom: 24px; `, [ - cNotM('vertical', ` - margin-top: 24px; - margin-bottom: 24px; - `, - [ - cNotM('no-title', ` - display: flex; - align-items: center; - `) - ]), - cE('title', ` + cNotM('no-title', ` display: flex; align-items: center; - margin-left: 12px; - margin-right: 12px; - white-space: nowrap; - font-weight: var(--font-weight); - `), - cM('title-position-left', [ - cE('line', [ - cM('left', { - width: '28px' - }) - ]) - ]), - cM('title-position-right', [ - cE('line', [ - cM('right', { - width: '28px' - }) - ]) - ]), - cM('dashed', [ - cE('line', ` - background-color: transparent; - height: 0px; - width: 100%; - border-style: dashed; - border-width: 1px 0 0; - `) - ]), - cM('vertical', ` - display: inline-block; - height: 1em; - margin: 0 8px; - vertical-align: middle; - width: 1px; - `), + `) + ]), + cE('title', ` + display: flex; + align-items: center; + margin-left: 12px; + margin-right: 12px; + white-space: nowrap; + font-weight: var(--font-weight); + `), + cM('title-position-left', [ + cE('line', [ + cM('left', { + width: '28px' + }) + ]) + ]), + cM('title-position-right', [ + cE('line', [ + cM('right', { + width: '28px' + }) + ]) + ]), + cM('dashed', [ cE('line', ` - border: none; - transition: background-color .3s var(--bezier), border-color .3s var(--bezier); - height: 1px; + background-color: transparent; + height: 0px; width: 100%; - margin: 0; - `), - cNotM('dashed', [ - cE('line', { - backgroundColor: 'var(--color)' - }) - ]), - cM('dashed', [ - cE('line', { - borderColor: 'var(--color)' - }) - ]), - cM('vertical', { + border-style: dashed; + border-width: 1px 0 0; + `) + ]), + cM('vertical', ` + display: inline-block; + height: 1em; + margin: 0 8px; + vertical-align: middle; + width: 1px; + `), + cE('line', ` + border: none; + transition: background-color .3s var(--bezier), border-color .3s var(--bezier); + height: 1px; + width: 100%; + margin: 0; + `), + cNotM('dashed', [ + cE('line', { backgroundColor: 'var(--color)' }) - ] - ) -]) + ]), + cM('dashed', [ + cE('line', { + borderColor: 'var(--color)' + }) + ]), + cM('vertical', { + backgroundColor: 'var(--color)' + }) + ] +) diff --git a/src/styles.js b/src/styles.js index d89e33562..f31102d73 100644 --- a/src/styles.js +++ b/src/styles.js @@ -17,7 +17,7 @@ export { export { baseWaveDark, baseWaveLight } from './_base/wave/styles' // exposed style export { baseDark, baseLight } from './_styles/base' -export { affixDark, affixLight } from './affix/styles' +// export { affixDark, affixLight } from './affix/styles' export { alertDark, alertLight } from './alert/styles' export { anchorDark, anchorLight } from './anchor/styles' export { autoCompleteDark, autoCompleteLight } from './auto-complete/styles'