Skip to content

Dark mode #12

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

Merged
merged 42 commits into from
Nov 30, 2021
Merged

Dark mode #12

merged 42 commits into from
Nov 30, 2021

Conversation

thisIsTheFoxe
Copy link
Member

@thisIsTheFoxe thisIsTheFoxe commented Jul 10, 2021

Add a dark mode theme.

  • Update apl-colors according to Apple HIG
  • Add ColorPicker to page footer
  • Load svgs from file, using @nuxtjs/svg
    • modify svgs so that they can be adjusted using css on a container element
    • add AppStore dark svg
  • Use CSS vars to dynamically change color mode
  • make sure it actually looks good
  • properly rename colors, white: #000000 might be a bit confusing 😅

@thisIsTheFoxe thisIsTheFoxe changed the base branch from main to develop July 10, 2021 10:01
@thisIsTheFoxe
Copy link
Member Author

thisIsTheFoxe commented Jul 11, 2021

Uhmmmmmm.... I have some.. questions..????
It seems to have something to do with being disabled.
Cuz, surely (110, 110, 110) should in no way be that much darker than (109, 109, 109) and unless my eyes and color meter are broken that's not the case.. also, it seems like that's some sort of braking point.. wired things going on..
CodePen demo

Safari screenshot of: WTF IS HAPPENING?!??!!

@moritzsternemann
Copy link
Member

Setting the -webkit-text-fill-color seems to do the trick. Need to check if placeholder colors still work as expected though. See updated CodePen and the discussions on Stackoverflow 🙂

@@ -1,10 +1,24 @@
<template lang="pug">
.profile-button(:class="{ 'nuxt-link-active': linkActive }")
.auth-pending(v-if="isAuthPending"): loading-spinner
//- TODO: factor svgs out somehow! make it easier to use and change coclors dynamically
Copy link
Member

Choose a reason for hiding this comment

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

I think we should be able to use the vue-svg-loader option of @nuxtjs/svg to get the desired behavior.

Copy link
Member Author

@thisIsTheFoxe thisIsTheFoxe Jul 12, 2021

Choose a reason for hiding this comment

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

Sounds great.. but I just couldn't get it to work. Looks like once it's loaded it doesn't apply css anymore.. :/

Copy link
Member

Choose a reason for hiding this comment

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

Maybe this is caused by scoped styling and the loaded SVG not getting the correct data- attribute. I can try to get it working

Copy link
Member Author

@thisIsTheFoxe thisIsTheFoxe Jul 13, 2021

Choose a reason for hiding this comment

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

We can just change the svg's content e.g. using currentColor and making the sign-in-out scale to its container element.
Another thing is that we could extract them into their own component that just has the raw svg in it's template .-.

@thisIsTheFoxe thisIsTheFoxe marked this pull request as ready for review July 12, 2021 07:37
Copy link
Member Author

@thisIsTheFoxe thisIsTheFoxe left a comment

Choose a reason for hiding this comment

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

sorry for the -fs can't quite get myself to make a new commit for every minor fix that I notice.. 😅

import { Vue } from "nuxt-property-decorator";

export default class ColorModePicker extends Vue {
colorSchemes: { label: string; value: string }[] = [
Copy link
Member Author

Choose a reason for hiding this comment

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

not sure of the correct order..

Copy link
Member

Choose a reason for hiding this comment

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

I would say so 😁 at least it's consistent with similar view models (for example in InputRadioGroup.vue).

Copy link
Member Author

Choose a reason for hiding this comment

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

I actually meant the order of the colors bellow lol GitHub comments are hard :D

Copy link
Member

@moritzsternemann moritzsternemann left a comment

Choose a reason for hiding this comment

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

I finally got around to take a thorough look. Overall dark-mode already looks amazing and I'm happy to discuss everything mentioned below!

Here are the things I noticed:

  • The apl- colors where initially taken from the WWDC 2016 page, so don't really originate from the Apple HIG. I think since we only use the background color anyways, we should get rid of all of them and replace the background colors with our own semantic versions.
  • Additionally, maybe we can improve color naming a bit.. Removing all the sch- prefixes and use more semantic names in general. What I came up with for the iOS app is for example brandPrimary and brandSecondary for the different shades of purple. At the same time, it would be great to get rid of all the dynamic color adjustments (lightColor, ...) and just have predefined colors for all these cases.
  • The dark mode colors don't pop as much as their light mode counterparts. In the app, we use rgb(165, 153, 255) as the dark mode version of purple for example. While it might be a bit too much, I think in general the colors should be a little more vibrant in dark mode.
  • I don't really like the white shadows in dark mode. Instead we should use the concept of elevation and make items on top of others (secondary nav bar, base-sections, profile picture borders, ...) a lighter shade of gray.
  • Maybe we can improve the footer layout with the ColorModePicker a bit. I'm thinking of something more like developer.apple.com. Imprint, Privacy Policy, and Stats links on the left, and the color mode picker on the right. What do you think?
  • The rounded Edit Profile button has a different fill color on hover than the border color. I think they should be the same.
  • The + icon in the InputImageMultiple component is white. I can create an SVG instead, so we can color it like the user and sign-in-out icons. Same with the upload icon in the InputImage component.

import { Vue } from "nuxt-property-decorator";

export default class ColorModePicker extends Vue {
colorSchemes: { label: string; value: string }[] = [
Copy link
Member

Choose a reason for hiding this comment

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

I would say so 😁 at least it's consistent with similar view models (for example in InputRadioGroup.vue).

@thisIsTheFoxe
Copy link
Member Author

thisIsTheFoxe commented Jul 14, 2021

hey, thanks for the review! ^^
Most sounds good to me.. just some other points

Removing all the sch- prefixes and use more semantic names in general. What I came up with for the iOS app is for example brandPrimary and brandSecondary.

tbh, I actually kinda like the sch- prefixes ^^ makes it easy to distinguish brand from generic colors. And when working with strings I thought it might be easier to simplify "primary", "secondary", etc. with just the numbers.

it would be great to get rid of all the dynamic color adjustments (lightColor, ...) and just have predefined colors for all these cases

well, I found it to be really useful from time to time to have such simple modify functions. Especially with the already dynamic fg / bg colors. Especially, again, when you get into naming background-color-transparency-50, background-color-lighter-06, etc.

  • Maybe we can improve the footer layout with the ColorModePicker a bit. [...] What do you think?

Initially liked it. After implementing it (at least how I did it) it doesn't really feel that good. May both in the middle with a bit of padding?

  • The rounded Edit Profile button has a different fill color on hover than the border color. I think they should be the same.

Not quite sure what you mean with that.. 🤔

  • The + icon in the InputImageMultiple component is white. I can create an SVG instead, so we can color it like the user and sign-in-out icons. Same with the upload icon in the InputImage component.

I mean as you say, they're already white and work great in dark. And in light it's good as it were. Up to you.. ^^

@moritzsternemann moritzsternemann changed the base branch from develop to main November 30, 2021 15:33
# Conflicts:
#	components/inputs/InputDate.vue
#	package-lock.json
#	package.json
@moritzsternemann moritzsternemann changed the base branch from main to develop November 30, 2021 15:50
@moritzsternemann moritzsternemann merged commit 83c9568 into develop Nov 30, 2021
@moritzsternemann moritzsternemann deleted the featrue/dark-mode branch November 30, 2021 15:57
moritzsternemann added a commit that referenced this pull request Nov 30, 2021
* implemented dark-mode functionality

* darkMode: basic color invert + ajust apl-colors + fix transparent icons + add dark mapKit

* adjust some colors + make svgs dynamically colorable

* give colors more sematic names + adjust disabled base-button

* fix `disabled` textfield color for webkit

* load svg from file, with inherited css coloring

* actually, just fix svg by 'inheretting' css from container

* last fixes + added comments

* Linting + make colors stand out more + more renaming + adjust footer + use border instead of shadow in dark

* Always use dark App Store badge

* Replace background colors with semantic versions from HIG

* Adjust nav, color mode picker, and footer layout

* introduce more separator, label and fill colors

* Remove unused classes

* Adjust Copyable and BaseButton styles with new colors

* Wrap social icons on profile

* Fix cta position in forms

* Install using npm v8, add module augmentations for @nuxtjs/color-mode

* Install node-sass v6

* Adjust design of status badges of ProfileSubmission

* Replace sch-label variables with HIG semantic ones

* Replace $sch-accent3

* Replace $sch-accent colors

* Replace $form-border-color

* Reduce color definition complexity by predefining commonly used adaptions

* Fix btn-ctas in BaseForms

* Replace node-sass with recommended Dart Sass

Finally getting rid of the ugly temp-variables for the form-colors mixin

* Use tertiary label color in title of text fields

* Remove secondary sch colors, replace some with HIG colors

* Surpress Sass warning for color name

* Enable usage of Sass modules

* Fix division warning

* Introduce sch-purple-quarternary for age

* Replace transparentize and darken with new color.scale function

* Pointer cursor for ColorModePicker

* The upload and add icons in image inputs

* Move color-mode to runtime dependencies

Remove unused configuration, using default options

* fix: Edit profile when birthday changed (#14)

* Replace vue-flatpickr with native date input

Now we can always handle dates as numeric timestamps in UTC

Co-authored-by: Moritz Sternemann <[email protected]>

* chore(release): 3.18.4

* Increase contrast for upload- and plus-icon

* Adjust color of header and profile dropdown

Co-authored-by: Moritz Sternemann <[email protected]>
moritzsternemann added a commit that referenced this pull request May 7, 2022
commit 74e7638
Author: Moritz Sternemann <[email protected]>
Date:   Fri May 6 15:54:14 2022 +0200

    chore(release): 3.19.0-pre.13

commit a11a246
Author: Moritz Sternemann <[email protected]>
Date:   Fri May 6 15:54:09 2022 +0200

    fix: Sentry attach commits automatically

commit 44c4521
Author: Moritz Sternemann <[email protected]>
Date:   Fri May 6 15:45:56 2022 +0200

    chore(release): 3.19.0-pre.12

commit 6a38798
Author: Moritz Sternemann <[email protected]>
Date:   Fri May 6 15:45:49 2022 +0200

    ci: Ignore missing previous commit when publishing to sentry

commit 20f5d94
Author: Moritz Sternemann <[email protected]>
Date:   Fri May 6 11:55:41 2022 +0200

    chore(release): 3.19.0-pre.11

commit d088c56
Author: Moritz Sternemann <[email protected]>
Date:   Fri May 6 11:55:26 2022 +0200

    feat: Only show years that have isHidden == 0

commit 11b78e8
Author: Moritz Sternemann <[email protected]>
Date:   Thu May 5 11:50:34 2022 +0200

    chore(release): 3.19.0-pre.10

commit 87cc8f5
Author: Moritz Sternemann <[email protected]>
Date:   Thu May 5 11:50:26 2022 +0200

    fix: Thumbnail video playbutton on hover

commit eef2c56
Author: Moritz Sternemann <[email protected]>
Date:   Mon Apr 18 17:04:26 2022 +0200

    chore(release): 3.19.0-pre.9

commit cab1446
Author: Moritz Sternemann <[email protected]>
Date:   Mon Apr 18 17:04:17 2022 +0200

    feat: new submission social links

commit 739296e
Author: Moritz Sternemann <[email protected]>
Date:   Wed Apr 6 14:59:13 2022 +0200

    fix: Proper responsive screenshot columns

commit f14479e
Author: Moritz Sternemann <[email protected]>
Date:   Sat Mar 26 22:05:59 2022 +0100

    chore(release): 3.19.0-pre.8

commit 08e1fb2
Author: Moritz Sternemann <[email protected]>
Date:   Sat Mar 26 22:05:42 2022 +0100

    feat: New screenshot thumbnail approach for submissions

commit 5ea67c7
Author: Moritz Sternemann <[email protected]>
Date:   Sun Mar 20 22:01:19 2022 +0100

    chore(release): 3.19.0-pre.7

commit 0e23f11
Author: Moritz Sternemann <[email protected]>
Date:   Sun Mar 20 20:32:35 2022 +0100

    chore: Change privacy wording

commit 909fb42
Author: Moritz Sternemann <[email protected]>
Date:   Sat Mar 19 23:34:28 2022 +0100

    chore: Use VeeValidate standard changed property for screenshots

commit 8ce5ce8
Author: Moritz Sternemann <[email protected]>
Date:   Sat Mar 19 23:34:08 2022 +0100

    chore: Use more prominent color for social hover

commit b7a3779
Author: Moritz Sternemann <[email protected]>
Date:   Sat Mar 19 23:33:31 2022 +0100

    feat: Streamline Copyable design

commit 6cd3788
Author: Moritz Sternemann <[email protected]>
Date:   Sat Mar 19 22:40:42 2022 +0100

    feat: Hover state for social links

commit c9da6b2
Author: Moritz Sternemann <[email protected]>
Date:   Thu Mar 10 23:55:45 2022 +0100

    fix: Align social icon weights

commit 1a0d696
Author: Moritz Sternemann <[email protected]>
Date:   Thu Mar 10 22:58:43 2022 +0100

    chore(release): 3.19.0-pre.6

commit 21b04be
Author: Moritz Sternemann <[email protected]>
Date:   Thu Mar 10 22:58:31 2022 +0100

    fix: check vimeo videoId existance

commit 61e5e62
Author: Moritz Sternemann <[email protected]>
Date:   Mon Mar 7 00:04:10 2022 +0100

    chore(release): 3.19.0-pre.5

commit 1186bfa
Author: Moritz Sternemann <[email protected]>
Date:   Mon Mar 7 00:04:02 2022 +0100

    chore: Replace play icon with SF Symbol

commit 92f58e0
Author: Moritz Sternemann <[email protected]>
Date:   Mon Mar 7 00:03:32 2022 +0100

    feat: Add link icon to link thumbnails

commit a2190a9
Author: Moritz Sternemann <[email protected]>
Date:   Sun Mar 6 17:12:11 2022 +0100

    chore(release): 3.19.0-pre.4

commit 209b948
Author: Moritz Sternemann <[email protected]>
Date:   Sun Mar 6 17:12:05 2022 +0100

    chore: Add video domains to CSP

commit 7ce3721
Author: Moritz Sternemann <[email protected]>
Date:   Sun Mar 6 16:51:44 2022 +0100

    chore(release): 3.19.0-pre.3

commit 7689416
Author: Moritz Sternemann <[email protected]>
Date:   Sun Mar 6 16:45:21 2022 +0100

    feat: Always include year in profile URLs

commit a9bacbc
Author: Moritz Sternemann <[email protected]>
Date:   Sun Mar 6 16:00:45 2022 +0100

    fix: Remove log from Vimeo thumbnail loading

commit d2306af
Author: Moritz Sternemann <[email protected]>
Date:   Sun Mar 6 15:55:37 2022 +0100

    feat: Better title texts for social icons

commit 8da71d2
Author: Moritz Sternemann <[email protected]>
Date:   Sun Mar 6 15:49:01 2022 +0100

    feat: Display AppStore and GitHub links

commit cbde6f2
Author: Moritz Sternemann <[email protected]>
Date:   Sun Jan 16 15:16:34 2022 +0100

    fix: Adjust play icon spacing a bit

commit e086549
Author: Moritz Sternemann <[email protected]>
Date:   Sat Jan 15 18:14:40 2022 +0100

    feat: Display submission videos inline with screenshots

    Supports YouTube and Vimeo for now

commit 9efd353
Author: Moritz Sternemann <[email protected]>
Date:   Sat Jan 15 00:32:58 2022 +0100

    feat: Replace swiper with lightbox

commit 6d6458f
Author: Moritz Sternemann <[email protected]>
Date:   Fri Jan 14 11:52:17 2022 +0100

    fix: Add missing space in scholarships blurb

commit 4704a2f
Author: Moritz Sternemann <[email protected]>
Date:   Fri Jan 14 11:42:40 2022 +0100

    chore(release): 3.19.0-pre.2

commit 433e44d
Author: Moritz Sternemann <[email protected]>
Date:   Fri Jan 14 11:40:50 2022 +0100

    fix: Disable hover for disable text fields

commit e57e21e
Author: Moritz Sternemann <[email protected]>
Date:   Fri Jan 14 11:31:39 2022 +0100

    refactor: Update mobile menu approach to fix some bugs

commit ed0f53c
Author: Moritz Sternemann <[email protected]>
Date:   Thu Jan 13 23:21:45 2022 +0100

    feat: Use css colors for progress indicator

commit bbb3636
Author: Moritz Sternemann <[email protected]>
Date:   Thu Jan 13 23:14:45 2022 +0100

    feat: Use CSS colors for marks in maps

commit 90b4409
Author: Moritz Sternemann <[email protected]>
Date:   Thu Jan 13 23:14:15 2022 +0100

    fix: Load initial values from props in MKMarkerAnnotation

commit d6d45f8
Author: Moritz Sternemann <[email protected]>
Date:   Thu Jan 13 22:32:24 2022 +0100

    feat: Use minimal favicon

commit 4d67fc7
Author: Moritz Sternemann <[email protected]>
Date:   Thu Jan 13 21:12:09 2022 +0100

    fix: Load only approved years on Scholar profile

commit 407e32e
Author: Moritz Sternemann <[email protected]>
Date:   Thu Jan 13 22:32:50 2022 +0100

    feat: Use SF social icons

commit be9af15
Author: Moritz Sternemann <[email protected]>
Date:   Thu Jan 13 20:59:20 2022 +0100

    feat: Improve sholarships blurb for one-time winners

commit 274f247
Author: Moritz Sternemann <[email protected]>
Date:   Fri Jan 7 19:37:55 2022 +0100

    fix: Add padding on imprint and privacy policy pages

commit 013d072
Author: Moritz Sternemann <[email protected]>
Date:   Fri Jan 7 19:29:09 2022 +0100

    fix: Use theme-color meta tags

commit c72a349
Author: Moritz Sternemann <[email protected]>
Date:   Fri Jan 7 19:22:23 2022 +0100

    fix: Footer scrolling and color picker layout on mobile

commit 17c29c9
Author: Moritz Sternemann <[email protected]>
Date:   Fri Jan 7 17:41:05 2022 +0100

    fix: Improve sch-purple-secondary for dark mode

commit 742ac99
Author: Moritz Sternemann <[email protected]>
Date:   Fri Jan 7 17:38:43 2022 +0100

    fix: Better dark mode brand colors

commit d69b715
Author: Moritz Sternemann <[email protected]>
Date:   Tue Nov 30 17:03:46 2021 +0100

    chore(release): 3.19.0-pre.1

commit 71cabc5
Author: Moritz Sternemann <[email protected]>
Date:   Tue Nov 30 16:58:34 2021 +0100

    chore(release): 3.19.0-pre.0

commit 0047a78
Author: Henry <[email protected]>
Date:   Tue Nov 30 16:57:50 2021 +0100

    feat: Dark Mode (#12)

    * implemented dark-mode functionality

    * darkMode: basic color invert + ajust apl-colors + fix transparent icons + add dark mapKit

    * adjust some colors + make svgs dynamically colorable

    * give colors more sematic names + adjust disabled base-button

    * fix `disabled` textfield color for webkit

    * load svg from file, with inherited css coloring

    * actually, just fix svg by 'inheretting' css from container

    * last fixes + added comments

    * Linting + make colors stand out more + more renaming + adjust footer + use border instead of shadow in dark

    * Always use dark App Store badge

    * Replace background colors with semantic versions from HIG

    * Adjust nav, color mode picker, and footer layout

    * introduce more separator, label and fill colors

    * Remove unused classes

    * Adjust Copyable and BaseButton styles with new colors

    * Wrap social icons on profile

    * Fix cta position in forms

    * Install using npm v8, add module augmentations for @nuxtjs/color-mode

    * Install node-sass v6

    * Adjust design of status badges of ProfileSubmission

    * Replace sch-label variables with HIG semantic ones

    * Replace $sch-accent3

    * Replace $sch-accent colors

    * Replace $form-border-color

    * Reduce color definition complexity by predefining commonly used adaptions

    * Fix btn-ctas in BaseForms

    * Replace node-sass with recommended Dart Sass

    Finally getting rid of the ugly temp-variables for the form-colors mixin

    * Use tertiary label color in title of text fields

    * Remove secondary sch colors, replace some with HIG colors

    * Surpress Sass warning for color name

    * Enable usage of Sass modules

    * Fix division warning

    * Introduce sch-purple-quarternary for age

    * Replace transparentize and darken with new color.scale function

    * Pointer cursor for ColorModePicker

    * The upload and add icons in image inputs

    * Move color-mode to runtime dependencies

    Remove unused configuration, using default options

    * fix: Edit profile when birthday changed (#14)

    * Replace vue-flatpickr with native date input

    Now we can always handle dates as numeric timestamps in UTC

    Co-authored-by: Moritz Sternemann <[email protected]>

    * chore(release): 3.18.4

    * Increase contrast for upload- and plus-icon

    * Adjust color of header and profile dropdown

    Co-authored-by: Moritz Sternemann <[email protected]>
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.

2 participants