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

Support dark mode #331

Closed
26 tasks done
Tracked by #227 ...
eXpire163 opened this issue Aug 25, 2020 · 15 comments
Closed
26 tasks done
Tracked by #227 ...

Support dark mode #331

eXpire163 opened this issue Aug 25, 2020 · 15 comments
Assignees
Labels
design/style Front-end site design / styling e2-days enhancement New feature or request
Milestone

Comments

@eXpire163
Copy link

eXpire163 commented Aug 25, 2020

Providing a dark version of https://github.com/google/docsy/blob/master/assets/scss/_variables.scss would be great


Edits (@chalin)

Prep

Tasks

Adjustments that will be required to Docsy element styling in support of Bootstrap's dark mode:

@huehnerlady
Copy link
Contributor

Any update on this? Would love that feature to be available 😍

@frodriguezsmartclip
Copy link

Someone could add that feature to Docsy, It seems not to hard to do it: GoogleContainerTools/skaffold@ccdffd1

If I have time, I'll try to code it ⚡

@bwplotka
Copy link

Help wanted, that would be pretty epic to see! 🤗

@narrenfrei
Copy link
Contributor

I have tried to implement the above mentioned - I would call it - "darkmode hack" ;-) and made a PR with the WIP flag #563
You can have a look on the result at: https://deploy-preview-563--docsydocs.netlify.app/

In my opinion, the result generated by the snippets from GoogleContainerTools/skaffold@ccdffd1 is ... - yes it's dark and it's a mode and it's really quick to implement ;-)

I think, if we really want a darkmode, it would be better to write an separate _variables.scss to define the colors by hand.

Any other comments?

@narrenfrei
Copy link
Contributor

After reading a little more into the dark mode topic, I'm afraid that a "useful implementation" will require a little more work (and discussion). A few thoughts from me:

  • The dark mode hack from GoogleContainerTools/skaffold@ccdffd1 can be installed quite quickly (see WIP: try darkmode hack #331 #563).
  • But if you want a dark mode with individually definable stylesheet, you would need some modifications to the previous structure of Docsy.
    • Docsy uses Bootstrap and therefore SCSS. The move to Bootstrap v5 is likely to be around the corner. -> Maybe wait for the change?
    • A dark mode should remain optional for Docsy users and the visitors of Docsy sites.
    • The style sheets for dark mode should remain easy to maintain and adaptable.
    • I think, the most elegant way for the implementation would be CSS variables whose browser support is not yet the best and also Bootstrap (as far as I know) are still used rather sparingly.
    • Since many developers (with different code habits) work on Docsy, the color definitions are in many different files (partly also in CSS and not just SCSS files). Which is why, a complete dark version of the generated CSS file would have to be created and still remnants of light colors would probably be retained somewhere.

That's why I would wait to develop a dark mode with my own stylesheet until Docsy switches to Bottstrap 5 and then use the approach from https://github.com/vinorodrigues/bootstrap-dark-5. If you can live with the above dark mode hack (GoogleContainerTools/skaffold@ccdffd1), you can use my PR #563 as a template.

Any thoughts / suggestions / ideas?

@narrenfrei
Copy link
Contributor

Is there any more need or interest for the PR #563?
If not, I will close it.

@narrenfrei
Copy link
Contributor

As nobody showed further interest, I'll close this PR #563.

@bwplotka
Copy link

Thanks a lot for your attempt @narrenfrei - I would definitely love dark mode, but it sounds like separate scss might be a better way 🤔

@amirootyet
Copy link

sounds like for properly implementing the dark mode, Docsy would first need to be upgraded to Bootstrap 5? I'm interested in the dark mode and before I go spinning off my own, I wanted to see if this is already in the works!

@abitrolly
Copy link

jenkins-x/jx-docs#3053 is how it is done on https://jenkins-x.io/

@abitrolly
Copy link

Based on jx experience, dark mode is not trivial, because it requires processing images to be compatible with the dark mode. I could not find a way to make them dark mode friendly with just plain CSS. Some guidelines would be nice. And I could not find a way of switching images with CSS, so it will probably require a different way of generating HTML.


So far it is the most voted issue in this repo. Would be nice if Google folks (@LisaFC, @chalin ?) could escalate this internally to give it a proper frontend engineering.

@lawxen
Copy link

lawxen commented Mar 31, 2023

After reading a little more into the dark mode topic, I'm afraid that a "useful implementation" will require a little more work (and discussion). A few thoughts from me:

  • The dark mode hack from GoogleContainerTools/skaffold@ccdffd1 can be installed quite quickly (see WIP: try darkmode hack #331 #563).

  • But if you want a dark mode with individually definable stylesheet, you would need some modifications to the previous structure of Docsy.

    • Docsy uses Bootstrap and therefore SCSS. The move to Bootstrap v5 is likely to be around the corner. -> Maybe wait for the change?
    • A dark mode should remain optional for Docsy users and the visitors of Docsy sites.
    • The style sheets for dark mode should remain easy to maintain and adaptable.
    • I think, the most elegant way for the implementation would be CSS variables whose browser support is not yet the best and also Bootstrap (as far as I know) are still used rather sparingly.
    • Since many developers (with different code habits) work on Docsy, the color definitions are in many different files (partly also in CSS and not just SCSS files). Which is why, a complete dark version of the generated CSS file would have to be created and still remnants of light colors would probably be retained somewhere.

That's why I would wait to develop a dark mode with my own stylesheet until Docsy switches to Bottstrap 5 and then use the approach from https://github.com/vinorodrigues/bootstrap-dark-5. If you can live with the above dark mode hack (GoogleContainerTools/skaffold@ccdffd1), you can use my PR #563 as a template.

Any thoughts / suggestions / ideas?

The latest docsy has been moved to bootstrap5, so can we use https://github.com/vinorodrigues/bootstrap-dark-5 now?

@chalin chalin added this to the 23Q3 milestone May 31, 2023
@deining deining added the design/style Front-end site design / styling label Jun 12, 2023
@chalin chalin modified the milestones: 23Q3, 23Q4 Jul 27, 2023
@jmichelgarcia
Copy link

👀

@chalin
Copy link
Collaborator

chalin commented Feb 7, 2024

Direct link to the BS page: https://getbootstrap.com/docs/5.3/customize/color-modes/#dark-mode

@chalin chalin changed the title Create a darkmode Support dark mode Mar 14, 2024
@chalin chalin mentioned this issue Mar 28, 2024
21 tasks
@chalin chalin added enhancement New feature or request e2-days labels Mar 30, 2024
@chalin chalin modified the milestones: 24Q1, 24Q2 Apr 2, 2024
aykevl added a commit to tinygo-org/tinygo-site that referenced this issue May 1, 2024
I'm doing this to stay up to date, and because I'm looking forward to
dark mode support in Docsy v0.10 (which according to
google/docsy#331 seems to be almost finished).

There are a few small visual changes, which I think are generally an
improvement:

  - Buttons are more square.
  - Links now have underscores, for accessibility reasons.
  - The ellipsis after "Read more..." on the home page is gone.

I did a quick browse through the website and couldn't find any breaking
changes.
@chalin
Copy link
Collaborator

chalin commented May 1, 2024

With #1981, I consider this implemented.

@chalin chalin closed this as completed May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design/style Front-end site design / styling e2-days enhancement New feature or request
Projects
None yet
Development

No branches or pull requests