Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Search form block enabled in header region of Bartik Theme does not show the typed text.
The entered search text in the Search form block does not display, seems the font color is set to white due to which the typed text does not appear. This only happens when the Search form block is enabled in header section.
Proposed resolution
# Add correct color, #000000, so that the typed text is visible.
Remaining tasks
User interface changes
Before patch:
After applying patch:
API changes
None
Comment | File | Size | Author |
---|---|---|---|
#15 | search_before.png | 11.94 KB | Rade |
#13 | 2281451-screenshot.png | 105.4 KB | olav |
#11 | bartik_search_form_header-2281451-11.patch | 378 bytes | nathanlawsn |
#7 | Welcome_to_sdcb4ed4bfd19125_s2_simplytest_me___sdcb4ed4bfd19125_s2_simplytest_me.jpg | 301.41 KB | Rick Hood |
#6 | bartik_search_form_header-2281451-6.patch | 411 bytes | Mukeysh |
Comments
Comment #1
a_thakur CreditAttribution: a_thakur commentedComment #2
Mukeysh CreditAttribution: Mukeysh commentedPlease find the patch which fixes the issue.
Comment #3
dervishmoose CreditAttribution: dervishmoose commentedAdding form text and form search to this class produces a more useable search box, but causes issues. Suggest a simple .region-header .form-search {
color: #000000;
}
Comment #4
dervishmoose CreditAttribution: dervishmoose commentedAdded
.region-header .form-search {
color: #000000;
}
Comment #5
dervishmoose CreditAttribution: dervishmoose commentedFixed patch
Comment #6
Mukeysh CreditAttribution: Mukeysh commentedThe color should be #3b3b3b as in the other forms. Please find the patch which fixes this issue.
Comment #7
Rick Hood CreditAttribution: Rick Hood commentedConfirming I get #3b3b3b; for text in search.
Comment #8
Rick Hood CreditAttribution: Rick Hood commentedComment #9
alexpottThis also occurs if you put the search block in the footer region. And this would also occur with any other forms... eg if you move the login form into the header - well that actually uses the
.region-header .form-text
. Anyhow I think this issue indicates we have a bigger problem with places forms in the header and footer regions of bartik.EDIT: fix code block
Comment #10
nathanlawsn CreditAttribution: nathanlawsn commentedComment #11
nathanlawsn CreditAttribution: nathanlawsn commentedSubmitting patch which fixes the issue.
Comment #12
criscomGoing to test the patch.
Comment #13
olav CreditAttribution: olav commentedThe patch applied cleanly for me.
It even does the right thing -
Comment #14
Rade CreditAttribution: Rade commentedI also tested this and the latest patch works fine. Agreeing with the RTBC.
Comment #15
Rade CreditAttribution: Rade commentedComment #16
yanniboi CreditAttribution: yanniboi commentedThe patch in number 11 addresses @alexpott's concern about region specific text. The color of the text in the form element does not have a sensible default which is why the color of a region impacts it (eg. white in header). The new patch sets a default color on form elements. Since the default for form element backgrounds is white everywhere on the site, grey is a good default for the color and will not have any negative side effects elsewhere.
The color #3b3b3b that was chosen to be the default was chosen because that is the color of the text in other regions (eg. first sidebar or content).
Comment #17
emma.mariaBefore the search element was moved to the header it was using #3b3b3b as the text color.
Therefore it should keep this colour in the header and the most recent patch contains this.
110% agree with RTBC, great work @nathanlawson91!
Comment #18
alexpottCommitted 67af636 and pushed to 8.0.x. Thanks!
Thanks for addressing my concerns.