Problem/Motivation

The -webkit-search-cancel-button doesn't have enough contrast with the black background of the search input. This should be styled to a light gray X

Chrome:

Safari:

Steps to reproduce

Proposed resolution

Remaining tasks

#25.1

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#48 After Patch.png71.23 KBBushra Shaikh
#48 Before Patch.png73.49 KBBushra Shaikh
#45 3153475-45.patch5.48 KBgauravvvv
#44 3153475-nr-bot.txt144 bytesneeds-review-queue-bot
#43 after-patch-search-icon-desktop.png25.45 KBgaurav-mathur
#43 after-patch-search-icon-mobile.png4.26 KBgaurav-mathur
#43 after-patch-search-page-icon.png7.45 KBgaurav-mathur
#43 before-patch-primary-search-icon.png25.65 KBgaurav-mathur
#42 3153475-search-page.png293.2 KBpradipmodh13
#42 3153475-tablet-primary-search.png118.9 KBpradipmodh13
#42 3153475-mobile-primary-search.png34.94 KBpradipmodh13
#42 3153475-desktop-primary-search.png289.5 KBpradipmodh13
#41 3153475-41.patch5.39 KBpradipmodh13
#37 drupal-n3153475-37.patch8.84 KBdamienmckenna
#34 3153475-after-patch.png20.4 KBindrajithkb
#34 3153475-B-P.png20.83 KBindrajithkb
#33 3153475.33.patch8.87 KBsakthivel m
#28 Screenshot 2021-04-11 at 10.49.06.png17.93 KBgauravvvv
#28 Screenshot 2021-04-11 at 10.44.55.png58.98 KBgauravvvv
#27 After--patch--mobile--when-we-select-suggestions.jpg51.45 KBranjith_kumar_k_u
#27 After--patch--mobile.jpg50.5 KBranjith_kumar_k_u
#27 After--patch--desktop--when-we-select-suggestions.jpg249.06 KBranjith_kumar_k_u
#27 After--patch--desktop.jpg259.66 KBranjith_kumar_k_u
#27 Before--patch--mobile-when-we-select-suggestions.jpg50.01 KBranjith_kumar_k_u
#27 Before--patch--mobile.jpg52.06 KBranjith_kumar_k_u
#27 Before--patch-desktop-when-we-select-suggestions.jpg236.81 KBranjith_kumar_k_u
#27 Before--patch--desktop.jpg265.33 KBranjith_kumar_k_u
#26 interdiff_23-26.txt4.8 KBkomalk
#26 3153475-26.patch8.24 KBkomalk
#23 before-patch.png191.82 KBkomalk
#23 Atfer-patch.png161.71 KBkomalk
#23 interdiff_20-23.txt1.03 KBkomalk
#23 3153475-23.patch8.54 KBkomalk
#20 3153475-20.patch8.01 KBkostyashupenko
#20 interdiff_16-20.txt3.21 KBkostyashupenko
#19 Screenshot 2020-10-30 at 2.15.19 PM.png161.25 KBkomalk
#18 Home___Drupal.png284.44 KBmherchel
#17 Снимок экрана 2020-10-27 в 19.28.09.png15.66 KBkostyashupenko
#17 Снимок экрана 2020-10-27 в 19.28.17.png150.95 KBkostyashupenko
#17 Снимок экрана 2020-10-27 в 19.28.24.png33.82 KBkostyashupenko
#16 3153475-16.patch5.31 KBkostyashupenko
#13 after.png98.72 KBkomalk
#13 before.png122.23 KBkomalk
#13 interdiff_5-13.txt1.35 KBkomalk
#13 3153475-13.patch1008 byteskomalk
#8 Crossicon-before-patch.png374.79 KBpoojakural
#8 Crossicon-after-patch.png378.9 KBpoojakural
#5 Screenshot 2020-06-20 at 6.19.28 PM.png186.32 KBkiran.kadam911
#5 hide-cross-icon-3153475-5.patch970 byteskiran.kadam911
safari.png603.26 KBkiran.kadam911
chrome.png142.52 KBkiran.kadam911

Comments

kiran.kadam911 created an issue. See original summary.

kiran.kadam911’s picture

Issue summary: View changes
kiran.kadam911’s picture

Issue summary: View changes
kiran.kadam911’s picture

Title: Search Form, On text input a cross icon is coming, this is only coming on Chrome not in Safari. » Search Form, On text input a cross icon, this is only coming on Chrome not in Safari.
kiran.kadam911’s picture

Assigned: kiran.kadam911 » Unassigned
Status: Needs work » Needs review
StatusFileSize
new970 bytes
new186.32 KB

Kindly review the attached patch.

After resolve:

Thanks!

poojakural’s picture

Assigned: Unassigned » poojakural
mherchel’s picture

My first thought on this is do we want to break the browser's default behavior of inserting the X? I know it definitely should not have a gradient.

poojakural’s picture

StatusFileSize
new378.9 KB
new374.79 KB

@kiran.kadam911 Thank for adding patch. Patch is working for me. Please refer the SS.

Before Patch
Cross Icon Before Patch

After Patch

Cross Icon After Patch

poojakural’s picture

Assigned: poojakural » Unassigned
kiran.kadam911’s picture

Thanks @pooja for test.

@mherchel if we are considering to do not break the browser default behaviour of X then it's fine. But that X is just icon/gradient having no action on click actually when we try to click on that X which is just a focus in input. And because of that again question comes up here about accessibility like on tab click X is not focusable. Focus directly goes on seach icon which is submit cta.

Need your input on this, what will be best for this case.

Thanks!

kiran.kadam911’s picture

Issue tags: -bug +Bug Smash Initiative, +Accessibility
mherchel’s picture

Title: Search Form, On text input a cross icon, this is only coming on Chrome not in Safari. » Style primary search form's -webkit-search-cancel-button within desktop and mobile navigation
Project: Olivero » Drupal core
Version: 8.x-1.x-dev » 9.1.x-dev
Component: Code » Olivero theme
Issue summary: View changes
Priority: Normal » Minor
Status: Needs review » Needs work
Issue tags: -Bug Smash Initiative, -Accessibility +CSS
komalk’s picture

Status: Needs work » Needs review
StatusFileSize
new1008 bytes
new1.35 KB
new122.23 KB
new98.72 KB
mherchel’s picture

Status: Needs review » Needs work

@komalkolekar Your patch just removes the button for only one of the search inputs. We want to style the inputs (not remove them), and we need to do it both for the desktop and mobile search input fields.

Please see the updated summary.

kostyashupenko’s picture

Assigned: Unassigned » kostyashupenko
kostyashupenko’s picture

Assigned: kostyashupenko » Unassigned
StatusFileSize
new5.31 KB

This is init patch. I didn't have enough time to test my changes in all browsers, but it works in chrome. Why init patch? Because by default cross is grey.. And to make it white, we need some modifier class (to prevent double code in multiple places). Well, actually we need white cross icon only for search inputs in header, so maybe possible to add some modifier classname using hook? Idk yet.

kostyashupenko’s picture

3 screenshots after patch
Please let me know if these styles are expected and we really can keep it.
Also thoughts about modifier for white cross?

mherchel’s picture

Status: Needs review » Needs work
StatusFileSize
new284.44 KB

This looks really great IMO (with one super minor change below).

My first thought is that we should be using :before and :after pseudo-elements instead of background images. Unfortunately, the ::-webkit-search-cancel-button psuedo-element doesn't support those. So, the only real option is background images.

The only thing I noticed is that the icon seems misplaced on the mobile form (see the screenshot below). We can adjust this by changing the padding-right (or more correctly, padding-inline-end) on the mobile search form.

komalk’s picture

StatusFileSize
new161.25 KB

Refer screenshot tested with the RTL look off the text is not visible.

kostyashupenko’s picture

Status: Needs work » Needs review
StatusFileSize
new3.21 KB
new8.01 KB

I have fixed feedbacks from #18 and #19 comments

mherchel’s picture

Status: Needs review » Needs work

This looks good. However, the padding right issue on the mobile search form is still not resolved on tablet and desktop sizes (there's a media query and we need to adjust the value on line 74)

komalk’s picture

Assigned: Unassigned » komalk
komalk’s picture

Assigned: komalk » Unassigned
Status: Needs work » Needs review
StatusFileSize
new8.54 KB
new1.03 KB
new161.71 KB
new191.82 KB

Worked on #21.
Attached screenshot for reference.
Review the patch.

mherchel’s picture

Status: Needs review » Reviewed & tested by the community

Reviewed #23 and looks perfect!

lauriii’s picture

Version: 9.1.x-dev » 9.2.x-dev
Priority: Minor » Normal
Status: Reviewed & tested by the community » Needs work
  1. +++ b/core/themes/olivero/css/components/header-search-wide.pcss.css
    --- /dev/null
    +++ b/core/themes/olivero/images/cross-white.svg
    
    +++ b/core/themes/olivero/images/cross-white.svg
    --- /dev/null
    +++ b/core/themes/olivero/images/cross.svg
    

    Let's optimize these SVG files.

  2. +++ b/core/themes/olivero/images/cross.svg
    @@ -0,0 +1,3 @@
    +  <path fill="#7e96a7" d="M9.00014 7.61552L1.38461 0L0 1.38461L7.61552 9.00014L0.000147897 16.6155L1.38476 18.0001L9.00014 10.3848L16.6154 18L18 16.6154L10.3848 9.00014L18.0001 1.38475L16.6155 0.000138166L9.00014 7.61552Z"/>
    

    Seems like this doesn't provide enough color contrast to comply with WCAG AA. Let's try to find another color that would provide sufficient contrast.

komalk’s picture

Status: Needs work » Needs review
StatusFileSize
new8.24 KB
new4.8 KB

Worked on #25.
#25.2- Instead of #7e96a7 used #5F788C to comply with WCAG AA.
#5F788C is having a contrast ratio is 4.61:1 whereas #7e96a7 is having a contrast ratio is 3.08:1
Review the patch.

ranjith_kumar_k_u’s picture

I have tested the above patch on 9.2 dev version.The -webkit-search-cancel-button is not much visible ,when we select the suggestions from input text field.
Before patch Desktop
before patch

when we select suggestions
before patch

Before patch mobile
before patch

when we select suggestions
before patch

After patch Desktop
after patch

when we select suggestions
after patch

After patch Mobile
after patch

when we select suggestions
after patch

gauravvvv’s picture

I have added both before and after patch screenshots.

The color contrast seems to be fixed.

Moving to RTBC.

gauravvvv’s picture

Status: Needs review » Reviewed & tested by the community

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

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

lauriii’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll
sakthivel m’s picture

#26 Patch failed

sakthivel m’s picture

Status: Needs work » Needs review
StatusFileSize
new8.87 KB

#33 Please review the patch

indrajithkb’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new20.83 KB
new20.4 KB

Hi @Sakthivel M, thanks for the patch #33 it's working as expected, adding the screenshots.

Before patch:

image

After patch:

image

Moving to RTBC.

mherchel’s picture

Status: Reviewed & tested by the community » Needs work

Thanks for working on this. My thought is that we can simplify the code by not using a gradient (use white) and use CSS to generate the X instead of SVG

  1. +++ b/core/themes/olivero/css/components/form-text.css
    @@ -10,6 +10,14 @@
    +  background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'  xmlns:v='https://vecta.io/nano'%3e%3cpath fill='%235F788C' d='M9 7.616L1.385 0 0 1.385 7.616 9 0 16.616 1.385 18 9 10.385 16.615 18 18 16.615 10.385 9 18 1.385 16.616 0 9 7.616z'/%3e%3c/svg%3e") no-repeat 50% 50% / 1.125rem 1.125rem;
    

    Can we use CSS shapes to make the background instead of requiring the browser to download an additional image?

    Note that when you do this, use borders (instead of background colors) so that it shows in Windows high contrast mode.

  2. +++ b/core/themes/olivero/css/components/form-text.pcss.css
    @@ -5,6 +5,13 @@
    +[type="search"]::-webkit-search-cancel-button {
    

    Why are we making this change here?

  3. +++ b/core/themes/olivero/css/components/header-search-narrow.pcss.css
    @@ -170,7 +177,14 @@ body:not(.is-always-mobile-nav) .block-search-narrow {
    +    background-image: linear-gradient(var(--color--blue-50), var(--color--blue-50));
    

    We can just make this white here. Doesn't need to be a gradient.

kostyashupenko’s picture

@mherchel
1. About css shapes - how do you plan to do it? From what i see we can't use :before or :after on the webkit-search-cancel-button pseudo element.

damienmckenna’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new8.84 KB

This is a quick reroll of #33 against 9.3.x.

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.

pradipmodh13’s picture

StatusFileSize
new5.39 KB

Create patch for Drupal 10.1.x. Please check primary search and search text box on search result page.

pradipmodh13’s picture

For ref attached screenshot what I have did for search close button.

gaurav-mathur’s picture

Applied patch #41 works fine in all media (desktop and mobile) for Drupal version 10.1.x
Refer to the screenshot

We can move to RTBC

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new144 bytes

The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

gauravvvv’s picture

Status: Needs work » Needs review
StatusFileSize
new5.48 KB

Patch #41, no longer applies to 10.1.x. here is a quick re-roll. please review

ravi kant’s picture

Patch #45 is applying to 10.0.9 and 10.1.x. as accepted.

Bushra Shaikh’s picture

Assigned: Unassigned » Bushra Shaikh
Bushra Shaikh’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new73.49 KB
new71.23 KB

Verified and tested patch#45 on Drupal 10.1.X version, Patch applied successfully and looks good to me.

Test Result:
The contrast changed, styled to a light gray X.

Can be moved to RTBC +1

Bushra Shaikh’s picture

Assigned: Bushra Shaikh » Unassigned

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 45: 3153475-45.patch, failed testing. View results

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.

sagarchauhan’s picture

Status: Needs work » Needs review

Random test failure. Moving to RTBC again.

sagarchauhan’s picture

Status: Needs review » Reviewed & tested by the community
quietone’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs work

The issue summary here is very brief but easy to understand what is being changed. I did add the template in case it is needed.

I read through the comments and found an item that has not been responded to, #25.1. I am adding that as a remaining step in the issue summary.

Setting NW for the point to be addressed.

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.

quietone’s picture

Status: Needs work » Postponed

The Olivero theme was approved for removal in #3590816: [policy, no patch] Deprecate Olivero and move to contrib.

This is Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.

The deprecation work is in #3595082: [meta] Tasks to deprecate the Olivero theme and the removal work in #3595085: [meta] Tasks to remove the Olivero theme.

quietone’s picture

Project: Drupal core » Olivero
Version: main » 2.0.0
Component: Olivero theme » Code
Status: Postponed » Needs work
quietone’s picture

Version: 2.0.0 » 2.x-dev