Skip to content

Commit 26aacff

Browse files
committed
feat: add base and typography styles, refactor layout for improved structure
1 parent 963a165 commit 26aacff

File tree

6 files changed

+53
-27
lines changed

6 files changed

+53
-27
lines changed

playground/src/layouts/Layout.astro

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
---
22
import "@/styles/global.css";
3+
import "@/styles/base.css";
4+
import "@/styles/typography.css";
35
import BaseHead from "@/components/BaseHead.astro";
46
import Header from "../components/Header.astro";
57
---
@@ -15,7 +17,7 @@ import Header from "../components/Header.astro";
1517
<main>
1618
<slot />
1719
</main>
18-
20+
1921
<script>
2022
import "preline/preline.js";
2123
</script>

playground/src/pages/index.astro

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const intros = await getAllIntroductions();
1919
<div class="container mx-auto my-24">
2020
<div class="flex flex-col items-center justify-between">
2121
<div class="flex flex-col items-center gap-y-4 mb-8">
22-
<h1 class="text-4xl dark:text-white">
22+
<h1 class="ss-h1">
2323
Welcome to the StarSquid Playground
2424
</h1>
2525
</div>
@@ -29,7 +29,7 @@ const intros = await getAllIntroductions();
2929
const data = intro.data.data;
3030
return (
3131
data && (
32-
<h2 class="text-3xl dark:text-white">
32+
<h2 class="ss-h2">
3333
<a
3434
class="text-blue-600 hover:underline hover:decoration-blue-800 focus:outline-hidden focus:underline focus:decoration-blue-800 dark:decoration-white"
3535
href={routes.intro(data.slug.iv)}
@@ -43,7 +43,7 @@ const intros = await getAllIntroductions();
4343
}
4444

4545
<sction>
46-
<h3 class="text-2xl dark:text-white">This is the backend info:</h3>
46+
<h3 class="ss-h3 dark:text-white">This is the backend info:</h3>
4747
{
4848
app && (
4949
<p class="dark:text-white">
@@ -64,7 +64,7 @@ const intros = await getAllIntroductions();
6464
</div>
6565

6666
<div class="grow pt-0.5 pb-8">
67-
<h3 class="flex gap-x-1.5 font-semibold text-gray-800 dark:text-white">
67+
<h3 class="ss-h3 flex gap-x-1.5 font-semibold text-gray-800 dark:text-white">
6868
<svg
6969
class="shrink-0 size-4 mt-1"
7070
xmlns="http://www.w3.org/2000/svg"

playground/src/pages/intro/[slug].astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Astro.cookies.set(COLUMN, slug, { path: "/" });
2626
<Layout>
2727
<div class="container mx-auto my-24 xl:my-5">
2828
<header class="flex flex-col items-center sm:mt-24 text-center">
29-
<h1 class="mb-6 text-4xl">
29+
<h1 class="mb-6 ss-h1">
3030
{data.title.iv}
3131
</h1>
3232
</header>

playground/src/styles/base.css

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
@import "tailwindcss";
2+
@reference "./global.css";
3+
4+
* {
5+
@apply border-border outline-ring/50;
6+
}
7+
8+
body {
9+
@apply bg-background text-foreground;
10+
}
11+
12+
header.scrolled {
13+
@apply border-black/25 bg-white/80 saturate-200 backdrop-blur-sm dark:border-white/25 dark:bg-black/50;
14+
}
15+
16+
/* Adds pointer cursor to buttons */
17+
button:not(:disabled),
18+
[role="button"]:not(:disabled) {
19+
cursor: pointer;
20+
}

playground/src/styles/global.css

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import 'tailwindcss';
1+
@import "tailwindcss";
22
/* for Shadcn Accordion */
33
@import "tw-animate-css";
44

@@ -8,29 +8,15 @@
88
/* Defaults hover styles on all devices */
99
@custom-variant hover (&:hover);
1010

11-
@layer base {
12-
* {
13-
@apply border-border outline-ring/50;
14-
}
15-
body {
16-
@apply bg-background text-foreground;
17-
}
18-
19-
/* Adds pointer cursor to buttons */
20-
button:not(:disabled),
21-
[role="button"]:not(:disabled) {
22-
cursor: pointer;
23-
}
24-
}
25-
26-
header.scrolled {
27-
@apply border-black/25 bg-white/80 saturate-200 backdrop-blur-sm dark:border-white/25 dark:bg-black/50;
28-
}
29-
3011
/* generated by Shadcn */
31-
3212
@custom-variant dark (&:is(.dark *));
3313

14+
@theme {
15+
--font-display: var(--font-inter-display), "ui-sans-serif", "system-ui",
16+
"sans-serif";
17+
}
18+
19+
/* generate by Shadcn */
3420
@theme inline {
3521
--radius-sm: calc(var(--radius) - 4px);
3622
--radius-md: calc(var(--radius) - 2px);
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
@import "tailwindcss";
2+
@reference "./global.css";
3+
4+
.ss-h1 {
5+
@apply font-display font-medium text-balance text-5xl md:text-6xl;
6+
}
7+
8+
.ss-h2 {
9+
@apply font-display font-medium text-balance text-3xl md:text-4xl;
10+
}
11+
12+
.ss-h3 {
13+
@apply font-display font-medium text-balance text-lg md:text-2xl;
14+
}
15+
16+
.ss-body-text {
17+
@apply leading-relaxed;
18+
}

0 commit comments

Comments
 (0)