Skip to content

Commit bf54ba4

Browse files
committed
[RZB-250021]: fixed common header and hide title for small screens
1 parent a06375b commit bf54ba4

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

.vscode/dictionaries/project-words.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ jsonify
3939
Jyeshtha
4040
Kartika
4141
kmeans
42+
letterpad
4243
linalg
4344
lucide
4445
LXXX

src/assets/styles/tile.css

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
.container__page {
2+
container-type: inline-size;
3+
container-name: letterpad;
4+
}
5+
16
.page__header {
27
display: flex;
38
align-items: center;
@@ -40,21 +45,19 @@
4045
padding: 1rem;
4146
height: calc(100vh - 5rem);
4247
overflow-y: auto;
43-
container-type: inline-size;
48+
4449

4550
.page__grid {
4651
display: grid;
4752
gap: 1.25rem;
48-
grid-template-columns: 1fr;
53+
grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
4954
justify-content: center;
5055
margin-top: 1rem;
5156
}
57+
}
5258

53-
@container (min-width: 600px) {
54-
.page__grid {
55-
display: grid;
56-
grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
57-
gap: 1.5rem;
58-
}
59+
@container letterpad (max-width: 700px) {
60+
.page__title {
61+
display: none;
5962
}
60-
}
63+
}

src/pages/glossary/[item].astro

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import BackButton from "@/components/BackButton.astro";
44
import LetterCard from "@/components/LetterCard.astro";
55
import glossaryData from "@/data/glossary.json";
66
import BaseLayout from "@/layouts/Base";
7+
import type { AlphabetEntry } from "@/types/alphabet";
78
89
export async function getStaticPaths() {
910
return Object.keys(glossaryData).map((value) => ({
@@ -20,16 +21,16 @@ if (!categoryData) {
2021
}
2122
---
2223

23-
<BaseLayout meta={{ title: title ?? item }}>
24-
<BackButton href="/glossary" />
24+
<BaseLayout meta={{ title: title }}>
2525
<div class="container__page">
2626
<div class="page__header">
27-
<h2 class="page__title">{title ?? item}</h2>
27+
<BackButton href="/glossary" />
28+
<h2 class="page__title">{title}</h2>
2829
<button id="flip-all-button" class="btn__flip__all">Flip All Cards</button>
2930
</div>
3031
<div class="page__content">
3132
<div class="page__grid">
32-
{data && data.map((entry: any) => <LetterCard item={entry} category={category ?? item} />)}
33+
{data.map((entry: AlphabetEntry) => <LetterCard item={entry} category={category} />)}
3334
</div>
3435
</div>
3536
</div>

0 commit comments

Comments
 (0)