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

Allow admins to set brand color #10097

Merged
merged 8 commits into from
Sep 1, 2020
Merged

Conversation

benhalpern
Copy link
Contributor

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

This feature allows admins to set their own main brand color....

Screen Shot 2020-08-30 at 5 00 14 PM

Screen Shot 2020-08-30 at 4 59 54 PM

Screen Shot 2020-08-30 at 4 58 44 PM

This color needs to contrast properly with white, so I added the wcag contrast gem. I think this is a good gem to add, because we can start using this elsewhere, like user profile colors, tags, etc. Currently we let users set non-contrasting colors and basically just moderate it. This will help us ensure a minimum of 4.5:1 contrast for readability and accessibility for all.

The gem has not recently been updates, but it is a fairly simple low-bloat utility gem. The gem author is active and I feel like we can be comfortable that we could merge a change if we needed to.

Also added some basic validations in the controller. I figured we can start adding some validations in this area and extract these to a better place in a future refactor once we establish more of these.

@benhalpern benhalpern requested review from a team August 30, 2020 21:12
@benhalpern benhalpern requested a review from a team as a code owner August 30, 2020 21:12
@benhalpern benhalpern requested review from jacobherrington and juliannatetreault and removed request for a team August 30, 2020 21:12
@pr-triage pr-triage bot added the PR: unreviewed bot applied label for PR's with no review label Aug 30, 2020
Copy link
Contributor

@ludwiczakpawel ludwiczakpawel left a comment

Choose a reason for hiding this comment

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

Left few comments, not blockers though.

app/views/shell/_top.html.erb Show resolved Hide resolved
Copy link
Contributor

@lisasy lisasy left a comment

Choose a reason for hiding this comment

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

LGTM!

@pr-triage pr-triage bot added PR: partially-approved bot applied label for PR's where a single reviewer approves changes and removed PR: unreviewed bot applied label for PR's with no review labels Aug 31, 2020
@@ -0,0 +1,11 @@
module Color
Copy link
Contributor

Choose a reason for hiding this comment

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

Usually, we tend to use plurals for service name spaces, but don't let that stop this PR, I can change it during cooldown and potentially move the HecComparer into the Colors namespace too, keeping related things together and all.

Copy link
Contributor

@citizen428 citizen428 left a comment

Choose a reason for hiding this comment

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

Nice, thanks for making the changes @benhalpern 😃

@ludwiczakpawel ludwiczakpawel merged commit 7b5bc89 into master Sep 1, 2020
@ludwiczakpawel ludwiczakpawel deleted the ben/add-primary-brand-color branch September 1, 2020 09:16
@pr-triage pr-triage bot added PR: merged bot applied label for PR's that are merged and removed PR: partially-approved bot applied label for PR's where a single reviewer approves changes labels Sep 1, 2020
citizen428 pushed a commit that referenced this pull request Sep 3, 2020
* Allow admins to set brand color

* Remove extra line

* Fix linting

* Update app/controllers/admin/configs_controller.rb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Move wcag compare to own class

* Remove unnecessary spacing

Co-authored-by: Michael Kohl <citizen428@dev.to>
@ludwiczakpawel ludwiczakpawel mentioned this pull request Sep 21, 2020
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: merged bot applied label for PR's that are merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants