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

GH-2506 Adapt PUI to user preferred color scheme #2530

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

brianzelip
Copy link
Collaborator

@brianzelip brianzelip commented Nov 25, 2021

This PR adds a dark mode theme to the PUI for users who set a dark mode preference at their browser or OS level.

Main changes

  • PUI now adapts to user preference for dark/light mode at their operating system or browser level settings
  • Refactored all Sass color variables (that aren't Bootstrap Sass overrides in PUI variables.scss) into CSS custom properties
  • Added prefers-color-scheme media query to colors.scss which defines dark theme primitives, base, and specific UI colors
    • Color primitives are scale-based and are only directly used from within colors.scss
    • Other files reference dark theme base and specific UI variables for easy institutional rebranding
  • Added *-dark.scss files for dark mode specific styles (aspace-dark.scss, infinite-scroll-dark.scss, etc)
  • Added Bootstrap-Dark v4.6.1 and customized it to meet AS needs, including:
    • Removed CSS that doesn't apply
    • Disabled and added prefixes to their custom properties to avoid name conflicts if we ever need to extend Bootstrap-Dark

OS_pref_change


home page


search results


collection overview


collection organization


collection container inventory


citation modal


request modal


request modal_required


flash info


flash danger


flash success


flash warning

Related JIRA Ticket or GitHub Issue

#2506

How Has This Been Tested?

Cross-browser visual inspection.

Screenshots (if appropriate):

See above.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have read the CONTRIBUTING document.
  • I have authority to submit this code.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@brianzelip brianzelip added the pui label Dec 1, 2021
@brianzelip brianzelip force-pushed the GH-2506-public-dark-mode branch 2 times, most recently from 6d1b93f to c00e3ff Compare December 31, 2021 13:41
@brianzelip brianzelip marked this pull request as ready for review December 31, 2021 13:42
@brianzelip
Copy link
Collaborator Author

@quoideneuf This is now ready for review!

@brianzelip brianzelip force-pushed the GH-2506-public-dark-mode branch 5 times, most recently from 3144b2b to a39db0d Compare January 2, 2022 21:56
Refactor all Sass color vars as CSS vars,
Add *-dark.scss file counterparts,
Add Bootstrap-Dark v4.6.1 and customize it,
@quoideneuf quoideneuf removed their assignment Aug 2, 2022
@cdibella cdibella added this to the 3.4.0 milestone Jan 30, 2023
@brianzelip
Copy link
Collaborator Author

This PR will be relevant to future work. Converting this to DRAFT status for sake of cleaning up PRs summer 2023.

@brianzelip brianzelip marked this pull request as draft August 11, 2023 14:58
@cdibella cdibella removed this from the 3.4.0 milestone Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants