Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tailwind css #98

Merged
merged 4 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
node_modules/
book
.DS_Store
css/tailwind.css
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generated file

1 change: 1 addition & 0 deletions .spellcheckerrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"files": [
"**/*.md",
"!STYLEGUIDE.md",
"!preprocessors/README.md",
"!LICENSE.md",
"**/.github/**/*.md"
],
Expand Down
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodejs 22.11.0
13 changes: 10 additions & 3 deletions book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@ multilingual = false
src = "pages"
title = "Frequency Documentation"

[preprocessor.local]
command = "node preprocessor.mjs"
[preprocessor.button-links]
command = "node preprocessors/button-links.mjs"

[preprocessor.svg-embed]
command = "node preprocessors/svg-embed.mjs"

[preprocessor.tailwind]
renderers = ["html"]
command = 'node preprocessors/noop-npx.mjs "npx -y tailwindcss -i ./theme/css/tailwind.css -o ./css/tailwind.css"'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why noop-npx.mjs? Noop because it doesn't adjust the book contents like other preprocessors do. This is just used as a trigger to re-run the tailwind build script


[output.html]
no-section-label = true
Expand All @@ -16,9 +23,9 @@ git-repository-url = "https://github.com/frequency-chain/docs"
edit-url-template = "https://github.com/frequency-chain/docs/blob/main/{path}"
preferred-dark-theme = "coal"
additional-css = [
"css/tailwind.css",
"css/side-nav.css",
"css/header.css",
"css/footer.css",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All tailwind standard now, so almost copy paste from svelte generated code.

"css/extended.css",
"css/highlight.css",
"css/highlight-dark.css",
Expand Down
6 changes: 3 additions & 3 deletions css/extended.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
}

#logo {
letter-spacing: -0.1rem;
font-size: 4.2rem;
letter-spacing: -1px;
font-size: 42px;
font-weight: 300;
line-height: 0;
}
Expand Down Expand Up @@ -55,7 +55,7 @@
padding: 20px 10%;
margin: 10px;
display: flex;
font-size: 2rem;
font-size: 20px;
font-weight: 400;
flex: 0.5;
transition-property: border, color;
Expand Down
92 changes: 0 additions & 92 deletions css/footer.css

This file was deleted.

8 changes: 4 additions & 4 deletions css/side-nav.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
flex: 0 0 45px;
width: 45px;
height: 45px;
margin-inline-end: 1rem;
margin-inline-end: 10px;
background-size: contain;
background-repeat: no-repeat;
background-position: center;
Expand Down Expand Up @@ -70,7 +70,7 @@
}

#toc > .chapter > li.chapter-item {
margin-block-start: 4.5rem;
margin-block-start: 45px;
}

/* n(1) is hidden, so we need to remove the margin from n(2) */
Expand All @@ -79,12 +79,12 @@
}

#toc > .chapter > li > a:first-of-type {
padding-inline-start: 1rem;
padding-inline-start: 10px;
font-weight: bold;
}

#toc > .chapter > li > .section {
padding-inline-start: calc(45px + 2rem);
padding-inline-start: calc(45px + 20px);
}

#toc > .chapter li {
Expand Down
Loading