Problem/Motivation
In this issue: #2513534: Remove the 'disabled' region from Block UI, a new "disabled" block state was added. This issue also added CSS that makes disabled blocks in the Block admin UI semi-transparent.
However, this styling was not present in any core themes, as Stable provided an earlier version of the stylesheet. Once #3115223: Remove Stable as a base theme of core themes, core themes in Drupal 9 will see this new style.
There's a UX problem with this style: making this semi-transparent tells the user that the interactive elements are disabled, and they are not. The block is in a disabled state -- but the interactive elements for that block are still active (and should be). The block being disabled should be represented in another way (or not at all if it's deemed sufficient to have the dropbutton say "Enable"
The styling results in an additional problem in Bartik and Umami: it results in insufficient contrast. This may be less of a concern since those are not admin themes and it can be determined in this issue if that needs to be a concern.
Claro

Seven

Bartik

(Contrast is not accessible - 4.15:1)
Umami

Contrast is not accessible - 3.82:1
Proposed resolution
Determine a more UX friendly approach and implement.
Remaining tasks
Note that if work begins on this before #3115223: Remove Stable as a base theme of core themes lands, the styling this issue is addressing will not be visible unless Stable is configured to not override block.admin.css
User interface changes
API changes
Data model changes
Release notes snippet

| Comment | File | Size | Author |
|---|---|---|---|
| #25 | Screen Shot 2023-03-17 at 12.58.07.png | 11.33 KB | lauriii |
| #25 | Screen Shot 2023-03-17 at 12.58.11.png | 1.85 KB | lauriii |
| #21 | Screen Shot 2023-03-04 at 11.03.28 PM.png | 153.94 KB | smustgrave |
| #20 | aftr_pat#17_seven.png | 347.26 KB | sonam.chaturvedi |
| #20 | aftr_pat#17_olivero.png | 434.6 KB | sonam.chaturvedi |
Comments
Comment #2
thedrupalkid commented@bnjmnm: I have spent some time to analyse more user friendly approach to implement the disable style. I propose not adding the style to the row but to the block text and category column and remove style on all the active elements ie: region's (dropdown), enable link(dropdown). We can improvise style limited to the disabled text not on all the active elements in the row.
Please let me know your views.
Comment #3
bnjmnm@thedrupalkid could you provide a patch or screenshot of what you have in mind? I'm not confident I'd be able to understand a verbal description of something so visual.
Comment #4
thedrupalkid commented@bnjmnm: Please find the attached screenshot and if needed I can provide the patch for the same. let's finalize the aproach first.
Comment #5
thedrupalkid commentedAs per comment #13761312 here is the patch. Please review.
Comment #6
anu.a_95 commentedApplied patch #5 successfully
When a block is disabled, the whole elements of that particular block is changed to a semi transparent styling in the block structure option. Actually the blocks are only disabled but not their interactive elements like Region and Operations selector. After applying the patch in #5, only the block name is styled in semi transparent. All the other columns and interactive elements are in normal style indicating that they are accessible/active.
In the screenshots, please notice that the "Help" block is disabled
Bartik Theme
Before patch


After patch
Claro theme
Before patch


After patch
Seven Theme
Before patch


After patch
Umami Theme


Before patch
After patch
Comment #8
mgiffordI don't see in the code what is changing the color contrast. Could someone spell it out for me? I couldn't see it in the patch in #5.
Comment #9
vikashsoni commented@thedrupalkid I applied the #5 now the button remove the disable after apply the patch sharing screenshot ....
Comment #10
thedrupalkid commented@mgifford: We are just adding a class based on the block state is disabled and making the controls look like they are enabled and available for intraction.
Comment #11
bnjmnmComment #15
gaurav-mathur commentedPatch #5 applied successfully on Drupal 10 and PHP 8.1.6.
The patch work properly for me.
For Refer sharing to screenshots.
Comment #16
smustgrave commentedAt this time we would need a D10.1.x patch or MR for this issue.
Before rolling this will Also will need a test. Could just check to see if the attribute exists when a block is disabled.
Comment #17
smustgrave commentedAdded a simple test.
Comment #19
mgiffordAdding WCAG 1.4.3
Comment #20
sonam.chaturvedi commentedVerified and tested patch #17 on 10.1.x-dev. Patch applied cleanly and works fine.
Test Result:
Only the block name is styled as disabled. All the other columns and interactive elements -i.e. Region, "Enable" button are in style indicating that they are accessible/enabled.
Please refer attached before and after screenshots for Claro, Olivero and Seven themes.
Accessibility review required.
Comment #21
smustgrave commentedThis actually fails color contrast. Think we should address here
Comment #22
bnjmnmThe accessibility gate requires meeting WCAG AA, the only fail I see in #21 is AAA, which is stricter than what needs to be met.
Comment #23
smustgrave commentedThat the case someone else will still need to review as I submitted the last patch unfortunately
Comment #24
smustgrave commentedActually since I did not work on the fix, just the test case I think I'm still okay to review this one. And since it's not causing an accessibility issue per #22 think it's good.
Comment #25
lauriiiThere are still a few things that we probably should still iterate on:
The "disabled" style still applies to the table drag handle. I believe it might be confusing because at first I thought for real that maybe it is disabled because it was the only interactive element on the row that was indicating it's disabled.

When hovering a disabled table row, different columns are now using different background color.
