Skip to content

Commit 90fce54

Browse files
update article component layout and add title and ebook-ad styles (#893)
* update article component layout and add title and ebook-ad styles * adjust article elements styles * adjust sidenav styles * address javier comments
1 parent 1de4f07 commit 90fce54

File tree

11 files changed

+141
-114
lines changed

11 files changed

+141
-114
lines changed

src/features/common/components/article/article.module.scss

Lines changed: 55 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,13 @@
77

88
.content {
99
@include InnerContentGrid;
10-
11-
padding: 3rem 0 3rem 0;
12-
gap: 2rem;
13-
14-
@media #{$breakpoint-dimension-sm} {
15-
padding: 3rem 0 4rem 0;
16-
}
17-
18-
@media #{$breakpoint-dimension-md} {
19-
gap: 3rem;
20-
padding: 4rem 0 4rem 0;
21-
}
2210
}
2311

2412
.article {
2513
display: flex;
2614
flex-direction: column;
27-
2815
grid-column: span 6;
29-
max-width: 48.5rem;
16+
max-width: 56rem;
3017
justify-self: center;
3118

3219
@media #{$breakpoint-dimension-sm} {
@@ -47,7 +34,7 @@
4734
font-size: 2rem;
4835
line-height: 2.5rem;
4936
font-style: normal;
50-
font-weight: 400;
37+
font-weight: 500;
5138
letter-spacing: -0.05rem;
5239
margin-bottom: 1.5rem;
5340
font-family: var(--font-secondary), sans-serif;
@@ -68,13 +55,12 @@
6855

6956
h3 {
7057
color: var(--color_fg_bold);
71-
7258
font-size: 1.5rem;
7359
line-height: 2rem;
7460
font-style: normal;
75-
font-weight: 400;
61+
font-weight: 500;
7662
letter-spacing: -0.05rem;
77-
margin-bottom: 2rem;
63+
margin-bottom: 1.5rem;
7864
font-family: var(--font-secondary), sans-serif;
7965

8066
:global(html[lang="ja"]) & {
@@ -89,11 +75,11 @@
8975
"clig" off,
9076
"liga" off;
9177
font-size: 1rem;
92-
line-height: 1.5em;
78+
line-height: 1.45;
9379
font-style: normal;
9480
font-weight: 400;
9581
letter-spacing: -0.005rem;
96-
margin-bottom: 2rem;
82+
margin-bottom: 1rem;
9783

9884
:global(html[lang="ja"]) & {
9985
@include LocaleLineHeight("ja", 1.5rem);
@@ -107,12 +93,10 @@
10793

10894
ul,
10995
ol {
110-
list-style-position: inside;
11196
margin-top: 0;
11297

11398
ul,
11499
ol {
115-
list-style-position: inside;
116100
margin-left: 1.5rem;
117101
padding-left: 0;
118102
}
@@ -121,11 +105,11 @@
121105
li {
122106
margin-bottom: 0.75rem;
123107
font-size: 1rem;
124-
line-height: 2rem;
108+
line-height: 1.45;
125109
color: var(--color_fg_default);
126110
letter-spacing: -0.01px;
127-
text-indent: -1.5rem;
128-
padding-left: 1.5rem;
111+
margin-left: 1rem;
112+
padding-left: 1rem;
129113

130114
:global(html[lang="ja"]) & {
131115
@include LocaleLineHeight("ja", 2rem);
@@ -136,9 +120,9 @@
136120
&,
137121
&:hover,
138122
&:active {
139-
color: var(--color_fg_link_primary);
140123
text-decoration: underline;
141-
font-weight: 400;
124+
font-weight: 500;
125+
text-underline-offset: 0.25rem;
142126
}
143127
}
144128

@@ -148,42 +132,70 @@
148132
}
149133

150134
pre {
151-
margin-bottom: 2rem;
152-
background-color: var(--color_bg_code-editor);
135+
margin-bottom: 1rem;
136+
background-color: var(--color_bg_layer_alternate);
153137
color: var(--color_fg_default);
154138
font-size: 0.875rem;
155139
line-height: 1.375rem;
156140
font-style: normal;
157141
font-weight: 400;
158142
letter-spacing: 0.15px;
159-
padding: 0.75rem;
143+
padding: 0.25rem;
160144
border: 1px solid var(--color_border_bold);
161-
border-radius: 0.25rem;
145+
border-radius: 1rem;
162146

163147
code {
164-
color: var(--color_code_dark_blue2);
148+
display: block;
149+
width: 100%;
150+
color: var(--color_code_gray);
165151
background-color: var(--color_bg_code-editor);
166152
font-weight: 500;
167-
}
168-
169-
@media #{$breakpoint-dimension-sm} {
170-
border-radius: 0.5rem;
171-
padding: 1rem;
153+
font-size: 0.875rem;
154+
line-height: 1.35;
155+
border-radius: 0.75rem;
156+
padding: 0.75rem;
157+
box-shadow:
158+
0 0 0 0.5px rgba(0, 0, 0, 0.12),
159+
0 2px 2px -1px rgba(0, 0, 0, 0.04),
160+
0 4px 4px -2px rgba(0, 0, 0, 0.04),
161+
0 6px 6px -3px rgba(0, 0, 0, 0.04);
172162
}
173163
}
174164

175165
blockquote {
176-
background-color: var(--color_bg_state_info_subtle);
177-
padding: 1rem 1.5rem;
178-
margin: 2rem 0 2rem 0;
179-
border-radius: 0 0.5rem 0.5rem 0;
180-
border-left: 4px solid var(--color_border_state_info);
166+
background-color: var(--color_bg_layer);
167+
font-size: 0.875rem;
168+
padding: 1rem;
169+
margin: 2rem 0;
170+
border-radius: 1rem;
171+
border: 1px solid var(--color_border_default);
172+
box-shadow:
173+
0 0 0 0.5px rgba(0, 0, 0, 0.12),
174+
0 2px 2px -1px rgba(0, 0, 0, 0.04),
175+
0 4px 4px -2px rgba(0, 0, 0, 0.04),
176+
0 6px 6px -3px rgba(0, 0, 0, 0.04);
181177

182178
& * {
183-
color: var(--color_fg_on_state_info_subtle);
179+
color: var(--color_fg_default);
184180
padding: 0;
185181
margin: 0;
186182
}
183+
184+
p {
185+
display: flex;
186+
flex-direction: row;
187+
font-size: 0.875rem;
188+
align-items: center;
189+
gap: 0.75rem;
190+
}
191+
192+
::before {
193+
content: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 0.5C9.03757 0.5 11.5 2.96243 11.5 6C11.5 9.03757 9.03757 11.5 6 11.5C2.96243 11.5 0.5 9.03757 0.5 6C0.5 2.96243 2.96243 0.5 6 0.5ZM6 5.25C5.72386 5.25 5.5 5.47386 5.5 5.75V8.75H6.5V5.75C6.5 5.47386 6.27614 5.25 6 5.25ZM6 3.125C5.65482 3.125 5.375 3.40482 5.375 3.75C5.375 4.09518 5.65482 4.375 6 4.375C6.34518 4.375 6.625 4.09518 6.625 3.75C6.625 3.40482 6.34518 3.125 6 3.125Z' fill='%235C5650'/%3E%3C/svg%3E%0A");
194+
display: block;
195+
padding: 0.25rem 0.4rem 0.125rem;
196+
border-radius: 9999px;
197+
background-color: var(--color_bg_layer_alternate);
198+
}
187199
}
188200

189201
*:has(+ blockquote) {

src/features/introduction/components/ebook-ad/ebook-ad.component.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ type EbookAdComponentProps = {
88

99
export const EbookAdComponent: React.FC<EbookAdComponentProps> = ({ copy }) => {
1010
return (
11-
<BoxComponent contentClassName={styles.content}>
11+
<BoxComponent contentClassName={styles.content} containerClassName={styles.container}>
1212
<p className={styles.copy}>{copy}</p>
1313
</BoxComponent>
1414
);

src/features/introduction/components/ebook-ad/ebook-ad.module.scss

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
11
@use "@/libs/theme/styles/variables" as *;
22
@use "@/libs/theme/styles/mixins" as *;
33

4+
.container {
5+
margin-bottom: 1.5rem;
6+
}
7+
48
.content {
59
@include InnerContentFlex;
610
position: relative;
711
max-width: $article-max-width;
8-
9-
background: linear-gradient(290deg, #f4d -18.75%, #3f59e4 98.79%);
10-
11-
border-radius: 0.5rem;
1212
padding: 1rem;
13-
margin: 1rem auto 2rem auto;
14-
color: $Neutral0;
15-
font-size: 1rem;
16-
line-height: 1.25rem;
13+
border-radius: 1rem;
14+
border: 1px solid var(--color_border_default);
15+
box-shadow:
16+
0 0 0 0.5px rgba(0, 0, 0, 0.12),
17+
0 2px 2px -1px rgba(0, 0, 0, 0.04),
18+
0 4px 4px -2px rgba(0, 0, 0, 0.04),
19+
0 6px 6px -3px rgba(0, 0, 0, 0.04);
1720
}
1821

1922
.copy {
2023
font-weight: 400;
24+
line-height: 1.25rem;
25+
font-size: 0.875rem;
26+
color: var(--color_fg_default);
2127

2228
& strong {
2329
font-weight: 500;

src/features/introduction/components/introduction-article/introduction-article.component.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,30 @@ import { getIntroductionContent } from "@/features/localization/services/ui-lang
55
import { ArticleComponent } from "@/features/common/components/article/article.component";
66
import styles from "./introduction-article.module.scss";
77
import { SidebarNavComponent } from "../sidebar-nav/sidebar-nav.component";
8+
import { EbookAdComponent } from "../ebook-ad/ebook-ad.component";
9+
import { getComponentDictionary } from "@/features/localization/services/component-dictionary.service";
10+
import { IntroductionDictionaryModel } from "@/features/localization/models/introduction-dictionary.model";
11+
import { IntroductionHeroComponent } from "../introduction-hero/introduction-hero.component";
812

913
interface IntroductionArticleComponentProps {
1014
languageCode: string;
15+
introductionDictionary: IntroductionDictionaryModel;
1116
}
1217

1318
export const IntroductionArticleComponent: React.FC<
1419
IntroductionArticleComponentProps
15-
> = ({ languageCode }) => {
20+
> = ({ languageCode, introductionDictionary }) => {
1621
const Introduction = getIntroductionContent({ languageCode });
22+
const componentDictionary = getComponentDictionary(languageCode);
1723

1824
return (
1925
<div className={styles.container}>
20-
<SidebarNavComponent languageCode={languageCode} />
21-
<ArticleComponent>{Introduction}</ArticleComponent>
26+
<SidebarNavComponent introductionDictionary={introductionDictionary} />
27+
<div className={styles.content}>
28+
<IntroductionHeroComponent languageCode={languageCode} dictionary={introductionDictionary.hero} />
29+
<EbookAdComponent copy={componentDictionary.ebookAd} />
30+
<ArticleComponent>{Introduction}</ArticleComponent>
31+
</div>
2232
</div>
2333
);
2434
};
Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
11
@use "@/libs/theme/styles/variables" as *;
2+
@use "@/libs/theme/styles/mixins" as *;
23

34
.container {
4-
min-height: 100vh;
5-
display: flex;
6-
flex-direction: column;
7-
8-
@media #{$breakpoint-dimension-sm} {
9-
flex-direction: row;
10-
}
5+
@include InnerContentFlex;
6+
justify-content: start;
7+
margin-bottom: 5rem;
118
}
9+
10+
.title {
11+
color: var(--color_fg_bold);
12+
font-size: 2rem;
13+
line-height: 2.5rem;
14+
font-weight: 400;
15+
letter-spacing: -0.96px;
16+
17+
@media #{$breakpoint-dimension-xs} {
18+
font-size: 2.5rem;
19+
}
20+
21+
@media #{$breakpoint-dimension-sm} {
22+
font-size: 3rem;
23+
}
24+
}

src/features/introduction/components/introduction-hero/introduction-hero.module.scss

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,23 @@
33

44
.container {
55
@include Container;
6-
7-
background: var(--color_bg_page);
8-
border-bottom: 1px solid var(--color_border_bold);
6+
margin: 1.5rem 0rem;
97
}
108

119
.content {
1210
@include InnerContentFlex;
13-
flex-direction: column;
14-
align-items: center;
15-
16-
padding-top: 2.5rem;
17-
padding-bottom: 2.5rem;
18-
19-
@media #{$breakpoint-dimension-xs} {
20-
padding-top: 4.5rem;
21-
padding-bottom: 4.5rem;
22-
}
2311
}
2412

2513
.title {
14+
width: 100%;
2615
color: var(--color_fg_bold);
27-
text-align: center;
16+
text-align: left;
2817
font-size: 2rem;
29-
line-height: 2.5rem;
30-
font-weight: 400;
31-
letter-spacing: -0.96px;
18+
line-height: 1.15;
19+
font-weight: 500;
20+
letter-spacing: -.96px;
21+
max-width: 42rem;
22+
text-wrap-style: balance;
3223

3324
@media #{$breakpoint-dimension-xs} {
3425
font-size: 2.5rem;

src/features/introduction/components/introduction-page/introduction-page.component.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ import { generateArticleStructuredData } from "@/features/seo/services/structure
44
import { Auth0CtaComponent } from "@/features/common/components/auth0-cta/auth0-cta.component";
55
import { getIntroductionDictionary } from "@/features/localization/services/language-dictionary.service";
66
import { IntroductionArticleComponent } from "@/features/introduction/components/introduction-article/introduction-article.component";
7-
import { IntroductionHeroComponent } from "@/features/introduction/components/introduction-hero/introduction-hero.component";
8-
import { EbookAdComponent } from "@/features/introduction/components/ebook-ad/ebook-ad.component";
97
import { getAuth0Dictionary } from "@/features/localization/services/ui-language-dictionary.service";
10-
import { getComponentDictionary } from "@/features/localization/services/component-dictionary.service";
118

129
interface IntroductionPageComponentProps {
1310
languageCode: string;
@@ -18,7 +15,6 @@ export const IntroductionPageComponent: React.FC<
1815
> = ({ languageCode }) => {
1916
const introductionDictionary = getIntroductionDictionary(languageCode);
2017
const auth0Dictionary = getAuth0Dictionary(languageCode);
21-
const componentDictionary = getComponentDictionary(languageCode);
2218

2319
return (
2420
<>
@@ -121,12 +117,10 @@ export const IntroductionPageComponent: React.FC<
121117
}),
122118
]}
123119
/>
124-
<IntroductionHeroComponent
120+
<IntroductionArticleComponent
121+
introductionDictionary={introductionDictionary}
125122
languageCode={languageCode}
126-
dictionary={introductionDictionary.hero}
127123
/>
128-
<EbookAdComponent copy={componentDictionary.ebookAd} />
129-
<IntroductionArticleComponent languageCode={languageCode} />
130124
<Auth0CtaComponent
131125
languageCode={languageCode}
132126
dictionary={auth0Dictionary.banner}

0 commit comments

Comments
 (0)