),
+ title: String,
+ subtitle: String,
+ extra: String,
+ onBack: Function as PropType<() => void>
+ },
+ setup (props) {
+ const themeRef = useTheme(
+ 'PageHeader',
+ 'PageHeader',
+ style,
+ pageHeaderLight,
+ props
+ )
+ return {
+ cssVars: computed(() => {
+ const {
+ self: {
+ titleTextColor,
+ subtitleTextColor,
+ backColor,
+ fontSize,
+ titleFontSize,
+ backSize,
+ titleFontWeight,
+ backColorHover,
+ backColorPressed
+ },
+ common: { cubicBezierEaseInOut }
+ } = themeRef.value
+ return {
+ '--title-text-color': titleTextColor,
+ '--title-font-size': titleFontSize,
+ '--title-font-weight': titleFontWeight,
+ '--font-size': fontSize,
+ '--back-size': backSize,
+ '--subtitle-text-color': subtitleTextColor,
+ '--back-color': backColor,
+ '--back-color-hover': backColorHover,
+ '--back-color-pressed': backColorPressed,
+ '--bezier': cubicBezierEaseInOut
+ }
+ })
+ }
+ },
+ render () {
+ const { onBack, title, subtitle, extra, $slots } = this
+ const {
+ title: titleSlot,
+ subtitle: subtitleSlot,
+ extra: extraSlot,
+ default: defaultSlot,
+ header: headerSlot,
+ avatar: avatarSlot,
+ footer: footerSlot
+ } = $slots
+ const showBack = onBack
+ const showTitle = title || titleSlot
+ const showSubtitle = subtitle || subtitleSlot
+ const showExtra = extra || extraSlot
+ return (
+
+ {headerSlot ? (
+
+ ) : null}
+
+ {defaultSlot ? (
+
+ ) : null}
+ {footerSlot ? (
+
+ ) : null}
+
+ )
+ }
+})
diff --git a/src/page-header/src/styles/index.cssr.ts b/src/page-header/src/styles/index.cssr.ts
new file mode 100644
index 000000000..30c47ee4a
--- /dev/null
+++ b/src/page-header/src/styles/index.cssr.ts
@@ -0,0 +1,66 @@
+import { c, cB, cE } from '../../../_utils/cssr'
+
+// vars:
+// --title-font-size
+// --title-text-color
+// --font-size
+// --subtitle-text-color
+// --back-color
+// --back-color-hover
+// --back-color-pressed
+// --back-size
+// --title-font-weight
+// --bezier
+export default c([
+ cB('page-header-header', `
+ margin-bottom: 20px;
+ `),
+ cB('page-header', `
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ line-height: 1.5;
+ font-size: var(--font-size);
+ `, [
+ cE('main', `
+ display: flex;
+ flex-wrap: nowrap;
+ align-items: center;
+ `),
+ cE('back', `
+ display: flex;
+ margin-right: 16px;
+ font-size: var(--back-size);
+ cursor: pointer;
+ color: var(--back-color);
+ transition: color .3s var(--bezier);
+ `, [
+ c('&:hover', 'color: var(--back-color-hover);'),
+ c('&:active', 'color: var(--back-color-pressed);')
+ ]),
+ cE('avatar', `
+ display: flex;
+ margin-right: 12px
+ `),
+ cE('title', `
+ margin-right: 16px;
+ transition: color .3s var(--bezier);
+ font-size: var(--title-font-size);
+ font-weight: var(--title-font-weight);
+ color: var(--title-text-color);
+ `),
+ cE('subtitle', `
+ font-size: 14px;
+ transition: color .3s var(--bezier);
+ color: var(--subtitle-text-color);
+ `)
+ ]),
+ cB('page-header-content', `
+ margin-top: 20px;
+ font-size: var(--font-size);
+ `),
+ cB('page-header-footer', `
+ margin-top: 20px;
+ font-size: var(--font-size);
+ `)
+])
diff --git a/src/page-header/styles/_common.ts b/src/page-header/styles/_common.ts
new file mode 100644
index 000000000..34147238c
--- /dev/null
+++ b/src/page-header/styles/_common.ts
@@ -0,0 +1,4 @@
+export default {
+ titleFontSize: '18px',
+ backSize: '22px'
+}
diff --git a/src/page-header/styles/dark.ts b/src/page-header/styles/dark.ts
new file mode 100644
index 000000000..832555727
--- /dev/null
+++ b/src/page-header/styles/dark.ts
@@ -0,0 +1,29 @@
+import type { PageHeaderTheme } from './light'
+import { commonDark } from '../../_styles/common'
+import common from './_common'
+
+export const pageHeaderDark: PageHeaderTheme = {
+ name: 'PageHeader',
+ common: commonDark,
+ self (vars) {
+ const {
+ textColor1,
+ textColor2,
+ textColor3,
+ fontSize,
+ fontWeightStrong,
+ primaryColorHover,
+ primaryColorPressed
+ } = vars
+ return {
+ ...common,
+ titleFontWeight: fontWeightStrong,
+ fontSize,
+ titleTextColor: textColor1,
+ backColor: textColor2,
+ backColorHover: primaryColorHover,
+ backColorPressed: primaryColorPressed,
+ subtitleTextColor: textColor3
+ }
+ }
+}
diff --git a/src/page-header/styles/index.ts b/src/page-header/styles/index.ts
new file mode 100644
index 000000000..8ba3655c1
--- /dev/null
+++ b/src/page-header/styles/index.ts
@@ -0,0 +1,3 @@
+export { pageHeaderLight } from './light'
+export type { PageHeaderTheme, PageHeaderThemeVars } from './light'
+export { pageHeaderDark } from './dark'
diff --git a/src/page-header/styles/light.ts b/src/page-header/styles/light.ts
new file mode 100644
index 000000000..980ce55d8
--- /dev/null
+++ b/src/page-header/styles/light.ts
@@ -0,0 +1,35 @@
+import { createTheme } from '../../_mixins'
+import { commonLight } from '../../_styles/common'
+import type { ThemeCommonVars } from '../../_styles/common'
+import common from './_common'
+
+function self (vars: ThemeCommonVars) {
+ const {
+ textColor1,
+ textColor2,
+ textColor3,
+ fontSize,
+ fontWeightStrong,
+ primaryColorHover,
+ primaryColorPressed
+ } = vars
+ return {
+ ...common,
+ titleFontWeight: fontWeightStrong,
+ fontSize,
+ titleTextColor: textColor1,
+ backColor: textColor2,
+ backColorHover: primaryColorHover,
+ backColorPressed: primaryColorPressed,
+ subtitleTextColor: textColor3
+ }
+}
+
+export const pageHeaderLight = createTheme({
+ name: 'PageHeader',
+ common: commonLight,
+ self
+})
+
+export type PageHeaderThemeVars = ReturnType
+export type PageHeaderTheme = typeof pageHeaderLight