forked from lobehub/dumi-theme-lobehub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support specify desktop or mobile when build SSR
- Loading branch information
Showing
21 changed files
with
135 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
import { createStyles } from 'antd-style'; | ||
|
||
export const useStyles = createStyles(({ css, token, responsive: r, stylish }) => ({ | ||
desc: css` | ||
font-size: ${token.fontSizeLG}px; | ||
line-height: ${token.lineHeightLG}px; | ||
`, | ||
label: css` | ||
width: 80px; | ||
`, | ||
meta: css``, | ||
text: css` | ||
${stylish.resetLinkColor} | ||
`, | ||
title: css` | ||
${r.mobile} { | ||
margin-block: 0; | ||
font-size: 32px !important; | ||
} | ||
`, | ||
})); | ||
export const useStyles = createStyles( | ||
({ css, token, stylish }, { mobile }: { mobile?: boolean }) => ({ | ||
desc: css` | ||
font-size: ${token.fontSizeLG}px; | ||
line-height: ${token.lineHeightLG}px; | ||
`, | ||
label: css` | ||
width: 80px; | ||
`, | ||
meta: css``, | ||
text: css` | ||
${stylish.resetLinkColor} | ||
`, | ||
title: css` | ||
${mobile} { | ||
margin-block: 0; | ||
font-size: 32px !important; | ||
} | ||
`, | ||
}) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { useResponsive as baseUseResponsive } from 'antd-style'; | ||
|
||
import { isBrowser } from '@/utils'; | ||
|
||
export const useResponsive = () => { | ||
const responsive = baseUseResponsive(); | ||
|
||
if (!isBrowser) { | ||
if (process.env.MOBILE) { | ||
responsive.mobile = process.env.MOBILE === 'true'; | ||
} | ||
if (process.env.DESKTOP) { | ||
responsive.desktop = process.env.DESKTOP === 'true'; | ||
} | ||
} | ||
|
||
return responsive; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export { defineThemeConfig } from './config'; | ||
export * from './hooks/useResponsive'; | ||
export { siteSelectors, type SiteStore, useSiteStore } from './store'; | ||
export * from './types'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,29 @@ | ||
import { createStyles } from 'antd-style'; | ||
|
||
export const useStyles = createStyles(({ cx, token, responsive, css }, isPure: boolean) => ({ | ||
content: cx( | ||
!isPure && | ||
export const useStyles = createStyles( | ||
({ cx, token, css }, { isPure, mobile }: { isPure: boolean; mobile?: boolean }) => ({ | ||
content: cx( | ||
!isPure && | ||
css` | ||
padding: 24px 48px; | ||
background-color: ${token.colorBgContainer}; | ||
border-radius: 10px; | ||
${mobile} { | ||
padding: 8px 16px; | ||
border-radius: 0; | ||
} | ||
`, | ||
css` | ||
padding: 24px 48px; | ||
background-color: ${token.colorBgContainer}; | ||
border-radius: 10px; | ||
flex: 1; | ||
box-sizing: border-box; | ||
width: 100%; | ||
min-height: 400px; | ||
${responsive.mobile} { | ||
padding: 8px 16px; | ||
border-radius: 0; | ||
&:has([data-page-tabs='true']) { | ||
padding-top: 8px; | ||
} | ||
`, | ||
css` | ||
flex: 1; | ||
box-sizing: border-box; | ||
width: 100%; | ||
min-height: 400px; | ||
&:has([data-page-tabs='true']) { | ||
padding-top: 8px; | ||
} | ||
`, | ||
), | ||
})); | ||
` | ||
), | ||
}) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.