Skip to content

Commit 0463ca7

Browse files
committed
fix: doc css issue on blank lines
1 parent 6426144 commit 0463ca7

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

pwa/app/(common)/layout.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import "styles/common.css";
22
import "@docsearch/css";
3-
import { Poppins } from "next/font/google";
3+
import { Poppins, Fira_Mono } from "next/font/google";
44
import Layout from "components/layout/Layout";
55
import { Metadata } from "next";
66
import { getRootUrl } from "utils";
@@ -12,6 +12,13 @@ const poppins = Poppins({
1212
subsets: ["latin", "latin-ext"],
1313
});
1414

15+
const fira = Fira_Mono({
16+
variable: "--font-fira",
17+
display: "swap",
18+
weight: ["400", "500", "700"],
19+
subsets: ["latin", "latin-ext"],
20+
});
21+
1522
export async function generateMetadata(): Promise<Metadata> {
1623
const dictionary = await import(`data/meta.json`);
1724

@@ -56,7 +63,10 @@ function RootLayout({
5663
children: React.ReactNode;
5764
}) {
5865
return (
59-
<html lang="en" className={`${poppins.variable} w-full light`}>
66+
<html
67+
lang="en"
68+
className={`${poppins.variable} ${fira.variable} w-full light`}
69+
>
6070
<body className="bg-white dark:bg-blue-black">
6171
<Layout>{children}</Layout>
6272
</body>

pwa/common.tailwind.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ module.exports = {
6666
},
6767
fontFamily: {
6868
title: ["var(--font-poppins)"],
69+
mono: ["var(--font-fira)"],
6970
},
7071
maxWidth: {
7172
"8xl": "90rem",

pwa/styles/common.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
@apply hidden;
4141
}
4242
.doc pre {
43-
@apply text-sm whitespace-pre-wrap leading-relaxed !bg-gray-100 dark:!bg-blue-darkest rounded-2xl mt-2 mb-4 overflow-x-auto;
43+
@apply font-mono text-sm whitespace-pre-wrap leading-relaxed !bg-gray-100 dark:!bg-blue-darkest rounded-2xl mt-2 mb-4 overflow-x-auto;
4444
}
4545
.doc pre > code > pre {
4646
@apply p-0 m-0 rounded-none !bg-transparent;
@@ -54,6 +54,9 @@
5454
.doc a {
5555
@apply text-blue;
5656
}
57+
.doc span.line:after {
58+
content: "\200B"; /* useful to set correct height on empty lines */
59+
}
5760
}
5861

5962
@layer utilities {

0 commit comments

Comments
 (0)