Skip to content

Commit c1dac2f

Browse files
Docs restyling (#348)
1 parent fc5d7ff commit c1dac2f

23 files changed

+3895
-4457
lines changed

packages/astro-theme/components/BlogPostCard.astro

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ const authors = await resolveAuthors(post.data.authors);
2424
const productName = typeof product === "undefined" ? "Labs" : product.name;
2525
//if product is cheerpj, add prefix /docs on post url
2626
const blog_url =
27-
productName === "CheerpJ" ? "https://labs.leaningtech.com/blog/" : "/blog/";
27+
productName === "CheerpJ" || productName === "BrowserPod"
28+
? "https://labs.leaningtech.com/blog/"
29+
: "/blog/";
2830
---
2931

3032
<a
@@ -38,16 +40,14 @@ const blog_url =
3840
width={size === "wide" ? 600 : 390}
3941
height={256}
4042
alt=""
41-
class="rounded-xl mb-4 bg-stone-100 object-cover w-full h-64 self-center"
43+
class="rounded-xl mb-4 bg-bg-100 object-cover w-full h-64 self-center"
4244
/>
4345
)
4446
}
4547
<h3
4648
class:list={{
4749
"font-bold text-balance text-white grow": true,
48-
"group-hover:text-cheerp grow": productName === "Cheerp",
49-
"group-hover:text-[#6386a5] grow": productName === "CheerpX",
50-
"group-hover:text-primary-400 grow": productName === "Labs",
50+
"group-hover:text-primary-400 grow": true,
5151
"text-2xl leading-7": size === "wide",
5252
"text-xl leading-6": size === "narrow",
5353
}}
@@ -56,13 +56,13 @@ const blog_url =
5656
</h3>
5757
{
5858
showMetadata && (
59-
<div class="mt-4 flex justify-between items-center gap-8 text-stone-400 text-base whitespace-nowrap">
59+
<div class="mt-4 flex justify-between items-center gap-8 text-bg-400 text-base whitespace-nowrap">
6060
<div class="flex items-center gap-2 font-semibold overflow-hidden">
6161
<div class="flex-none space-x-[-1rem]">
6262
{authors.map((author) =>
6363
author.avatar ? (
6464
<img
65-
class="inline-block w-8 h-8 rounded-full shadow border-2 border-stone-900"
65+
class="inline-block w-8 h-8 rounded-full shadow border-2 border-bg-900"
6666
src={author.avatar.src}
6767
alt=""
6868
loading="lazy"

packages/astro-theme/components/Breadcrumbs.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const crumbs = path
2525
});
2626
---
2727

28-
<nav aria-label="Breadcrumb" class="leading-6 text-stone-400 text-sm">
28+
<nav aria-label="Breadcrumb" class="leading-6 text-bg-400 text-sm">
2929
<ol>
3030
{
3131
crumbs.map(({ title, url, isLast }) => (
@@ -37,7 +37,7 @@ const crumbs = path
3737
{title}
3838
</a>
3939
{!isLast && (
40-
<Icon name="jam:chevron-right" class="h-5 mx-2 text-stone-700" />
40+
<Icon name="jam:chevron-right" class="h-5 mx-2 text-bg-700" />
4141
)}
4242
</li>
4343
))

packages/astro-theme/components/DirectoryListing.astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ function getEntryDescription(entry: NavEntry): string | undefined {
2222
<li>
2323
<a
2424
href={entry.href}
25-
class="block group rounded-md border bg-stone-950 px-4 py-3 shadow border-stone-800 hover:border-stone-700 transition-colors"
25+
class="block group rounded-md border bg-bg-950 px-4 py-3 shadow border-bg-800 hover:border-bg-700 transition-colors"
2626
>
27-
<div class="text-lg font-semibold text-stone-300 group-hover:text-stone-50 transition-colors">
27+
<div class="text-lg font-semibold text-bg-300 group-hover:text-bg-50 transition-colors">
2828
{entry.title}
2929
</div>
30-
<div class="text-ellipsis whitespace-nowrap overflow-hidden text-stone-400 text-sm">
30+
<div class="text-ellipsis whitespace-nowrap overflow-hidden text-bg-400 text-sm">
3131
{getEntryDescription(entry) ?? ""}
3232
</div>
3333
</a>

packages/astro-theme/components/DocsPagination.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const { next, prev } = await getNextPrev();
5757
// TODO: `"href" in X` no longer needed once NavDirectorys have href (i.e. dir listing / index pages are a thing)
5858
---
5959

60-
<div class="flex justify-between font-medium text-stone-400 text-base gap-8">
60+
<div class="flex justify-between font-medium text-bg-400 text-base gap-8">
6161
{
6262
prev && "href" in prev ? (
6363
<a href={prev.href} class="flex items-center gap-2 hover:text-white p-2">

packages/astro-theme/components/DocsSidebar.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const hasMultipleLocales = !!Astro.currentLocale;
1919

2020
<aside
2121
is="docs-sidebar"
22-
class="bg-stone-800 lg:bg-stone-900 fixed lg:sticky top-0 h-[100dvh] lg:top-[65px] z-10 p-8 w-full md:w-80 lg:h-[calc(100vh-4rem)] overflow-y-auto lg:text-sm"
22+
class="bg-bg-800 lg:bg-bg-900 fixed lg:sticky top-0 h-[100dvh] lg:top-[65px] z-10 p-8 w-full md:w-80 lg:h-[calc(100vh-4rem)] overflow-y-auto lg:text-sm"
2323
>
2424
<button data-sidebar-close class="absolute top-4 right-4 lg:hidden">
2525
<span class="sr-only">Close navigation</span>

packages/astro-theme/components/DocsSidebarNavEntry.astro

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ const title = await getLocalisedEntryTitle(entry);
2727
entry.type === "file" && (!entry.isIndex || depth === 0) && (
2828
<li
2929
class:list={[
30-
"group py-1 text-stone-400 hover:border-stone-400 hover:text-white",
30+
"group py-1 text-bg-400 hover:border-bg-400 hover:text-white",
3131
{
3232
"font-semibold !text-primary-500 !border-primary-600":
3333
entry.href === pathname,
34-
"px-4 border-l border-stone-800": depth > 0,
34+
"px-4 border-l border-bg-800": depth > 0,
3535
"bg-primary-600 bg-opacity-5": depth > 0 && entry.href === pathname,
3636
},
3737
]}
@@ -47,11 +47,11 @@ const title = await getLocalisedEntryTitle(entry);
4747
entry.type === "directory" && (
4848
<li
4949
class:list={[
50-
"py-4 first:pt-2",
51-
{ "pl-4 border-l border-stone-800": depth > 0 },
50+
"py-2 first:pt-2",
51+
{ "pl-4 border-l border-bg-800": depth > 0 },
5252
]}
5353
>
54-
<h5 class="mb-1 font-semibold text-stone-300 hover:text-white">
54+
<h5 class="mb-1 text-bg-300 hover:text-white font-semibold tracking-wide">
5555
<a
5656
href={entry.href}
5757
class:list={[

packages/astro-theme/components/Footer.astro

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ const sections: Section[] = [
9898

9999
{Astro.props.includeGrow === false ? null : <div class="grow" />}
100100

101-
<footer class="p-14 bg-black border-t border-stone-700">
101+
<footer class="p-14 bg-black border-t border-bg-700">
102102
<div class="w-full max-w-screen-2xl mx-auto">
103103
<div
104104
class="grid sm:grid-cols-1 lg:grid-cols-[auto_1fr_1fr] gap-14 place-content-between text-lg"
@@ -138,14 +138,14 @@ const sections: Section[] = [
138138
<section class="space-y-3">
139139
<h3 class="text-xl font-semibold">{section.name}</h3>
140140
{section.description && (
141-
<p class="text-stone-400">{section.description}</p>
141+
<p class="text-bg-400">{section.description}</p>
142142
)}
143143
<ul class="space-y-3">
144144
{section.links.map((link) => (
145145
<li>
146146
<a
147147
href={link.href}
148-
class="text-stone-400 hover:text-primary-500"
148+
class="text-bg-400 hover:text-primary-500"
149149
>
150150
{link.text}
151151
</a>
@@ -158,7 +158,7 @@ const sections: Section[] = [
158158
</div>
159159
</div>
160160
<div
161-
class="grid sm:grid-cols-1 md:grid-cols-4 border-t border-stone-800 mt-14 pt-6 gap-6"
161+
class="grid sm:grid-cols-1 md:grid-cols-4 border-t border-bg-800 mt-14 pt-6 gap-6"
162162
>
163163
<div class="flex items-left gap-3">
164164
<a href={DISCORD_URL}>
@@ -177,7 +177,7 @@ const sections: Section[] = [
177177
<Icon name="mdi:linkedin" class="w-6 h-6 hover:text-primary-500" />
178178
</a>
179179
</div>
180-
<div class="text-stone-400 text-xs md:text-right md:col-span-3">
180+
<div class="text-bg-400 text-xs md:text-right md:col-span-3">
181181
<p class="align-baseline">
182182
© {today.getFullYear()} Leaning Technologies . All rights reserved.
183183
</p>

packages/astro-theme/components/LinkButton.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const {
4242
type === "primary2",
4343
"border-white bg-white text-black hover:bg-[#8e88ff] hover:text-white hover:border-[#8e88ff]":
4444
type === "primary-cheerp",
45-
"border-stone-600 text-primary-400 hover:border-primary-300":
45+
"border-bg-600 text-primary-400 hover:border-primary-300":
4646
type === "secondary",
4747
"border-white text-white hover:border-[#8e88ff] hover:text-[#8e88ff]":
4848
type === "secondary-cheerp",

packages/astro-theme/components/ShowcaseList.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ if (typeof props.limit == "number") {
2828
<li>
2929
<a
3030
href={project.data.url}
31-
class="block h-full p-2 border border-stone-700 text-stone-500 rounded-lg shadow-lg hover:translate-y-[-2px] hover:border-stone-600 hover:text-stone-400 transition-all"
31+
class="block h-full p-2 border border-bg-700 text-bg-500 rounded-lg shadow-lg hover:translate-y-[-2px] hover:border-bg-600 hover:text-bg-400 transition-all"
3232
>
3333
{project.data.heroImage && (
3434
<Image
@@ -40,7 +40,7 @@ if (typeof props.limit == "number") {
4040
loading="lazy"
4141
/>
4242
)}
43-
<h5 class="font-semibold p-3 pb-1 text-stone-100">
43+
<h5 class="font-semibold p-3 pb-1 text-bg-100">
4444
{project.data.title}
4545
</h5>
4646
<p class="p-3 pt-0 leading-5">{project.data.description}</p>

packages/astro-theme/components/TableOfContents.astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ function buildToc(headings: BasicHeading[]) {
3838
}
3939
---
4040

41-
<nav aria-label="On this page">
41+
<nav aria-label="On this page" class="text-sm">
42+
<p class="font-extrabold text-base">On this page</p>
4243
<ol>
4344
{toc.map((heading) => <TableOfContentsHeading heading={heading} />)}
4445
</ol>

0 commit comments

Comments
 (0)