loading...
Cover image for Forem visual customization

Forem visual customization

ben profile image Ben Halpern ・1 min read

This PR may land shortly...

Allow admins to set brand color #10097

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

  • [ ] Refactor
  • [x] 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.

Allowing admins to declare their primary color which is then used everywhere we currently use the blue-purple color on buttons etc.

As we define areas of customization we want to ensure we give people enough features while also not letting people make too many mistakes or ruin the UX of users by introducing too much radical variation....

But I'm wondering of other standard ways we can allow certian additional variation along these lines.... Could forems define a color other than white for their header bar? Or a different footer color or other accent?

Could forems default to a dark theme or have broader control over any of this?

Discussion

markdown guide
 

Ooo I have gone all grey on mine 😎

 

I wonder if this ought be tied into a theme creator?

Ruby themes file #2154

Is it worth having a ruby file that contains the theme's HTML, though we'd only have night mode in there for now?

I'm not that clued up on ruby on rails but I presume we can have a file that contains several thems but will only return the relevant HTML based on some request?

CC: @rhymes @lightalloy

It'd be nice for forem maintainers to be able to define their own themes.

 

LOL I think we found a bug, I got a notification because my name is mentioned in the PR :D