Skip to content

Commit

Permalink
feat: update margin
Browse files Browse the repository at this point in the history
  • Loading branch information
memset0 committed Nov 3, 2023
1 parent 81aed0e commit 95f8f27
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 21 additions & 6 deletions src/components/Article/ArticleList.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import CardMedia from "@mui/material/CardMedia";
import Grid from "@mui/material/Grid";
import Typography from "@mui/material/Typography";

import { isNegativeIndentTitleRequired } from "../../utils/frontend";

const renderAst = new rehypeReact({
createElement: React.createElement,
}).Compiler;
Expand Down Expand Up @@ -41,7 +43,7 @@ const ArticleList = ({ posts }) => {
<Card sx={{ mt: 2, display: "flex" }} key={post.node.id}>
<Grid container direction="row-reverse">
{/* 封面 */}
<Grid item sx={12} md={5}>
<Grid item xs={12} md={5}>
<GatsbyLink
to={post.node.fields.slug}
style={{ color: "inherit" }}
Expand Down Expand Up @@ -69,18 +71,31 @@ const ArticleList = ({ posts }) => {
</Grid>

{/* 内容 */}
<Grid item sx={12} md={hasCover ? 7 : 12}>
<Grid item xs={12} md={hasCover ? 7 : 12}>
<Box
sx={{
style={{
display: "flex",
flexDirection: "column",
}}
>
<CardContent sx={{ flex: "1 0 auto" }}>
<Typography component="div" variant="h6">
<CardContent style={{ flex: "1 0 auto" }}>
<Typography
component="div"
variant="h6"
sx={{
textIndent: isNegativeIndentTitleRequired(
post.node.frontmatter.title
)
? "-0.5em"
: 0,
}}
>
<GatsbyLink
to={post.node.fields.slug}
style={{ textDecoration: "none", color: "inherit" }}
style={{
textDecoration: "none",
color: "inherit",
}}
>
{post.node.frontmatter.title}
</GatsbyLink>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const Layout = ({ children, title, maxWidth }) => {
aria-label="open drawer"
onClick={isDesktop ? toggleDrawer : toggleMobileDrawer}
sx={{
marginRight: "36px",
marginRight: { xs: "12px", md: "24px" },
}}
>
<MenuIcon
Expand Down
6 changes: 4 additions & 2 deletions src/templates/blog-post.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ const BlogPostTemplate = ({
sx={{
mt: 0.5,
mb: 1,
ml: isNegativeIndentTitleRequired(post.frontmatter.title)
? -0.75
textIndent: isNegativeIndentTitleRequired(
post.frontmatter.title
)
? "-0.75rem"
: 0,
fontSize: { lg: "1.7rem" },
}}
Expand Down

0 comments on commit 95f8f27

Please sign in to comment.