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

Comments

bnjmnm created an issue. See original summary.

thedrupalkid’s picture

@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.

bnjmnm’s picture

@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.

thedrupalkid’s picture

Issue summary: View changes
StatusFileSize
new27.27 KB
new27.69 KB

@bnjmnm: Please find the attached screenshot and if needed I can provide the patch for the same. let's finalize the aproach first.

thedrupalkid’s picture

Status: Active » Needs review
StatusFileSize
new1.18 KB

As per comment #13761312 here is the patch. Please review.

anu.a_95’s picture

Applied 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
Before
After patch
After

Claro theme

Before patch
Before
After patch
After

Seven Theme

Before patch
Before
After patch
After

Umami Theme
Before patch
Before
After patch
After

Version: 9.0.x-dev » 9.1.x-dev

Drupal 9.0.10 was released on December 3, 2020 and is the final full bugfix release for the Drupal 9.0.x series. Drupal 9.0.x will not receive any further development aside from security fixes. Sites should update to Drupal 9.1.0 to continue receiving regular bugfixes.

Drupal-9-only bug reports should be targeted for the 9.1.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.2.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

mgifford’s picture

Issue tags: +color contrast

I 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.

vikashsoni’s picture

StatusFileSize
new37.58 KB
new27.27 KB
new20.94 KB

@thedrupalkid I applied the #5 now the button remove the disable after apply the patch sharing screenshot ....

thedrupalkid’s picture

@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.

bnjmnm’s picture

Version: 9.1.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

gaurav-mathur’s picture

StatusFileSize
new55.13 KB
new64.74 KB

Patch #5 applied successfully on Drupal 10 and PHP 8.1.6.
The patch work properly for me.
For Refer sharing to screenshots.

smustgrave’s picture

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

At 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.

smustgrave’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
StatusFileSize
new532 bytes
new664 bytes
new1.7 KB

Added a simple test.

The last submitted patch, 17: 3116003-17-tests-only.patch, failed testing. View results

mgifford’s picture

Issue tags: +WCAG 143

Adding WCAG 1.4.3

sonam.chaturvedi’s picture

StatusFileSize
new523.12 KB
new490.41 KB
new434.6 KB
new347.26 KB

Verified 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.

smustgrave’s picture

Status: Needs review » Needs work
StatusFileSize
new153.94 KB

This actually fails color contrast. Think we should address here

contrast

bnjmnm’s picture

Status: Needs work » Needs review

The accessibility gate requires meeting WCAG AA, the only fail I see in #21 is AAA, which is stricter than what needs to be met.

smustgrave’s picture

That the case someone else will still need to review as I submitted the last patch unfortunately

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

Actually 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.

lauriii’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs work
StatusFileSize
new1.85 KB
new11.33 KB

There 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.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.