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

Style/custom dark theme #2414

Merged
merged 18 commits into from
Sep 9, 2024
Merged

Conversation

stvmachine
Copy link
Contributor

@stvmachine stvmachine commented Jul 24, 2024

Preview

https://stvmachine.github.io/osv.dev/quickstart/

Description

Using a dark theme for the docs as a starting point. Just-the-docs come with a default dark theme.

The updates:

Screenshot 2024-07-24 at 12 50 12 PM

Figure 1: Updated logo.

  • Code snippet highlight has been updated: Using native due to the default dark theme having issues with comments on JSON due they are recognized and styled as errors. The code snippets can be changed to any other pygment theme as long we have the scss file.

Screenshots

Screenshot 2024-07-26 at 12 20 03 PM
Screenshot 2024-07-26 at 11 55 08 AM
Screenshot 2024-07-25 at 3 03 36 PM
Screenshot 2024-07-26 at 11 54 42 AM
Screenshot 2024-07-26 at 11 54 58 AM

@another-rex
Copy link
Contributor

The colours seem a bit off, specifically I think the background colour should match the background of OSV.dev / figma design.

@stvmachine
Copy link
Contributor Author

stvmachine commented Jul 25, 2024

The colours seem a bit off, specifically I think the background colour should match the background of OSV.dev / figma design.

Yeah, you are right. My mistake, I made some assumptions in terms of black/white. I double-checked some of the visible styles on Figma versus the updates and at least those should match now.

Styles for tables, search input & search results, code snippet styles are not covered by Figma and unfortunately, I just went with defaults plus this solarised dark theme for code highlight.

@another-rex
Copy link
Contributor

I'm not a big fan of the solarized-dark code theme, on our blog pages we use the chroma 'native' theme: https://xyproto.github.io/splash/docs/native.html

It looks like there's a scss version of it here: https://github.com/dwayne/sass-pygments/blob/master/styles/scss/native.scss

Can you try using that instead?

As for the search input, using the same background colour as the main page (#2A2A2A) should be fine, as the entire background darkens anyway when the search is selected.

@stvmachine
Copy link
Contributor Author

stvmachine commented Jul 26, 2024

I'm not a big fan of the solarized-dark code theme, on our blog pages we use the chroma 'native' theme: https://xyproto.github.io/splash/docs/native.html

It looks like there's a scss version of it here: https://github.com/dwayne/sass-pygments/blob/master/styles/scss/native.scss

Can you try using that instead?

As for the search input, using the same background colour as the main page (#2A2A2A) should be fine, as the entire background darkens anyway when the search is selected.

Updates:

  • Search-input background-color changed to #2A2A2A
  • Updated table background-color. Preview. I came up with the lighter version after doing some math similar to the default gradient. Let me know if the darker version works for you. I used scss primitives (darken/lighten) and color base #2a2a2a e.g. $table-background-color: lighten($new-body-background-color, 5%);

✅ Lighter version (on use)
Screenshot 2024-07-26 at 12 11 09 PM

🔴 Dark version (not used)
Screenshot 2024-07-26 at 12 11 01 PM

  • Replaced code snippet with native. Updated screenshot at top but can share here as well
    Screenshot 2024-07-26 at 11 54 58 AM

Copy link
Contributor

@another-rex another-rex left a comment

Choose a reason for hiding this comment

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

Looks great! Happy with the light background version for tables

@joshbuker
Copy link
Contributor

The colours seem a bit off, specifically I think the background colour should match the background of OSV.dev / figma design.

Yeah, you are right. My mistake, I made some assumptions in terms of black/white. I double-checked some of the visible styles on Figma versus the updates and at least those should match now.

Styles for tables, search input & search results, code snippet styles are not covered by Figma and unfortunately, I just went with defaults plus this solarised dark theme for code highlight. Not sure, how to iterate over this work more than involve more @joshbuker and relay on his input 🙏🏼

Did you mean to ping me?

@another-rex another-rex requested review from andrewpollock and removed request for andrewpollock July 26, 2024 23:00
@another-rex
Copy link
Contributor

Did you mean to ping me?

Ah sorry, I don't think so, we have someone with the same name internally and @ is getting confused.

@another-rex
Copy link
Contributor

@stvmachine I just realised that the background color of OSV.dev is actually #292929, can you see if you can update the 2A2A2A to 292929? Thanks!

@another-rex
Copy link
Contributor

osv.dev also uses the Overpass font, can you also try switching from the current roboto font to overpass and see how that looks?

@another-rex
Copy link
Contributor

Thanks, just need to rebase/merge this from master and we should be good to merge.

Copy link
Contributor

@another-rex another-rex left a comment

Choose a reason for hiding this comment

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

I think the font is still incorrect, we need to specify the font used in the CSS as well. Also please merge in the master branch to get the PR check to pass.

@@ -5,7 +5,7 @@
<!-- needed for adaptive design -->
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Overpass:300,400,700" rel="stylesheet">
Copy link
Contributor

Choose a reason for hiding this comment

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

We also need to set this font in the CSS, not just adding the resource. I believe it defaulted to roboto because that's the default system font.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Friendly ping on this @stvmachine @G-Rath

@another-rex another-rex merged commit b901f45 into google:master Sep 9, 2024
11 checks passed
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.

5 participants