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

Add support for dark mode #28

Merged
merged 27 commits into from
Mar 6, 2024
Merged

Add support for dark mode #28

merged 27 commits into from
Mar 6, 2024

Conversation

ffigiel
Copy link
Contributor

@ffigiel ffigiel commented Jan 30, 2024

Closes #16

This PR adds a dark mode based on the current color palette.

@ffigiel
Copy link
Contributor Author

ffigiel commented Jan 30, 2024

For now the colorscheme is selected via the prefers-color-scheme media query.

Here are some screenshots:

Dark mode

local_dark

Light mode on this PR (for reference, it shouldn't be different from prod)

local_light

Light mode in prod

prod_light

priv/static/styles.css Outdated Show resolved Hide resolved
Copy link
Member

@lpil lpil left a comment

Choose a reason for hiding this comment

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

Thank you! We'll need a switch also. Where would it go?

@ffigiel
Copy link
Contributor Author

ffigiel commented Jan 30, 2024

Thank you! We'll need a switch also. Where would it go?

How about one of these places?
image

@ffigiel
Copy link
Contributor Author

ffigiel commented Jan 30, 2024

do you want a "light/dark" or a "light/dark/auto" selector?

edit: I went with the first one, with light as default

@ffigiel

This comment was marked as outdated.

@ffigiel ffigiel requested a review from lpil January 31, 2024 01:02
@ffigiel
Copy link
Contributor Author

ffigiel commented Feb 5, 2024

Would you prefer if I carried over the color palette from the docs' template and used that instead?

More generally, do you think it would make sense to develop a basic "css library" of colors, fonts and sizes that are already in use to aid in keeping things consistent? I'm thinking of having a base css file to be used for things such as packages website, the tour, docs, website, etc

@ffigiel
Copy link
Contributor Author

ffigiel commented Feb 11, 2024

Would you prefer if I carried over the color palette from the docs' template and used that instead?

More generally, do you think it would make sense to develop a basic "css library" of colors, fonts and sizes that are already in use to aid in keeping things consistent? I'm thinking of having a base css file to be used for things such as packages website, the tour, docs, website, etc

We've decided on discord to go with that

@ffigiel ffigiel marked this pull request as draft February 11, 2024 14:35
@ffigiel

This comment was marked as outdated.

@ffigiel ffigiel marked this pull request as ready for review February 11, 2024 17:17
Comment on lines 20 to 26
--col-magenta-800: #584355;
--col-magenta-300: #ffaff3;
--col-cyan-200: #a6f0fc;
--col-green-200: #c8ffa7;
--col-yellow-300: #ffd596;
--col-orange-400: #ff9d35;
--col-red-400: #ff6262;
Copy link
Member

Choose a reason for hiding this comment

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

What happened to the colour names? What do these numbers mean?

Copy link
Contributor Author

@ffigiel ffigiel Feb 15, 2024

Choose a reason for hiding this comment

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

This file comes from this branding PR gleam-lang/branding#12

The original color names weren't well received*, so instead I chose to do something similar to what tailwind does where the name specifies the general hue and intensity.

You can think of the numbers as of font weights, the larger numbers mean bolder font -> darker color.

Generally these names are considered "private" to the common.css file and the "semantic" names that appear later in the file should be used

*Hayleigh pointed out they don't explain well enough what the color looks like, and you didn't like how some names referenced countries/cultures

Copy link
Member

@lpil lpil Feb 19, 2024

Choose a reason for hiding this comment

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

The original color names weren't well received

We want to keep the named colours for sure. Any shades of them can use numbered variations of them 👍

Having names makes it clearer what colours they are (as opposed to just "yellow", which is very unclear) and are more fun and memorable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated, is this what you had in mind?

@ffigiel ffigiel marked this pull request as draft February 15, 2024 21:03
@ffigiel
Copy link
Contributor Author

ffigiel commented Feb 15, 2024

The styles got a bit messy after this conflict, I'll clean it up
edit: done

@ffigiel ffigiel marked this pull request as ready for review February 15, 2024 21:18
priv/static/common.css Outdated Show resolved Hide resolved
priv/static/common.css Outdated Show resolved Hide resolved
@ffigiel
Copy link
Contributor Author

ffigiel commented Mar 4, 2024

New screenshots

localhost_3000_ (1)
localhost_3000_

Copy link
Member

@lpil lpil left a comment

Choose a reason for hiding this comment

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

Thank you!!

@lpil lpil merged commit 47abf37 into gleam-lang:main Mar 6, 2024
1 check 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.

Add dark mode variant
2 participants