Problem/Motivation

In dark mode the color contrast of the border against the adjacent background color of the component is below 3:1 to meet SC1.4.11 (See the table in
https://docs.google.com/spreadsheets/d/1won35PxhRFexJYE8FmZ4DCNTo7xEAxC8... or component.background.xlsx.zip for more details).

input field for tags in dark mode

The following article provides some more background information about SC1.4.11: https://yatil.net/blog/non-text-contrast-in-detail-ui-components

Discussed and iterated on the issue with @mgifford, @the_g_bomb, @katannshaw, and @drupa11y

Steps to reproduce

Check some of the components on, for example:

  • admin/appearance/settings/gin</code </li>
    <li><code>node/2/edit

Proposed resolution

  • Increase the contrast for --gin-bg-input against --gin-border-color-form-element in dark mode to get a color contrast of at least 3:1

Remaining tasks

User interface changes

API changes

Data model changes

Comments

rkoller created an issue. See original summary.

rkoller’s picture

Issue summary: View changes
StatusFileSize
new14.12 KB
mgifford’s picture

Issue summary: View changes
StatusFileSize
new14.72 KB

With the image provided, I've updated the Steps to reproduce above.

There are some possible improvements from:

@media (prefers-contrast: more), (forced-colors: active) {

  /* Save button (primary) */
  #edit-submit.form-submit,
  input[type="submit"].button--primary {
    forced-color-adjust: none;
    background-color: ButtonFace !important;
    color: ButtonText !important;
    border: 2px solid ButtonText !important;
    font-weight: bold;
    box-shadow: 0 0 0 2px ButtonText !important;
  }

  #edit-submit.form-submit:hover,
  #edit-submit.form-submit:focus-visible {
    background-color: Highlight !important;
    color: HighlightText !important;
    border-color: HighlightText !important;
    outline: 2px solid Highlight !important;
    outline-offset: 2px;
  }

  /* Preview button (secondary) */
  #gin-sticky-edit-preview.form-submit {
    forced-color-adjust: none;
    background-color: Canvas !important;
    color: ButtonText !important;
    border: 2px dashed ButtonText !important;
    font-weight: normal;
    box-shadow: 0 0 0 1px ButtonText !important;
  }

  #gin-sticky-edit-preview.form-submit:hover,
  #gin-sticky-edit-preview.form-submit:focus-visible {
    background-color: Highlight !important;
    color: HighlightText !important;
    border-color: HighlightText !important;
    outline: 2px solid Highlight !important;
    outline-offset: 2px;
  }

  /* Hide Sidebar Panel button */
  .meta-sidebar__trigger.trigger {
    forced-color-adjust: none;
    background-color: ButtonFace !important;
    color: ButtonText !important;
    border: 1px solid ButtonText !important;
    border-radius: 50%;
    width: 2.25rem;
    height: 2.25rem;
  }

  .meta-sidebar__trigger.trigger:hover,
  .meta-sidebar__trigger.trigger:focus-visible {
    background-color: Highlight !important;
    color: HighlightText !important;
    outline: 2px solid Highlight !important;
    outline-offset: 2px;
  }

  .meta-sidebar__trigger.trigger svg {
    fill: ButtonText !important;
  }
}

But I got a different looking input with forced colors enabled.

Tag section on content page.

kentr’s picture

Title: Increase the color contrast for components like appearance switch, select elements, checkboxes, radio buttons, text fields, text areas, and date fields » [PP-1] Increase the color contrast for components like appearance switch, select elements, checkboxes, radio buttons, text fields, text areas, and date fields
Status: Active » Postponed

#3556948: Merging Gin as Admin theme moved Gin into core, and the CSS is being restructured / refactored in #3582351: [Meta] Clean up CSS. Work on the current CSS should be postponed until that work is done.