diff --git a/src/gradient-text/src/GradientText.vue b/src/gradient-text/src/GradientText.vue index f701db765..a3d5ecde3 100644 --- a/src/gradient-text/src/GradientText.vue +++ b/src/gradient-text/src/GradientText.vue @@ -2,13 +2,12 @@ @@ -16,15 +15,16 @@ diff --git a/src/gradient-text/src/styles/index.cssr.js b/src/gradient-text/src/styles/index.cssr.js new file mode 100644 index 000000000..89ad19e2f --- /dev/null +++ b/src/gradient-text/src/styles/index.cssr.js @@ -0,0 +1,20 @@ +import { cB } from '../../../_utils/cssr' + +// vars: +// --font-weight +// --rotate +// --bezier +// --color-start +// --color-end +export default cB('gradient-text', ` + display: inline-block; + font-weight: var(--font-weight); + -webkit-background-clip: text; + background-clip: text; + color: transparent; + white-space: nowrap; + background-image: linear-gradient(var(--rotate), var(--color-start) 0%, var(--color-end) 100%); + transition: + --color-start .3s var(--bezier), + --color-end .3s var(--bezier); +`) diff --git a/src/gradient-text/src/styles/index.js b/src/gradient-text/src/styles/index.js deleted file mode 100644 index fd9338f5d..000000000 --- a/src/gradient-text/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/gradient-text/src/styles/themed-base.cssr.js b/src/gradient-text/src/styles/themed-base.cssr.js deleted file mode 100644 index 99a38d59f..000000000 --- a/src/gradient-text/src/styles/themed-base.cssr.js +++ /dev/null @@ -1,70 +0,0 @@ -import { c, cTB, cM } from '../../../_utils/cssr' - -export default c([ - ({ props }) => { - const { - rotate, - colorStartPrimary, - colorEndPrimary, - colorStartInfo, - colorEndInfo, - colorStartWarning, - colorEndWarning, - colorStartError, - colorEndError, - colorStartSuccess, - colorEndSuccess, - fontWeight - } = props.$local - const { - cubicBezierEaseInOut - } = props.$global - return cTB('gradient-text', { - raw: ` - display: inline-block; - font-weight: ${fontWeight}; - font-size: inherit; - -webkit-background-clip: text; - background-clip: text; - color: transparent; - white-space: nowrap; - background-image: linear-gradient(${rotate}, var(--start-stop) 0%, var(--end-stop) 100%); - transition: - --start-stop .3s ${cubicBezierEaseInOut}, - --end-stop .3s ${cubicBezierEaseInOut}; - ` - }, - [ - cM('default-type', { - raw: ` - --start-stop: ${colorStartPrimary}; - --end-stop: ${colorEndPrimary}; - ` - }), - cM('success-type', { - raw: ` - --start-stop: ${colorStartSuccess}; - --end-stop: ${colorEndSuccess}; - ` - }), - cM('warning-type', { - raw: ` - --start-stop: ${colorStartWarning}; - --end-stop: ${colorEndWarning}; - ` - }), - cM('error-type', { - raw: ` - --start-stop: ${colorStartError}; - --end-stop: ${colorEndError}; - ` - }), - cM('info-type', { - raw: ` - --start-stop: ${colorStartInfo}; - --end-stop: ${colorEndInfo}; - ` - }) - ]) - } -]) diff --git a/src/gradient-text/styles/dark.js b/src/gradient-text/styles/dark.js index 5841ca60a..870ff78fe 100644 --- a/src/gradient-text/styles/dark.js +++ b/src/gradient-text/styles/dark.js @@ -1,11 +1,9 @@ -import create from '../../_styles/utils/create-component-base' -import { baseDark } from '../../_styles/base' +import { commonDark } from '../../_styles/new-common' -export default create({ - theme: 'dark', +export default { name: 'GradientText', - peer: [baseDark], - getLocalVars (vars) { + common: commonDark, + self (vars) { const { primaryColor, successColor, @@ -33,4 +31,4 @@ export default create({ colorEndSuccess: successColorSuppl } } -}) +} diff --git a/src/gradient-text/styles/light.js b/src/gradient-text/styles/light.js index 5a778bf3c..f69cf8b3c 100644 --- a/src/gradient-text/styles/light.js +++ b/src/gradient-text/styles/light.js @@ -1,12 +1,10 @@ -import create from '../../_styles/utils/create-component-base' import { changeColor } from 'seemly' -import { baseLight } from '../../_styles/base' +import { commonLight } from '../../_styles/new-common' -export default create({ - theme: 'light', +export default { name: 'GradientText', - peer: [baseLight], - getLocalVars (vars) { + common: commonLight, + self (vars) { const { primaryColor, successColor, @@ -29,4 +27,4 @@ export default create({ colorEndSuccess: successColor } } -}) +} diff --git a/src/styles.js b/src/styles.js index 8e5fe9b46..9f2396716 100644 --- a/src/styles.js +++ b/src/styles.js @@ -42,8 +42,8 @@ export { baseDark, baseLight } from './_styles/base' // export { dynamicTagsDark, dynamicTagsLight } from './dynamic-tags/styles' // export { elementDark, elementLight } from './element/styles' // export { emptyDark, emptyLight } from './empty/styles' -export { formDark, formLight } from './form/styles' -export { gradientTextDark, gradientTextLight } from './gradient-text/styles' +// export { formDark, formLight } from './form/styles' +// export { gradientTextDark, gradientTextLight } from './gradient-text/styles' export { gridDark, gridLight } from './grid/styles' export { iconDark, iconLight } from './icon/styles' export { inputDark, inputLight } from './input/styles' diff --git a/src/styles.new.js b/src/styles.new.js index ff114c45e..40a519d01 100644 --- a/src/styles.new.js +++ b/src/styles.new.js @@ -24,6 +24,8 @@ import { dynamicInputDark } from './dynamic-input/styles' import { dynamicTagsDark } from './dynamic-tags/styles' import { elementDark } from './element/styles' import { emptyDark } from './empty/styles' +import { formDark } from './form/styles' +import { gradientTextDark } from './gradient-text/styles' export const darkTheme = { common: commonDark, @@ -51,5 +53,7 @@ export const darkTheme = { DynamicInput: dynamicInputDark, DynamicTags: dynamicTagsDark, Element: elementDark, - Empty: emptyDark + Empty: emptyDark, + Form: formDark, + GradientText: gradientTextDark }