Previously discovered in https://www.drupal.org/node/2524284 - the select list form element on Firefox looks un-styled or ugly / dated.

To see it in action in Bartik:

  1. Create a new content e.g. basic page, save and publish
  2. Edit the content and click on "preview"
  3. See the select list at the top

bartik select list firefox

Another select list can be tested in the contact form by creating a new select field:

bartik contact form firefox

The expected look can be seen in Seven theme or Drupal.org:

select list in Seven

CommentFileSizeAuthor
#74 interdiff-2674292-66-74.txt297 bytesstarshaped
#74 2674292-74.patch625 bytesstarshaped
#66 2674292-66-firefox53-form-textarea-seven.png51.81 KBstarshaped
#66 2674292-66-firefox53-form-text-seven.png11.43 KBstarshaped
#66 2674292-66-firefox53-form-select-bartik.png101.69 KBstarshaped
#66 interdiff-2674292-63-66.txt364 bytesstarshaped
#66 2674292-66.patch1.03 KBstarshaped
#63 interdiff-2674292-57-63.txt717 bytesstarshaped
#63 2674292-63.patch992 bytesstarshaped
#63 2674292-63.png96.59 KBstarshaped
#58 2674292-58.png99.1 KBstarshaped
#57 select_form_element-2674292-56.patch1.4 KBtim.clifford
#50 select_form_element-2674292-50.patch1.4 KBtim.clifford
#48 Chrome-node-2674292.jpeg258.15 KBtim.clifford
#48 Firfox-node-2674292.jpeg194.97 KBtim.clifford
#48 select_form_element-2674292-48.patch194.67 KBtim.clifford
#43 Issues_FF.png9.66 KBmanjit.singh
#43 issue_chrome.png3.14 KBmanjit.singh
#43 Chrome_after.png7.39 KBmanjit.singh
#43 FF_after.png7.38 KBmanjit.singh
#41 select_form_element-2674292-36.patch861 bytesmukeshmukesh12
#41 select_after_appling_patch.png32.61 KBmukeshmukesh12
#35 select_form_element-2674292-35.patch766 bytesnesta_
#35 interdiff-2674292-29-35.txt470 bytesnesta_
#35 chrome_bartik_osx.png55.27 KBnesta_
#34 bartik_firefox_osx.png32.98 KBnesta_
#34 bartik_chrome_osx.png55.79 KBnesta_
#34 firefox_linux.png97.68 KBnesta_
#34 chrome_linux.png125.73 KBnesta_
#33 firerfox_osx.png76.22 KBnesta_
#33 chrome.png75.13 KBnesta_
#29 drupal-select_box_un_styled_ff-2674292-29.patch725 bytesshiva srikanth t
#29 interdiff-2674292-15-29.txt371 bytesshiva srikanth t
#28 FF2.png182.38 KBemma.maria
#28 FF1.png253.02 KBemma.maria
#28 Chrome2.png165.54 KBemma.maria
#28 Chrome1.png101.09 KBemma.maria
#25 drupal-select-box-un-styled-ff-2674292-15.patch704 bytesalamowo
#14 drupal-select-box-un-styled-ff-2674292-14.patch447 bytesshiva srikanth t
#12 2674292_admin-content-ff.png61.97 KBironkiat
#12 2674292_contact-form-ff.png38.55 KBironkiat
#7 interdiff.txt484 byteskostyashupenko
#7 select_form_element-2674292-6.patch949 byteskostyashupenko
#7 selectboxes-in-ff.png30.64 KBkostyashupenko
#7 changes-of-borders.png17.1 KBkostyashupenko
#5 Website_feedback___D8_Contrib 2.png64.58 KBironkiat
#5 Website_feedback___D8_Contrib.png71.05 KBironkiat
#4 drupal-select-box-un-styled-ff-2674292-4.patch635 bytesshiva srikanth t
#2 Content___D8_Contrib.png39.8 KBironkiat
d8-seven-select-list.png22.78 KBironkiat
d8-bartik-contact-form-firefox.png36.08 KBironkiat
d8-bartik-select-list-firefox.png72.4 KBironkiat

Comments

ironkiat created an issue. See original summary.

ironkiat’s picture

Issue summary: View changes
StatusFileSize
new39.8 KB
ironkiat’s picture

Title: Style the select form element on Firefox » Select form element looks un-styled on Firefox
shiva srikanth t’s picture

Assigned: Unassigned » shiva srikanth t
Status: Active » Needs review
StatusFileSize
new635 bytes

I have fixed this issue in my local, I am attaching patch file.

ironkiat’s picture

Status: Needs review » Needs work
StatusFileSize
new71.05 KB
new64.58 KB

Hey tshivasrikanth, thanks for picking this up! I've tested it on a contact form page where I created an extra field for dropdown, here's how it looks:

d8 contact form with drop down firefox

Notice the normal text fields for name and email address has that inner shadow?

I would suggest to just remove:

select.form-select

while keeping the other input elements to still have border and color.

The result should be something like this:

ideal form element

Thanks!

shiva srikanth t’s picture

Status: Needs work » Needs review
StatusFileSize
new447 bytes

Updated patch for the issue.

kostyashupenko’s picture

StatusFileSize
new17.1 KB
new30.64 KB
new949 bytes
new484 bytes

Check my screen below about selectboxes in FF for Bartik theme. This is how it looks for now on 8.1.x. Not sure about how it should looks?

Selectboxes in my ubuntu FF v44.0.2
selectboxes-ff

Was noticed about bad inner borders for some fields. This patch will fix this issue
After my changes for #edit-name and #edit-mail fields related to inner borders
borders

ironkiat’s picture

Status: Needs review » Needs work

Hey @kostyashupenko, thanks for this, when you say ubuntu FF for the select field, is it before or after applying the patch #4?

If it's after applying patch #4, then I would think it's correct, would you be able to upload one before applying the patch to see how it looks like on Ubuntu FF by default?

On the patch you submitted, I do not think we should style the fields in the contact form specifically. As mention in my comment on comment #5, it might be just as simple as removing the .form-select only.

shiva srikanth t’s picture

@ironkiat
I have uploaded the correct path in #6 which is working fine.

@kostyashupenko
if you are uploading a new patch, your patch number should be with respect to your comment number. may i know the reason why you deleted drupal-select-box-un-styled-ff-2674292-6.patch file from the files list.

chx’s picture

There's a misunderstanding here: kostyashupenko did not delete your patch just hidden it -- it's customary to only show the last patch under the issue summary to make it easier to review. If you click the relevant fieldset in #7 you will see that your patch is still there, together with its test result. They couldn't delete anyways and if you check the "git command" box below you see you will be credited when this patch gets in.

chx’s picture

On the other hand, @kostyashupenko please post a review next time and respect the issue being assigned to tshivasrikanth . Yes sometimes taking over an issue is necessary -- either the assigned just wandered off and there's nothing happening any more or the patch is so broken that a review would be longer than fixing it. Neither of these are the case here. Please let tshivasrikanth finish this issue.

ironkiat’s picture

Status: Needs work » Needs review
StatusFileSize
new38.55 KB
new61.97 KB

Hey @tshivasrikanth, thanks! The patch in #6 works, I've tested it FF on Mac, perhaps anyone who has a Ubuntu or Windows can help test the patch as well on FF?

contact form in firefox mac

admin content listing in ff

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

shiva srikanth t’s picture

StatusFileSize
new447 bytes

Updated patch for the branch 8.2.x-dev

shiva srikanth t’s picture

ironkiat’s picture

Status: Needs review » Reviewed & tested by the community

Looking good!

emma.maria’s picture

star-szr’s picture

Version: 8.2.x-dev » 8.1.x-dev

I don't see the harm in including this in 8.1.x so putting back there at least tentatively. For what it's worth the patch in #14 at least applies to 8.1.x.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 14: drupal-select-box-un-styled-ff-2674292-14.patch, failed testing.

droplet’s picture

Chrome is a Winner in Drupal!! haha. Reminded me the awful looks in IE.

+++ b/core/themes/bartik/css/components/form.css
@@ -100,8 +100,7 @@ input.form-search,
   color: #3b3b3b;

still same color, right ?

emma.maria’s picture

Version: 8.1.x-dev » 8.2.x-dev
Category: Task » Feature request
Issue tags: -bartik theme +CSS

I'm setting this as a 'Feature Request' as there are currently intentional styles set in Bartik for form elements, nothing is actually "unstyled" they are actually overridden.
I was not part of that decision making, but as maintainer I'm going to go poke into this reasoning further.

emma.maria’s picture

Assigned: emma.maria » Unassigned

The form elements are designed to be grey in Bartik so the grey select styling needs to stay.

However(!)....The exact same scenario came up in the Seven theme. The only browser that used the CSS only select styling correctly were Webkit ones, so we dropped styling support for every other browser and made the styles Webkit specific.

So the plan forward is that we make the select.form-select styles Webkit only styling which will allow Firefox to look less dreadful.

Here is the Seven issue for reference... #2207391: Style select elements in Webkit only.

emma.maria’s picture

Issue tags: -Firefox +webkit, +frontend
tstoeckler’s picture

Issue tags: +DrupalBCDays
alamowo’s picture

Assigned: Unassigned » alamowo
StatusFileSize
new704 bytes

Hey I just took patch #14 and added the same appraoch taken in #2207391: Style select elements in Webkit only.

It's making the webkit a bit more look like we want it and keeps other browsers untouched.

@emma.maria ist that what we were looking for?

emma.maria’s picture

Hi @alamowo. I haven't looked at the patch test but we want to set the styles we currently have for select elements in Bartik right now in core, to be set for only WebKit browsers.

emma.maria’s picture

Assigned: alamowo » Unassigned
Status: Needs work » Needs review
emma.maria’s picture

Issue summary: View changes
Status: Needs review » Needs work
StatusFileSize
new101.09 KB
new165.54 KB
new253.02 KB
new182.38 KB

Thanks @alamowo for the patch!

Bartik now assigns select styling only to Webkit browsers
 

 

 
and
Firefox and other non-Webkit browsers now use the default browser select styling...
 

 

 

However I noticed one small thing that you have missed....

+++ b/core/themes/bartik/css/components/form.css
@@ -92,6 +92,11 @@ textarea.form-textarea,
+@media screen and (-webkit-min-device-pixel-ratio: 0) {
+  select.form-select {
+    border: 1px solid #ccc;
+  }
+}
 input.form-text,
 input.form-tel,
 input.form-email,
@@ -100,8 +105,7 @@ input.form-search,

@@ -100,8 +105,7 @@ input.form-search,
 input.form-file,
 input.form-number,
 input.form-color,
-textarea.form-textarea,
-select.form-select {
+textarea.form-textarea {
   border: 1px solid #ccc;
   color: #3b3b3b;
 }

Can you add the color: #3b3b3b; style also to the Webkit select element please? Thanks!

shiva srikanth t’s picture

StatusFileSize
new371 bytes
new725 bytes

Added the color: #3b3b3b; style to the Webkit select element.

shiva srikanth t’s picture

Status: Needs work » Needs review
emma.maria’s picture

Issue tags: +DrupalCampES
nesta_’s picture

@sskt Due to an error "500" in version "8.2.x" I can not review it. As I can do.
---> composer install

i'm reviewing :)

nesta_’s picture

Status: Needs review » Needs work
StatusFileSize
new75.13 KB
new76.22 KB

After applying the patch, issue #29. In the select Chrome have a pixel height less than the inputs.
chrome

But in Chrome (linux) works fine
chrome linux

In Firefox (osx) and Firefox (linux) looks small.
firefox_osx
firefox linux

For Bartik Theme is the same.

Bartik chrome
bartik_firefox_osx

change status -> Needs Work

nesta_’s picture

StatusFileSize
new125.73 KB
new97.68 KB
new55.79 KB
new32.98 KB
nesta_’s picture

Status: Needs work » Needs review
StatusFileSize
new55.27 KB
new470 bytes
new766 bytes

Add patch to fix Chrome osx Select Box.

bartik select height

nesta_’s picture

@emma.maria please i would like to talk with you for this issue.

nesta_’s picture

Assigned: Unassigned » nesta_
nesta_’s picture

Assigned: nesta_ » Unassigned

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

joelpittet’s picture

Assigned: Unassigned » emma.maria
Status: Needs review » Needs work
Issue tags: -Novice +Needs subsystem maintainer review

This could really use Emma's eyes

  1. +++ b/core/themes/bartik/css/components/form.css
    @@ -92,6 +92,14 @@ textarea.form-textarea,
    +    height: 27px;
    

    Why 27px specifically? It's not used anywhere else in Bartik

  2. +++ b/core/themes/bartik/css/components/form.css
    @@ -92,6 +92,14 @@ textarea.form-textarea,
    +    margin-top: 1px;
    

    Not sure why this 1px is needed, probably should have a comment explanation.

mukeshmukesh12’s picture

Status: Needs work » Needs review
StatusFileSize
new32.61 KB
new861 bytes

please review my patch is it working fine. I 've tested and also attach screen shot

droplet’s picture

Issue tags: +Quick fix, +Novice
manjit.singh’s picture

Status: Needs review » Needs work
StatusFileSize
new7.38 KB
new7.39 KB
new3.14 KB
new9.66 KB

@Mukesh: Changes that you have done in last patch are working as per the expectations. Please check the screenshots that i have captured after applying the patch.

chomre

Firefox

But one issue that i have noticed that the height of selectboxes in chrome (Linux). And one other issue is in FF, The alignment of textboxes and selectboxes is not correct. Please check screenshots.

chomre

chomre

kostyashupenko’s picture

checking this thing

kostyashupenko’s picture

Assigned: emma.maria » kostyashupenko
kostyashupenko’s picture

Assigned: kostyashupenko » Unassigned

can't reproduce these screens

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

tim.clifford’s picture

StatusFileSize
new194.67 KB
new194.97 KB
new258.15 KB

Because Webkit & Mozilla Firefox rendering engines implement line height differently - we get different results as seen in the screenshots.

We have to explicitly set the line-height and use padding to make them behave the same way.

#57 patch with DCS fix and Screenshots.

tim.clifford’s picture

tim.clifford’s picture

StatusFileSize
new1.4 KB

Re-adding patch #50

tim.clifford’s picture

Status: Needs work » Needs review
tim.clifford’s picture

tim.clifford’s picture

Issue tags: +MicroserveSprint
kiwimind’s picture

+++ b/core/themes/bartik/css/components/form.css
@@ -112,8 +111,8 @@ input.form-search,
+ {

This should be on line above.

kiwimind’s picture

Oh, sorry, that's terrible feedback. There's a curly brace that should be at the end of the line preceding it.

Thanks for the patch.

kiwimind’s picture

+++ b/core/themes/seven/css/components/form.css
@@ -189,6 +188,12 @@ textarea.form-textarea {
+@media screen and (-webkit-min-device-pixel-ratio:0) {

Sorry, think there should be a space after the colon here too.

tim.clifford’s picture

StatusFileSize
new1.4 KB

DCS fixes added.

starshaped’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new99.1 KB

I tested this in Firefox 53 and the changes look good to me. Screenshot attached.

larowlan’s picture

+++ b/core/themes/bartik/css/components/form.css
@@ -112,8 +111,8 @@ input.form-search,
+textarea.form-textarea
+ {

{ should be on same line

star-szr’s picture

Looks like #59 has been addressed in the patch in #57.

@tim.clifford thanks for the updated patch! Providing an interdiff is very useful to reviewers.

wim leers’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/themes/seven/css/components/form.css
@@ -189,6 +188,12 @@ textarea.form-textarea {
+@media screen and (-webkit-min-device-pixel-ratio: 0) {

This is WebKit-specific. Let's also support other browsers.

A quick web search led me to https://www.w3.org/blog/CSS/2012/06/14/unprefix-webkit-device-pixel-ratio/.

Oh… apparently we want to do this in a WebKit-specific way! Fine, but then we need to document it as such.

phenaproxima’s picture

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

Okay, so...I'm trying to help @starshaped get this patch done, but something is weirding me out.

As far as I can tell, the line-height fix in #50 doesn't seem to have to anything to do with the original issue, which is fixed by the patch in #48. I'm not saying it's something that shouldn't be fixed, just that it seems to be out-of-scope.

It seems to me that #48 is good to go as-is, and we should open a follow-up issue to fix the line-height thing. So I'm marking this as needing review for #48, and needing a follow-up.

starshaped’s picture

StatusFileSize
new96.59 KB
new992 bytes
new717 bytes

As per phenaproxima's comment in #62, I re-rolled this without the line height changes. Screenshot attached from Firefox 53.

aaronchristian’s picture

Hey all, had a look at the comments and latest patch.

Just confirming that the patch fixes the issue in firefox with the spacing. Did regression testing and couldn't find any problems with the patch (small changes as is).

Before:

bartik select list firefox

After:

bartik select list firefox

In Scope:

The line-height fix should be included as it sets the standard across the different rendering engines.

Out of Initial Scope:

-webkit-device-pixel-ratio is a non-standard boolean CSS media feature which is an alternative to the standard resolution media feature.

More information can be found here; https://developer.mozilla.org/en-US/docs/Web/CSS/@media/-webkit-device-p...

phenaproxima’s picture

Status: Needs review » Needs work

Okay, then let us re-roll the patch with the line-height fix. Thanks for the review, @AaronChristian!

starshaped’s picture

Status: Needs work » Needs review
StatusFileSize
new1.03 KB
new364 bytes
new101.69 KB
new11.43 KB
new51.81 KB

Re-rolled as per AaronChristian's comment. Attached are 3 screenshots from Firefox 53, one of the fixed select in Bartik, the other two of the input text field and textarea with the fixed line-height in Seven.

aaronchristian’s picture

Looks great @starshaped!

Thanks for that small addition & all the screenshots.

Unless opposed I'd like to mark this as RTBC.

phenaproxima’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs followup

If it's been reviewed and tested by a community member who's not the patch author, and it looks good, it's RTBC by definition :) Thanks, @AaronChristian and @starshaped!

kiwimind’s picture

Yep, looks good. Thanks starshaped and tim.clifford.

Great work with the screenshots and timely responses.

Seconding the RTBC.

yoroy’s picture

Thanks all, this is a nice improvement. I double checked on simplytest and yes, this does make the select list look a lot better in Firefox.

I've updated the commit credits, this is ready to commit.

star-szr’s picture

Title: Select form element looks un-styled on Firefox » Remove styling of select elements (improves appearance in Firefox)
Category: Feature request » Task
Status: Reviewed & tested by the community » Needs review

I don't follow why this needs to update Seven's CSS. I don't understand the argument made in #64. Other than that one change to Seven, this patch looks ready to go. So I would tend to agree with @phenaproxima's proposed direction in #62, let's get the straightforward change in and discuss the other issue separately.

Thanks everyone for the efforts here!

yoroy’s picture

Status: Needs review » Needs work

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

starshaped’s picture

Status: Needs work » Needs review
StatusFileSize
new625 bytes
new297 bytes

Finally went ahead and removed the line-height update as suggested in #71. Now this patch should be ready to go! :)

joelpittet’s picture

Status: Needs review » Reviewed & tested by the community

That looks RTBC, not touching Seven, only bartik.

lauriii’s picture

Status: Reviewed & tested by the community » Fixed

Committed 24959f6 and pushed to 8.5.x. Thanks!

  • lauriii committed 24959f6 on 8.5.x
    Issue #2674292 by starshaped, tim.clifford, sskt, nesta_, kostyashupenko...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.