Skip to content

Commit 0868d00

Browse files
committed
fix: blog header mobile responsiveness
1 parent fa852b1 commit 0868d00

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

src/components/Blog/Hero.astro

+7-4
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ const url = `/blog/${id}`;
99
<div class="hero__background__decoration"></div>
1010
<div class="hero__content">
1111
<h1 class="hero__title">{title}</h1>
12-
<p class="hero__description" set:html={description} />
12+
<div class="hero__description">
13+
<p set:html={description} />
14+
</div>
1315
<div class="hero__cta">
14-
<GlowingBtn href={url} text="Read more" fontSize="22px" />
16+
<GlowingBtn href={url} text="Read more" fontSize="20px" />
1517
</div>
1618
</div>
17-
<div class="hero__image">
19+
<div class="hero__image m-auto md:m-0">
1820
<img src={photo_url} alt="Image description" />
1921
</div>
2022
</section>
@@ -91,6 +93,7 @@ const url = `/blog/${id}`;
9193
.hero__image img {
9294
width: 100%;
9395
max-width: 715px;
96+
border-radius: 10px;
9497
}
9598
.hero_cta_img {
9699
display: block;
@@ -112,7 +115,7 @@ const url = `/blog/${id}`;
112115
display: inline-block;
113116
width: 100%;
114117
height: 100%;
115-
max-width: 570px;
118+
max-width: 500px;
116119
max-height: 570px;
117120
pointer-events: none;
118121
}

src/components/GlowingBtn.astro

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
---
22
export interface Props {
33
text: string;
4-
href: string;
5-
fontSize ?:string;
4+
href: string;
5+
fontSize?: string;
66
}
77
8-
const { text, href ,fontSize} = Astro.props;
8+
const { text, href, fontSize } = Astro.props;
99
---
1010

1111
<a class="btn" href={href} target="_blank">{text}</a>
1212

13-
<style define:vars={{ fontSize }}>
13+
<style define:vars={{ fontSize }}>
1414
.btn {
1515
background: #ff8b92;
1616
box-shadow: 0px 0px 10px #ff2358;
@@ -21,7 +21,7 @@ const { text, href ,fontSize} = Astro.props;
2121
padding: 10px 16px;
2222
text-align: center;
2323
color: #343045;
24-
font-weight: 700;
24+
font-weight: 400;
2525
font-size: var(--fontSize);
2626
line-height: 28px;
2727
position: relative;

src/components/Hero.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import GlowingBtn from "./GlowingBtn.astro";
3030
<style>
3131
.hero {
3232
display: flex;
33-
justify-content: space-between;
33+
justify-content: space-around;
3434
flex-direction: column-reverse;
3535
align-items: center;
3636
margin-top: 14px;

0 commit comments

Comments
 (0)