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

design tweaks #2141

Merged
merged 6 commits into from
Aug 26, 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
42 changes: 22 additions & 20 deletions docs/.vitepress/theme/custom.css
Original file line number Diff line number Diff line change
@@ -1,40 +1,42 @@
:root {
--vp-c-purple-1: #7135be;
--vp-c-purple-2: #7f42cd;
--vp-c-purple-3: #9555e2;
--vp-c-purple-soft: rgba(155, 91, 233, 0.14);
--vp-c-red: #f43f5e;
--vp-c-green: #10b981;
--vp-c-blue: #0092ff;
--vp-c-purple: #a463f2;
--vp-c-brand-1: var(--vp-c-purple-1);
--vp-c-brand-2: var(--vp-c-purple-2);
--vp-c-brand-3: var(--vp-c-purple-3);
--vp-c-brand-soft: var(--vp-c-purple-soft);
--vp-font-family-base: -apple-system, BlinkMacSystemFont, "avenir next", avenir, helvetica, "helvetica neue", ubuntu,
roboto, noto, "segoe ui", arial, sans-serif;
--sans-text: Inter, var(--vp-font-family-base);
--theme-phosphate: #148576;
--theme-phosphate-2: #1da492;
--theme-phosphate-3: #26c1ad;
--theme-phosphate-soft: #d7fbf7;
--vp-c-brand-1: var(--theme-phosphate); /* link and brand color */
--vp-c-brand-2: var(--theme-phosphate-2);
--vp-c-brand-3: var(--theme-phosphate-3);
--hero-brand-contrast: rgb(243, 139, 233); /* home page alt color */
--vp-c-brand-soft: var(--theme-phosphate-soft);
--mono-heading: "Spline Sans Mono", monospace;
--vp-font-family-mono: var(--mono-heading);
--vp-font-family-base: Inter, -apple-system, BlinkMacSystemFont, "avenir next", avenir, helvetica, "helvetica neue", ubuntu, roboto, noto, "segoe ui", arial, sans-serif;
--vp-code-font-size: 14px;
--vp-code-line-height: 1.5;
}

.dark {
--vp-c-purple-1: #db96ff;
--vp-c-purple-2: #9a5ae8;
--vp-c-purple-3: #884ad6;
--vp-c-purple-soft: rgba(155, 91, 233, 0.16);
--theme-phosphate: #37d5be;
--theme-phosphate-2: #28b39e;
--theme-phosphate-3: #1b9583;
--hero-brand-contrast: rgb(183, 41, 169);
--theme-phosphate-soft: #033a32;
--vp-c-text-1: #f5f5f5;
}

.vp-doc {
font-family: var(--sans-text);
font-weight: 500;
}

.vp-doc h1 {
font-family: var(--mono-heading);
font-weight: 500;
}

.vp-doc p {
line-height: 1.5;
Copy link
Member

Choose a reason for hiding this comment

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

This should probably be on .vp-doc rather than just p? Otherwise things like lists will have a different line-height which will look weird.

Copy link
Contributor Author

@Fil Fil Aug 22, 2024

Choose a reason for hiding this comment

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

For me this is correct as is.

The default line-height on the body is set in node_modules/vitepress/dist/client/theme-default/styles/base.css as 24px, but it's overloaded in
node_modules/vitepress/dist/client/theme-default/styles/components/vp-doc.css with the selector .vp-doc p (also .vp-doc h1, etc.). Resetting this on .vp-doc would not have enough specificity, and .vp-doc p is the only one we want to override.

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point. I removed my thumbs up :-)

Copy link
Member

Choose a reason for hiding this comment

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

That seems like a bizarre out-of-the-box design by VitePress, but indeed you are right, the line-height is 24px for ul elements and 28px for p elements. It seems that VitePress avoids this problem on their own site by using p elements within the li elements, restoring the 28px line-height. So, perhaps the intent is that you only use the 24px line-height for lists when you know that the list items all fit on a single line. 🤔 Anyway it means this is “correct” according to the weirdness of the VitePress default theme I guess.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree it's more "correct" than it is correct :-)

}

.vp-doc a {
color: var(--vp-c-text-1);
}
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ features:

:root {
--vp-home-hero-name-color: transparent;
--vp-home-hero-name-background: linear-gradient(-30deg, hsl(200deg 100% 65%), var(--vp-c-purple));
--vp-home-hero-name-background: linear-gradient(-30deg, var(--hero-brand-contrast), var(--vp-c-brand-1));
}

:root.dark .VPHero .VPImage {
Expand Down