diff --git a/src/spin/src/Spin.vue b/src/spin/src/Spin.vue index efdba00fa..d4f62d57d 100644 --- a/src/spin/src/Spin.vue +++ b/src/spin/src/Spin.vue @@ -49,6 +49,7 @@ export default defineComponent({ NBaseLoading }, props: { + ...useTheme.props, stroke: { type: String, default: undefined diff --git a/src/statistic/src/Statistic.vue b/src/statistic/src/Statistic.vue index b166c5635..4b4bed878 100644 --- a/src/statistic/src/Statistic.vue +++ b/src/statistic/src/Statistic.vue @@ -1,15 +1,10 @@ diff --git a/src/statistic/src/styles/index.cssr.js b/src/statistic/src/styles/index.cssr.js new file mode 100644 index 000000000..e0b56a103 --- /dev/null +++ b/src/statistic/src/styles/index.cssr.js @@ -0,0 +1,48 @@ +import { cB, cE } from '../../../_utils/cssr' + +// vars: +// --bezier +// --label-font-size +// --label-font-weight +// --label-text-color +// --value-font-weight +// --value-prefix-text-color +// --value-suffix-text-color +// --value-text-color +export default cB('statistic', [ + cE('label', ` + font-weight: var(--label-font-weight); + transition: .3s color var(--bezier); + font-size: var(--label-font-size); + color: var(--label-text-color); + `), + cB('statistic-value', ` + margin-top: 4px; + font-weight: var(--value-font-weight); + `, [ + cE('prefix', ` + margin: 0 4px; + font-size: 18px; + transition: .3s color var(--bezier); + color: var(--value-prefix-text-color); + `, [ + cB('icon', { + verticalAlign: '-0.125em' + }) + ]), + cE('content', ` + font-size: 24px; + transition: .3s color var(--bezier); + color: var(--value-text-color); + `), + cE('suffix', ` + font-size: 18px; + transition: .3s color var(--bezier); + color: var(--value-suffix-text-color); + `, [ + cB('icon', { + verticalAlign: '-0.125em' + }) + ]) + ]) +]) diff --git a/src/statistic/src/styles/index.js b/src/statistic/src/styles/index.js deleted file mode 100644 index fd9338f5d..000000000 --- a/src/statistic/src/styles/index.js +++ /dev/null @@ -1,9 +0,0 @@ -import baseStyle from './themed-base.cssr.js' - -export default [ - { - key: 'mergedTheme', - watch: ['mergedTheme'], - CNode: baseStyle - } -] diff --git a/src/statistic/src/styles/themed-base.cssr.js b/src/statistic/src/styles/themed-base.cssr.js deleted file mode 100644 index f8e5314cf..000000000 --- a/src/statistic/src/styles/themed-base.cssr.js +++ /dev/null @@ -1,67 +0,0 @@ -import { c, cTB, cB, cE } from '../../../_utils/cssr' - -export default c([ - ({ props }) => { - const { - $local: { - labelFontWeight, - valueFontWeight, - valuePrefixTextColor, - labelTextColor, - valueSuffixTextColor, - valueTextColor, - labelFontSize - }, - $global: { - cubicBezierEaseInOut - } - } = props - return cTB('statistic', [ - cE('label', { - raw: ` - font-weight: ${labelFontWeight}; - transition: .3s color ${cubicBezierEaseInOut}; - font-size: ${labelFontSize}; - `, - color: labelTextColor - }), - cB('statistic-value', { - raw: ` - margin-top: 4px; - font-weight: ${valueFontWeight}; - ` - }, [ - cE('prefix', { - raw: ` - margin: 0 4px; - font-size: 18px; - transition: .3s color ${cubicBezierEaseInOut}; - `, - color: valuePrefixTextColor - }, [ - cB('icon', { - verticalAlign: '-0.125em' - }) - ]), - cE('content', { - raw: ` - font-size: 24px; - transition: .3s color ${cubicBezierEaseInOut}; - `, - color: valueTextColor - }), - cE('suffix', { - raw: ` - font-size: 18px; - transition: .3s color ${cubicBezierEaseInOut}; - `, - color: valueSuffixTextColor - }, [ - cB('icon', { - verticalAlign: '-0.125em' - }) - ]) - ]) - ]) - } -]) diff --git a/src/statistic/styles/dark.js b/src/statistic/styles/dark.js index 992d4d266..2971d9c43 100644 --- a/src/statistic/styles/dark.js +++ b/src/statistic/styles/dark.js @@ -1,11 +1,9 @@ -import create from '../../_styles/utils/create-component-base' -import { baseLight } from '../../_styles/base' +import { commonDark } from '../../_styles/new-common' -export default create({ +export default { name: 'Statistic', - theme: 'dark', - peer: [baseLight], - getLocalVars (vars) { + common: commonDark, + self (vars) { const { textColor2Overlay, textColor1Overlay, @@ -22,4 +20,4 @@ export default create({ valueTextColor: textColor1Overlay } } -}) +} diff --git a/src/statistic/styles/light.js b/src/statistic/styles/light.js index dcce1af01..4e962810c 100644 --- a/src/statistic/styles/light.js +++ b/src/statistic/styles/light.js @@ -1,11 +1,9 @@ -import create from '../../_styles/utils/create-component-base' -import { baseDark } from '../../_styles/base' +import { commonLight } from '../../_styles/new-common' -export default create({ +export default { name: 'Statistic', - theme: 'light', - peer: [baseDark], - getLocalVars (vars) { + common: commonLight, + self (vars) { const { textColor2, textColor1, fontWeightStrong, fontSize } = vars return { labelFontSize: fontSize, @@ -17,4 +15,4 @@ export default create({ valueTextColor: textColor1 } } -}) +} diff --git a/src/styles.js b/src/styles.js index 722d8a62e..4c91129b6 100644 --- a/src/styles.js +++ b/src/styles.js @@ -69,7 +69,7 @@ export { baseDark, baseLight } from './_styles/base' // export { sliderDark, sliderLight } from './slider/styles' // export { spaceDark, spaceLight } from './space/styles' // export { spinDark, spinLight } from './spin/styles' -export { statisticDark, statisticLight } from './statistic/styles' +// export { statisticDark, statisticLight } from './statistic/styles' export { stepsDark, stepsLight } from './steps/styles' export { switchDark, switchLight } from './switch/styles' export { tableDark, tableLight } from './table/styles' diff --git a/src/styles.new.js b/src/styles.new.js index fd22d2170..0ddc8fe35 100644 --- a/src/styles.new.js +++ b/src/styles.new.js @@ -50,6 +50,7 @@ import { scrollbarDark } from './scrollbar/styles' import { sliderDark } from './slider/styles' import { spaceDark } from './space/styles' import { spinDark } from './spin/styles' +import { statisticDark } from './statistic/styles' export const darkTheme = { common: commonDark, @@ -103,5 +104,6 @@ export const darkTheme = { Scrollbar: scrollbarDark, Slider: sliderDark, Space: spaceDark, - Spin: spinDark + Spin: spinDark, + Statistic: statisticDark }