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

Adding colors to dark theme for #2376 #2377

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
37 changes: 37 additions & 0 deletions src/css/portal-themes/dark.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
:root {
/* COLOURS */
--portal-blue-1: #ECF8FC;
--portal-blue-2: #CCF0FC;
--portal-blue-3: #99E1FA;
--portal-blue-4: #14c8ff;
--portal-blue-5: #00A9E4;
--portal-blue-6: #0087B5;
--portal-blue-7: #136682;

--portal-grey-1: #F8F9FA;
--portal-grey-2: #F1F3F4;
--portal-grey-3: #E8EAED;
--portal-grey-4: #BDC1C6;
--portal-grey-5: #80868B;
--portal-grey-6: #5F6368;
--portal-grey-7: #3C4043;
--portal-grey-8: #202124;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi Ian! This color palette is specific to the light theme so I'd recommend not directly copying over the config from light.css. The issue described in the ticket is about layer category color, which is defined here. I think the fix should be two stepped:

  1. Set --portal-col-text-highlight in dark.css to a legible color in the context of dark theme. This variable is used by other components as well (.layer-details__label, .viewfinder-prediction__content) so you'll see a color change at those places. This fix will also only apply to portals that explicitly use the dark theme. Map in the main repo, for example, will still use the fallback color of --map-col-highlight__deprecate.

  2. To address the issue for non-theme users, we can replace the fallback color in map-view.css with the same color from # 1.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @yvonnesjy! Thank you, I appreciate the heads up and the detailed explanation. I just assumed that copying the blues and greys definitions to dark.css and changing the specific variable references would be sufficient to make the dark theme more legible without causing problems elsewhere. I can change to define them directly.


--portal-col-buttons-bkg: white;
--portal-col-buttons-bkg-hover: var(--portal-blue-2);
--portal-col-buttons-bkg-highlight: var(--portal-blue-5);
--portal-col-buttons-bkg-muted: var(--portal-grey-1);
--portal-col-buttons-bkg-white-content-contrast: var(--portal-grey-5);
--portal-col-buttons-text: var(--portal-blue-6);
--portal-col-buttons-text-highlight: white;
--portal-col-buttons-icon: var(--portal-blue-6);
--portal-col-buttons-icon-highlight: var(--portal-blue-2);
--portal-col-buttons-icon-muted: var(--portal-grey-6);
--portal-col-utility-buttons: var(--portal-grey-6);

--portal-col-bkg: #111827;
--portal-col-bkg-lighter: #1F2937;
--portal-col-bkg-active: #374151;
Expand All @@ -8,6 +37,14 @@
--portal-col-text: #F9FAFB;
--portal-col-highlight: #269fb9;
--portal-col-highlight-subtle: #0c4e66;

--portal-col-text-body: var(--portal-grey-3);
--portal-col-text-highlight: var(--portal-blue-4);
--portal-col-text-title: var(--portal-blue-6);
--portal-col-text-label: var(--portal-grey-4);
--portal-col-text-detail: var(--portal-grey-5);
--portal-col-text-muted: var(--portal-grey-3);

/* SHADOWS */
--map-shadow-md: 0 1px 9px -1px rgba(0, 0, 0, 0.2), 0 1px 2px 0px rgba(0, 0, 0, 0.5);
/* Colors used in the 'loading-metrics.html' template, on Metrics page */
Expand Down