This is a followup from #3086514: Investigate use of the changing color themes for Olivero.

We want to implement color changing themes within Olivero

Olivero currently has a single blue theme (along with gray colors). We want the user to be able to change this to support their specific branding.

Plan

Theme settings UX

  1. The site builder will navigate to the theme settings page
  2. Will have an option to either 1) Select color via color picker or 2) paste in a hex value
  3. The hex value will be saved to config
  4. config value will be pulled in and processed by PHP to determine hue
  5. Hue will then be output as CSS custom property, which will then be utilized by the CSS.

Why not use the color module?

The color module (currently) injects values directly into CSS, and is unworkable with CSS variables and the implementation that Olivero is aiming for.

Olivero’s implementation

Olivero will save a single string to config (the hex value). The interface within the theme settings will be made accessible by adding a input[type=”color] that will be kept in sync with the default input[type=”text”] that’s provided from the Form API.

Within preprocess, we extract this string, and parse it with PHP to generate the hue and saturation. These values are injected into the HTML as CSS variables. These variables, in turn, are used to generate the entire color palette.

Why not update the color module?

This is possible, but not within this theme. The Olivero theme is experimenting with these settings, and abstracting out the code with an eye toward inclusion in a new version of the color module. If and when this happens, we will provide an upgrade path.

Followup issues

  • Provide accessibility contrast feedback when selecting colors
  • Implement secondary color option when allowing users to select Olivero color scheme

Issue fork drupal-3257274

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mherchel created an issue. See original summary.

mherchel’s picture

@andy-blum posted an initial patch for this at https://www.drupal.org/project/drupal/issues/3086514#comment-14347541 within the parent issue.

andy-blum’s picture

StatusFileSize
new344.98 KB

In the patch @mherchel references in #3, all we did was add a number input to allow users to select a hue that we could inject to the CSS custom properties.

In the current issue fork, I'm working on a way to take a hex code from a color input and convert it to HSL to pass all three values into the CSS. Per this comment, the HTML5 color picker isn't accessible enough to meet accessibility maintainer sign-off. After a looking around at different color picker libraries, the main two issues we continually run into is they either require jQuery (because they were written before HTML5 introduced input[type=color]), or they themselves have a fair number of accessibility concerns.

Per a slack conversation with @bnjmnm:

@andy-blum, 2022-01-07 9:02am:

I went looking around for color pickers that would be more accessible, and I’m thinking that something like this might be our best option, using javascript to add range sliders and text inputs around the native color picker. Would something like this be deemed usable/accessible enough to be included in core?

@bnjmnm, 2022-01-07 9:07am:

If it can be demonstrated that the color picker is at least as accessible as Farbtastic, and there's no evidence of there being a more accessible option available, then it can get into core. We need to move off of the jQuery-dependent color picker anyway, so as long as there are no regressions (or it's clear the regressions are minor compared to the benefits), then that's justification enough to allow it

With tentative approval, I'm going to move forward on mimicking the design & functionality of hslpicker.com

a more accessible color picker featuring sliders, number inputs, and text inputs

mherchel’s picture

Status: Active » Needs work

Went through the code without actually trying it out. Left comments in the MR. This is looking great so far!

mherchel’s picture

Issue summary: View changes

Updating the summary to reflect @andy-blum's approach.

andy-blum’s picture

Status: Needs work » Needs review

@mherchel I've addressed your feedback as well as made some additional changes for accessibility. Would love to see @bnjmnm's opinion on the UX as a potential farbtastic replacement

mherchel’s picture

Status: Needs review » Needs work

Added some minor requests.

We also need the ability to revert back to the default, and with that, it'd be nice to have some options for default (accessible) colors.

Can you create an option to have some default colors (you can pick them out, and we'll have @jwitkowski79 and @jponch change or approve), and add that?

Thanks!

mherchel’s picture

On tugboat in the standard profile, I'm getting the following PHP errors. Not sure if this is your code (don't have time to look deep into it)

root@php:/var/lib/tugboat# drush --uri=standard cr
 [success] Cache rebuild complete.
root@php:/var/lib/tugboat# drush --uri=standard watchdog:show
 ---- -------------- -------- ---------- -------------------------------------------------- 
  ID   Date           Type     Severity   Message                                           
 ---- -------------- -------- ---------- -------------------------------------------------- 
  57   09/Jan 15:30   php      Error      Error: Call to undefined function bcdiv() in      
                                          _hexToHsl() (line 651 of                          
                                          /var/lib/tugboat/core/themes/olivero/olivero.the  
                                          me) #0                                            
                                          /var/lib/tugboat/core/themes/olivero/olivero.the  
                                          me(27): _hexToH                                   
  56   09/Jan 15:28   php      Error      Error: Call to undefined function bcdiv() in      
                                          _hexToHsl() (line 651 of                          
                                          /var/lib/tugboat/core/themes/olivero/olivero.the  
                                          me) #0                                            
                                          /var/lib/tugboat/core/themes/olivero/olivero.the  
                                          me(27): _hexToH                                   
  55   09/Jan 15:28   php      Error      Error: Call to undefined function bcdiv() in      
                                          _hexToHsl() (line 651 of                          
                                          /var/lib/tugboat/core/themes/olivero/olivero.the  
                                          me) #0                                            
                                          /var/lib/tugboat/core/themes/olivero/olivero.the  
                                          me(27): _hexToH                                   
  54   09/Jan 15:25   php      Error      Error: Call to undefined function bcdiv() in      
                                          _hexToHsl() (line 651 of                          
                                          /var/lib/tugboat/core/themes/olivero/olivero.the  
                                          me) #0                                            
                                          /var/lib/tugboat/core/themes/olivero/olivero.the  
                                          me(27): _hexToH                                   
  53   09/Jan 15:24   php      Error      Error: Call to undefined function bcdiv() in      
                                          _hexToHsl() (line 651 of                          
                                          /var/lib/tugboat/core/themes/olivero/olivero.the  
                                          me) #0                                            
                                          /var/lib/tugboat/core/themes/olivero/olivero.the  
                                          me(27): _hexToH                                   
  52   09/Jan 15:01   php      Error      Error: Call to undefined function bcdiv() in      
                                          _hexToHsl() (line 651 of                          
                                          /var/lib/tugboat/core/themes/olivero/olivero.the  
                                          me) #0                                            
                                          /var/lib/tugboat/core/themes/olivero/olivero.the  
                                          me(27): _hexToH                                   
  51   09/Jan 15:01   php      Error      Error: Call to undefined function bcdiv() in      
                                          _hexToHsl() (line 651 of                          
                                          /var/lib/tugboat/core/themes/olivero/olivero.the  
                                          me) #0                                            
                                          /var/lib/tugboat/core/themes/olivero/olivero.the  
                                          me(27): _hexToH                                   
  50   09/Jan 15:00   system   Info       claro theme installed.                            
  49   09/Jan 15:00   system   Info       olivero theme installed.                          
  48   09/Jan 15:00   user     Notice     Session opened for admin.                         
 ---- -------------- -------- ---------- -------------------------------------------------- 
root@php:/var/lib/tugboat# 
andy-blum’s picture

Status: Needs work » Needs review
andy-blum’s picture

Status: Needs review » Needs work
andy-blum’s picture

Status: Needs work » Needs review
mherchel’s picture

More thorough review incoming, but the reason this is currently failing is:

----------------------------------------------------------------------------------------------------
Checking core/themes/olivero/olivero.theme


FILE: /var/www/html/core/themes/olivero/olivero.theme
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
 635 | ERROR | Doc comment short description must end with a full
     |       | stop
 640 | ERROR | Return type "array [$hue, $saturation, $lightness]"
     |       | must not contain spaces
----------------------------------------------------------------------

Time: 185ms; Memory: 8MB


----------------------------------------------------------------------------------------------------
Checking core/themes/olivero/theme-settings.php

PHPCS: core/themes/olivero/theme-settings.php passed
core/themes/olivero/theme-settings.php passed

----------------------------------------------------------------------------------------------------
Drupal code quality checks failed.
To reproduce this output locally:
* Apply the change as a patch
* Run this command locally: sh ./core/scripts/dev/commit-code-check.sh
OR:
* From the merge request branch
* Run this command locally: sh ./core/scripts/dev/commit-code-check.sh --branch 10.0.x
Custom Commands Failed
mherchel’s picture

Status: Needs review » Needs work

Looks like the final compiled JS was not committed. Will compile it and continue the review later tonight.

andy-blum’s picture

Status: Needs work » Needs review
andy-blum’s picture

Status: Needs review » Needs work
andy-blum’s picture

Status: Needs work » Needs review

Finally passed the tests!

mherchel’s picture

Status: Needs review » Needs work
StatusFileSize
new204.08 KB
new89.09 KB
new206.9 KB

This is looking so great!

Some additional feedback (with images)

1. The icon that appears in maintenance mode should change too
2. The overlay color should be changed to a transparent black.
3. When setting the color scheme to "ice", I see the hue is set to 190.99. This should probably be rounded.

mherchel’s picture

Issue tags: +Needs tests

Needs tests. I can work on these if needed.

andy-blum’s picture

StatusFileSize
new408.44 KB

@mherchel do we want to adjust the hue of the "drops" background?

andy-blum’s picture

Status: Needs work » Needs review
andy-blum’s picture

Updated to use --color--primary variables. Also changed how the lightness calculation is done to prevent clipping. The previous method had the potential for colors to try to use lightness values over 100. The new calculation does not.

mherchel’s picture

Issue summary: View changes
Status: Needs review » Needs work
StatusFileSize
new280.9 KB

At line 116 in oliveroColorTest.js, we're getting the following PHP error:

The website encountered an unexpected error. Please try again later.

Drupal\Core\Config\Schema\SchemaIncompleteException: Schema errors for olivero.settings with the following errors: olivero.settings:color_scheme missing schema in Drupal\Core\Config\Development\ConfigSchemaChecker->onConfigSave() (line 94 of core/lib/Drupal/Core/Config/Development/ConfigSchemaChecker.php).
call_user_func(Array, Object, 'config.save', Object) (Line: 108)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'config.save') (Line: 229)
Drupal\Core\Config\Config->save() (Line: 512)
Drupal\system\Form\ThemeSettingsForm->submitForm(Array, Object)
call_user_func_array(Array, Array) (Line: 114)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 52)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 592)
Drupal\Core\Form\FormBuilder->processForm('system_theme_settings', Array, Object) (Line: 320)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 564)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 152)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 74)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 35)
Drupal\form_test\StackMiddleware\FormTestMiddleware->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 679)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

mherchel’s picture

So the problem is that there's a check to ensure that the theme settings are in the olivero.schema.yml file. And the color_scheme is missing (https://git.drupalcode.org/project/drupal/-/merge_requests/1623/diffs#c0...)

So, we have a choice:

  1. We can include that setting in the schema (and default config)
  2. We can generate the <select> via JavaScript, since it doesn't really do anything unless JavaScript is enabled.

Thoughts?

andy-blum’s picture

Status: Needs work » Needs review

Moved the element to JS.

andy-blum’s picture

Status: Needs review » Needs work

theme_get_setting() is deprecated. We should move to using the theme manager specified in the change record

andy-blum’s picture

Status: Needs work » Needs review

Disregard the above. theme_get_setting() will eventually be deprecated but it seems to be blocked at the moment.

andy-blum’s picture

10.0.x chromedriver got updated. Re-queuing tests!

tim.plunkett’s picture

Status: Needs review » Needs work

Instead of the approach in abdea896, you should be able to add '#input' => FALSE, to that form element.

xjm’s picture

I apologize in advance; I'm about to push a merge of HEAD because rebase has too many conflicts...

xjm’s picture

Phew, no explosions. :)

xjm’s picture

Just to validate the merge, this is the current diffstat from 10.0.x:

[ayrton:drupal | Wed 09:16:16] $ git diff 10.0.x --stat
 core/misc/cspell/dictionary.txt                    |   1 +
 .../Nightwatch/Tests/Olivero/oliveroColorTest.js   | 134 ++++++++++++++
 .../olivero/config/install/olivero.settings.yml    |   1 +
 .../olivero/config/schema/olivero.schema.yml       |   7 +-
 core/themes/olivero/css/base/variables.css         |   9 +-
 core/themes/olivero/css/base/variables.pcss.css    |   9 +-
 .../themes/olivero/css/components/color-picker.css |  16 ++
 .../olivero/css/components/color-picker.pcss.css   |  11 ++
 .../olivero/css/components/maintenance-page.css    |   6 +-
 .../css/components/maintenance-page.pcss.css       |   4 +
 core/themes/olivero/js/color-picker.es6.js         | 205 +++++++++++++++++++++
 core/themes/olivero/js/color-picker.js             | 136 ++++++++++++++
 core/themes/olivero/olivero.libraries.yml          |  11 ++
 core/themes/olivero/olivero.theme                  |  79 ++++++++
 core/themes/olivero/theme-settings.php             |  23 +++
 15 files changed, 641 insertions(+), 11 deletions(-)
andy-blum’s picture

Status: Needs work » Needs review
mherchel’s picture

Status: Needs review » Needs work

We're getting a failure on

[18:42:07] '/var/www/html/core/themes/olivero/js/color-picker.es6.js' is being checked.
[18:42:07] '/var/www/html/core/themes/olivero/js/color-picker.es6.js' is not updated.
andy-blum’s picture

Turns out the chromedriver wasn't fully fixed. Should be happening soon though and we can re test

mherchel’s picture

Status: Needs work » Needs review

color-picker.js needed to be recompiled too.

mherchel’s picture

Issue summary: View changes
Status: Needs review » Needs work
StatusFileSize
new50.13 KB

This is looking so good!

In addition to the MR comments above, there's two more:

1) We should nest the two new form fields in a fieldset to visually (and semantically) indicate that they are related.

2) We need to validate the hex string server-side. If I remove the pattern attribute from the input, it allows me to submit invalid colors. This then throws an error on the front-end when it tries to parse it.

andy-blum’s picture

Most recent changes appear to be working just fine, see the tugboat preview for a working example.

We still need to add the backend validation for the hexcode.

andy-blum’s picture

Status: Needs work » Needs review
mherchel’s picture

Status: Needs review » Needs work
StatusFileSize
new83.32 KB

This is so close!

A couple changes:

1) We need to modify the .header-nav-overlay CSS class in core/themes/olivero/css/components/header-navigation.pcss.css to make the background transparent black. Currently the MR is adding a new CSS class in base.pcss.css(which we recently refactored out). We need to remove that from the MR.

2) If you have Olivero up and running and apply the patch, the config does not exist. This makes the form look incorrect.

We probably need to add an update hook to add the config. We might be able to get away with seeing if the config exists -- and if it doesn't then load the default blue value. I'm not sure what's best practice.

andy-blum’s picture

Status: Needs work » Needs review
mherchel’s picture

Status: Needs review » Needs work

I asked in the #contribute channel, and this was the response from @alexpott (among others)

the new default value should be set by an update hook. As @chr.fritsch pointed out - that’s not possible at the moment. We need to land #3259188: Extend post update system to provide themes a way to install newly-required dependencies - so that’s a blocker in my opinion. The problem is that an empty value is not a valid value so it is the update system’s job to fix this.

mherchel’s picture

Another update from the same Slack thread (with a workaround that unblocks us).

From @berdir

as a workaround, couldn't we just put a post update in system.module and check if the theme is enabled? didn't check the issue and can't comment on how close it is.

From @alexpott

Yep @berdir’s suggestion would work - the theme update patch is in pretty good shape and would be good to get done. But I guess it should not block olivero stability.

shaal’s picture

andy-blum’s picture

For the sake of clarity, the solution described in #46 is to use hook_post_update_NAME() within system.post_update.php.

I'm working to add this in now.

andy-blum’s picture

Status: Needs work » Needs review
andy-blum’s picture

Status: Needs review » Needs work

Looks like the inputs don't stay synchronized correctly now that we've changed the HTMLColorInput's name attribute. Also causing the test failures below:

11:25:21 [Olivero/Olivero Color Test] Test Suite
11:25:21 =======================================
11:25:21 - Connecting to chromedriver-jenkins-drupal-patches-118565 on port 9515...
11:25:21 
11:25:21 ℹ Connected to chromedriver-jenkins-drupal-patches-118565 on port 9515 (130ms).
11:25:22   Using: chrome (98.0.4758.102) on Linux platform.
11:25:22 
11:25:22 ✔ Expected element <.user-role-form .machine-name-value> to be visible in 2000ms (533ms)
11:25:31 ✔ User "user" was created successfully (45ms)
11:25:33 ✔ Passed [equal]: The user "user" was logged in.
11:25:34 - Running Olivero Settings - color schemes update individual values:
11:25:34 
11:25:34 ⚠ Running Olivero Settings - color schemes update individual values:
11:25:39 
11:25:39 ✖ Timed out while waiting for element <[data-drupal-selector="edit-color-scheme"]> to be present for 5000 milliseconds. - expected "visible" but got: "not found" (5086ms)
11:25:39     at Object.Olivero Settings - color schemes update individual values (/var/www/html/core/tests/Drupal/Nightwatch/Tests/Olivero/oliveroColorTest.js:52:8)
11:25:39     at processTicksAndRejections (node:internal/process/task_queues:96:5) 
11:25:39 
11:25:39 
11:25:39 FAILED: 1 assertions failed (5.33s)
11:25:39 - Running Olivero Settings - color inputs stay synchronized:
11:25:39 
11:25:39 ✔ Element <input[type="text"][name="base_primary_color"]> was visible after 25 milliseconds.
11:25:40 ✔ Running Olivero Settings - color inputs stay synchronized:
11:25:40 
11:25:40 ✖ Timed out while waiting for element <input[type="color"][name="base_primary_color"]> to be present for 5000 milliseconds. - expected "visible" but got: "not found" (5082ms)
11:25:45     at Object.Olivero Settings - color inputs stay synchronized (/var/www/html/core/tests/Drupal/Nightwatch/Tests/Olivero/oliveroColorTest.js:103:8) 
11:25:45 
11:25:45 
11:25:45 FAILED: 1 assertions failed and  1 passed (5.329s)
11:25:45 - Running Olivero Settings - color selections impact olivero theme:
11:25:45 
11:25:45 ⚠ Running Olivero Settings - color selections impact olivero theme:
11:25:50 
11:25:50 ✖ Timed out while waiting for element <input[type="color"][name="base_primary_color"]> to be present for 5000 milliseconds. - expected "visible" but got: "not found" (5085ms)
11:25:50     at Object.Olivero Settings - color selections impact olivero theme (/var/www/html/core/tests/Drupal/Nightwatch/Tests/Olivero/oliveroColorTest.js:114:8) 
11:25:50 
11:25:50 
11:25:50 FAILED: 1 assertions failed (5.3s)
11:25:50 
11:25:50 [Olivero/Olivero Comment Test] Test Suite
11:25:50 =========================================
11:25:50 - Connecting to chromedriver-jenkins-drupal-patches-118565 on port 9515...
11:25:50 
11:25:50 ℹ Connected to chromedriver-jenkins-drupal-patches-118565 on port 9515 (211ms).
11:25:50   Using: chrome (98.0.4758.102) on Linux platform.
11:25:50 
11:25:50 ✔ Expected element <.user-role-form .machine-name-value> to be visible in 2000ms (532ms)
11:25:59 ✔ User "user" was created successfully (46ms)
11:26:02 ✔ Passed [equal]: The user "user" was logged in.
11:26:03 - Running Article without comments should not display count:
11:26:03 
11:26:03 ✔ Testing if element <body> contains text 'Article without comments' (90ms)
11:26:03 ✔ Running Article without comments should not display count:
11:26:03 
11:26:03 ✔ Testing if element <h2.comments__title .comments__count> is not present (13ms)
11:26:03 
11:26:03 OK. 2 assertions passed. (325ms)
11:26:03 - Running Article with comments should display count:
11:26:03 
11:26:03 ✔ Running Article with comments should display count:
11:26:03 
11:26:03 ✔ Testing if element <body> contains text 'Article with comments' (119ms)
11:26:03 ✔ Testing if element <h2.comments__title> is present (13ms)
11:26:03 ✔ Testing if element <h2.comments__title .comments__count> is present (8ms)
11:26:03 ✔ Testing if element <h2.comments__title .comments__count> contains text '2' (22ms)
11:26:03 
11:26:03 OK. 4 assertions passed. (386ms)
mherchel’s picture

Issue summary: View changes

Updating the summary to add discussion regarding the color module.

mherchel’s picture

Status: Needs work » Needs review
andy-blum’s picture

Status: Needs review » Needs work
andy-blum’s picture

Status: Needs work » Needs review
mherchel’s picture

We discussed this issue at #3267550: Drupal Usability Meeting 2022-03-11 that issue will have a link to the recording.

The key points are

  • This looks and functions great
  • We should have some text near the top of the fieldset that indicates its function. Something like "You can use these settings to adjust the primary color of Olivero, which will affect various elements."
  • Having a refactored color module would be nice. But this should not be a blocker. Olivero will provide an update the use the color module when that option becomes available.
  • It would be nice for the preloaded color palettes to have colors indicating what they look like. This is not a blocking issue.

mglaman made their first commit to this issue’s fork.

andy-blum’s picture

Status: Needs review » Needs work
mglaman’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests

Fixed @andy-blum feedback on my last commit which added unit test for the HEX -> HSL conversion. Pushing this back to Needs Review and removing Needs Tests flag.

mherchel’s picture

Status: Needs review » Reviewed & tested by the community

This MR is a thing of beauty. I can't think of anything else. It works well, is robust, and is well tested.

**Chef's Kiss**

benjifisher’s picture

For the record, the participants at the usability meeting (see #55 for a link) were

AaronMcHale, andregp, Antoniya, ckrina, mherchel, shaal, rkoller, tmaiochi, worldlinemine, andy-blum

andy-blum’s picture

Status: Reviewed & tested by the community » Needs work

Discussed with Mike Gifford to get feedback on accessibility, and there are 2 primary takeaways.

  1. We need to announce to screen reader users when field values change programatically. So when selecting a named color scheme, the browser should announce "Base primary color has changed" and when we change the hex value of base primary color we should announce "Color scheme has changed" (as long as that value actually changes, we'll want to make sure a custom-to-custom change doesn't make an erroneous announcment). Because of this, moving back to "needs work"
  2. "I wouldn't block this based on not having the analysis of color contrast." So no need to do the contrast calculations and attempt to warn users of inaccessible combos for this issue.
mgifford’s picture

Thanks @andy-blum - thanks for summarizing our conversation.

andy-blum’s picture

Status: Needs work » Needs review
mherchel’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new1.86 MB

This last change looks perfect. The text is announcing on every change now. Video with VoiceOver attached.

At this point we have sign offs from both the UX and accessibility teams!

xjm credited AaronMcHale.

xjm credited Antoniya.

xjm credited andregp.

xjm credited ckrina.

xjm credited rkoller.

xjm credited tmaiochi.

xjm credited worldlinemine.

xjm’s picture

Adding credit for UX review participants. Thank you all!

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

I posted some comments in gitlab that need addressing.

mherchel’s picture

Comments from @alexpott in Drupal Slack (https://drupal.slack.com/archives/C1BMUQ9U6/p1648555120415739)

alexpott 4 minutes ago
It’s tricky - determining the same value from a constant every request is unnecessary work. The caching for preprocess_html is the page cache :slightly_smiling_face:

alexpott 3 minutes ago
As stated in the comment I think changing the config to an hsl value means we need to convert back to #hex value - which seems awkward so lets not.

alexpott 2 minutes ago
So we need to remove the if because it is unnecessary - the value is always set. And the we need to fix the schema to use the correct type.

mherchel 1 minute ago
gotcha! Thanks for the clarification!
New

alexpott < 1 minute ago
I left the thoughts on storing the HSL values in case someone thought - “oh I know how that could work”

andy-blum’s picture

Status: Needs work » Needs review
mherchel’s picture

Status: Needs review » Reviewed & tested by the community

Changes look perfect. I eyeball'ed the code one last time and it looks good. I also tested out the upgrade script, etc, and made sure that works as expected. Everything looks great. Thanks for the work on this!

mherchel’s picture

lauriii’s picture

Status: Reviewed & tested by the community » Needs review

Have we tried the proposed approach from #32 for generating the form input? That would allow us to avoid the problems we would have to resolve in #77.

mherchel’s picture

Status: Needs review » Needs work
andy-blum’s picture

Status: Needs work » Needs review

Most recent push should satisfy @tim.plunkett in #32 and @laurii in #78, as well as nullify @mherchel's spin off issue #3275990: Create theme function for dynamically inserted (via JS) form elements within Olivero's color changing form.

The tests here are going to fail, as we are now utilizing the ThemeColorsParser class as created in patch #38 in #788332: Provide a parser for THEME.colors.yml, but I'm excited about this as a more human-readable solution and one that more clearly outlines the direction of a hypothetical color module replacement.

andy-blum’s picture

alexpott’s picture

I've split out the fix to theme update function registry that this issue found - see #3279850: Theme post updates are not recognised when the theme is used in the installer

andy-blum’s picture

Status: Needs review » Needs work

All the PHP tests are passing now, so that's good! Looks like I forgot to update the nightwatch tests though after changing the form element markup, so back to needs work.

andy-blum’s picture

Status: Needs work » Needs review
mherchel’s picture

mherchel’s picture

Status: Needs review » Reviewed & tested by the community

This looks amazing! I tested out the update functionality (and opened the followup in #85). I also reviewed the latest commits since my last review, and that looks good. Finally, I tested out the functionality and was unsuccessful in my attempts to break it.

Amazing work everyone!

andy-blum’s picture

Disregard php7.3 tests. This is D10 only

lauriii’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +10.0.0 release highlights

Committed ce2f2b5 and pushed to 10.0.x. Thanks!

  • lauriii committed ce2f2b5 on 10.0.x
    Issue #3257274 by andy-blum, mherchel, mglaman, xjm, alexpott, mgifford...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

thulenb’s picture

Will this also be available for D9?

mherchel’s picture

Will this also be available for D9?

Nope 😭 It relies on CSS variables. D9 has a commitment to support IE11 (which does not support CSS variables).

thulenb’s picture

Understand, thanks.
So I tried to do this with a subtheme of Olivero. Is there any other way to build css besides using Yarn. My hosting provider just told me that I can’t use it. How can I build CSS in order to get my color changes active?

thulenb’s picture

Understand, thanks.
So I tried to do this with a subtheme of Olivero. Is there any other way to build css besides using Yarn. My hosting provider just told me that I can’t use it. How can I build CSS in order to get my color changes active?