diff --git a/.dumi/pages/index/components/Banner.tsx b/.dumi/pages/index/components/Banner.tsx index 09e4f39a2a..ca4573063c 100644 --- a/.dumi/pages/index/components/Banner.tsx +++ b/.dumi/pages/index/components/Banner.tsx @@ -1,10 +1,13 @@ import * as React from 'react'; import { Button, Space, Typography } from 'antd'; import { Link, useLocation } from 'dumi'; +import { css } from '@emotion/react'; import useLocale from '../../../hooks/useLocale'; import useSiteToken from '../../../hooks/useSiteToken'; import { GroupMask } from './Group'; import * as utils from '../../../theme/utils'; +import SiteContext from './SiteContext'; +import topicImage from './images/topic.png'; const locales = { cn: { @@ -20,6 +23,35 @@ const locales = { }, }; +const useStyle = () => { + const { token } = useSiteToken(); + const { isMobile } = React.useContext(SiteContext); + + return { + titleBase: css` + h1& { + font-family: AliPuHui, ${token.fontFamily}; + } + `, + title: isMobile + ? css` + h1& { + margin-bottom: ${token.margin}px; + font-weight: normal; + font-size: ${token.fontSizeHeading1 + 2}px; + line-height: ${token.lineHeightHeading2}; + } + ` + : css` + h1& { + margin-bottom: ${token.marginMD}px; + font-weight: 900; + font-size: 68px; + } + `, + }; +}; + export interface BannerProps { children?: React.ReactNode; } @@ -28,53 +60,59 @@ export default function Banner({ children }: BannerProps) { const [locale] = useLocale(locales); const { pathname, search } = useLocation(); const { token } = useSiteToken(); + const styles = useStyle(); + const { isMobile } = React.useContext(SiteContext); const isZhCN = utils.isZhCN(pathname); return ( <> {/* Banner Placeholder Motion */} -
+ {isMobile ? ( + + ) : (
- -