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

design tweaks #2141

merged 6 commits into from
Aug 26, 2024

Conversation

Fil
Copy link
Contributor

@Fil Fil commented Aug 21, 2024

Following observablehq/framework#1591 we:

  • use the same (sans serif) font on the body
  • restore normal weight copy
  • adopt phosphate as the brand color
  • change the colors in the hero / home page to match

Notes:

  • the "soft" color is used for tip backgrounds, it must be very close to the white (or black) background but with the same chroma as phosphate.
  • the chroma of the pink colors chosen as alternative is from the Plot logo.
  • "Inter" is the default from VitePress

Capture d’écran 2024-08-21 à 11 24 51
Capture d’écran 2024-08-21 à 11 25 59
Capture d’écran 2024-08-21 à 11 26 31
Capture d’écran 2024-08-21 à 11 26 43

@Fil Fil requested a review from mbostock August 21, 2024 09:32
@CobusT
Copy link
Contributor

CobusT commented Aug 21, 2024

Created a PR to this branch with some further tweaks.

@Fil
Copy link
Contributor Author

Fil commented Aug 22, 2024

I've merged @CobusT 's addition, the text now looks crisper:
cobus

@@ -25,6 +28,10 @@
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 :-)

Comment on lines 8 to 10
--vp-c-brand-1: var(--theme-phosphate); /* link and brand color */
--vp-c-brand-2: var(--theme-phosphate);
--vp-c-brand-3: rgb(243, 139, 233); /* home page alt color */
Copy link
Member

Choose a reason for hiding this comment

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

This doesn’t seem right: these three colors should have the same hue, but varying lightness.

Look at how the current button varies in color as you hover and click:

Screen.Recording.2024-08-22.at.9.14.42.PM.mov

Compare that to this branch, where the color changes from pink to green on hover, and there’s no variation in color on click:

Screen.Recording.2024-08-22.at.9.15.50.PM.mov

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops! that's right. Since I couldn't find documentation, I went back to the defaults. As you're saying brand 1, 2, 3 are defined as colors of increasing lightness in light mode, and increasing darkness in dark mode.

brand-light

brand-dark

I've done the same by deriving from phosphate in both modes, and re-adding the contrasting ("pink") color under another name.

@Fil

This comment was marked as resolved.

@Fil Fil marked this pull request as draft August 23, 2024 09:59
@Fil Fil marked this pull request as ready for review August 23, 2024 13:02
@Fil Fil enabled auto-merge (squash) August 23, 2024 13:04
Copy link
Member

@mbostock mbostock left a comment

Choose a reason for hiding this comment

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

Big improvement! Thank you. 👏

@Fil Fil merged commit f3df5c5 into main Aug 26, 2024
1 check passed
@Fil Fil deleted the fil/design-tweaks branch August 26, 2024 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants