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

Improve dark mode code colours Fixes #2377 #2500

Conversation

japneetsingh035
Copy link

Issue This PR Addresses

Type of Change

  • Bugfix: Change which fixes an issue
  • New Feature: Change which adds functionality
  • Documentation Update: Change which improves documentation
  • UI: Change which improves UI

Description

Before:
Screen Shot 2021-11-19 at 10 45 20 AM

After:
Screen Shot 2021-11-19 at 12 35 31 PM

Checklist

  • Quality: This PR builds and passes our npm test and works locally
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Screenshots: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not (if applicable)
  • Documentation: This PR includes updated/added documentation to user exposed functionality or configuration variables are added/changed or an explanation of why it does not(if applicable)

@gitpod-io
Copy link

gitpod-io bot commented Nov 19, 2021

@AmasiaNalbandian
Copy link
Contributor

Is the color supposed to change only for dark mode? I am seeing the same color scheme for the light mode also:
image

@japneetsingh035
Copy link
Author

Yes, I am working on the colour scheme to change on the toggle. However, it would require changing all the previous code for highlight.js. So, I made a draft PR to get some help in development.

@japneetsingh035 japneetsingh035 self-assigned this Nov 19, 2021
@japneetsingh035 japneetsingh035 linked an issue Nov 19, 2021 that may be closed by this pull request
@AmasiaNalbandian
Copy link
Contributor

Yes, I am working on the colour scheme to change on the toggle. However, it would require changing all the previous code for highlight.js. So, I made a draft PR to get some help in development.

Can we try something like this?
https://stackoverflow.com/questions/35762351/correct-way-to-handle-conditional-styling-in-react

Make a conditional in the div for the stylesheet.
What we can also do it make a variable to toggle the state somewhere here, and use this to do the conditional stylesheet.

@AmasiaNalbandian
Copy link
Contributor

This is a better example using the link stylesheets:
https://stackoverflow.com/questions/43971507/if-else-jsx-using-link-in-react

Copy link
Contributor

@humphd humphd left a comment

Choose a reason for hiding this comment

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

See

@import 'highlight.js/styles/github.css';

We're going to want to have two stylesheets, both from node_modules vs. a cdn, and you will pick the one at runtime to use.

Also, src/api/status* isn't the same code as what you're changing for posts.

@drew5494 drew5494 self-requested a review November 19, 2021 19:14
@@ -106,8 +106,8 @@
overflow-wrap: unset;
word-wrap: none;
font-family: Menlo, Consolas, Monaco, 'Liberation Mono', 'Lucida Console', monospace;
background: #eff0f1;
color: #242424;
background: rgb(14, 17, 22);
Copy link
Contributor

Choose a reason for hiding this comment

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

Hex values, please.

@humphd
Copy link
Contributor

humphd commented Nov 28, 2021

What's the status of this?

@japneetsingh035
Copy link
Author

What's the status of this?

Well, we can close this PR and will make a new one, once I am done - still working on enabling the dark mode colour.

@humphd humphd closed this Nov 29, 2021
@japneetsingh035 japneetsingh035 deleted the enabling-dark-colour-for-inline-code branch November 30, 2021 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve dark mode code colours
4 participants