Problem/Motivation

To provide a unified and 'app-like' experience we should override default browser styles for select boxes in the offcanvas tray as we have done in seven theme.

Proposed resolution

Style the selects to match the styling of similar elements in the tray like dropbuttons.

Remaining tasks

  • style the selects
  • test cross browser

User interface changes

Selects will be grey with white arrow and 2p corner radius in all browsers.

Before

After

API changes

None

Data model changes

None

CommentFileSizeAuthor
#49 patched_chrome.png47.38 KBtedbow
#49 unpatched_chrome.png45.83 KBtedbow
#48 interdiff-2802457-46-48.txt3.16 KBstarshaped
#48 2802457-48.patch4.21 KBstarshaped
#48 2802457-48-safari.png91.32 KBstarshaped
#48 2802457-48-ff.png93.46 KBstarshaped
#48 2802457-48-chrome.png91.87 KBstarshaped
#46 2802457-46.patch5.97 KBjofitz
#46 interdiff-44-46.txt3.7 KBjofitz
#44 2802457-44.patch5.97 KBjofitz
#38 drupal-8.4-Safari.png50.92 KBVidushi Mehta
#38 drupal-8.4-Firefox.png51.01 KBVidushi Mehta
#38 drupal-8.4-Chrome.png58.07 KBVidushi Mehta
#35 error.jpg123.47 KBVidushi Mehta
#34 2802457-34.patch6.27 KBtkoleary
#30 2802457-30.patch4.13 KBtedbow
#30 interdiff-23-30.txt620 bytestedbow
#29 Screen Shot 2016-12-15 at 11.17.28 AM.png48.23 KBtkoleary
#23 2802457-23.patch3.53 KBVidushi Mehta
#23 Font-size-before-applying-any-patch-firefox.jpg127.3 KBVidushi Mehta
#23 Font-size-before-applying-any-patch-chrome.jpg119.29 KBVidushi Mehta
#23 After-applying-patch-#9-ff.jpg123.9 KBVidushi Mehta
#23 Font-size-chrome.jpg119.86 KBVidushi Mehta
#23 Font-size-firefox.jpg121.96 KBVidushi Mehta
#23 After-applying-patch-#9-chrome.jpg119.28 KBVidushi Mehta
#19 2802457-settings-tray-17.patch4.44 KBtkoleary
#16 interdiff-2802457-settings-tray-9-16.txt0 bytestkoleary
#16 2802457-settings-tray-16.patch6.65 KBtkoleary
#10 settingstray-selects.jpg16.83 KByoroy
#9 2802457-settings-tray-9.patch6.51 KBcorbacho
#7 2802457-settings-tray-6.patch8.36 KBcorbacho
#7 screenshot_select_form.png62.45 KBcorbacho
#5 2802457-settings-tray-5.patch7.73 KBtkoleary
#4 outside_in.select.css_.txt1.2 KBtkoleary
#2 Screen Shot 2016-09-19 at 10.43.29 AM.png39.66 KBtkoleary
#2 Screen Shot 2016-09-19 at 10.43.45 AM.png32.62 KBtkoleary
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tkoleary created an issue. See original summary.

tkoleary’s picture

tkoleary’s picture

Issue summary: View changes
tkoleary’s picture

There is no patch yet until the patch at #2781577: Properly style outside-in off canvas tray lands but anyone who wants to can look test this by applying the patch from #2781577, adding this CSS file, then adding this: @import url("/core/modules/outside_in/css/outside_in.select.css"); to the top of outside-in.theme.css.

Doing it that way ftm instead of adding to libraries.yml because it needs to load last and a function has been added to the module to load the outside-in.theme.css last.

tkoleary’s picture

Status: Active » Needs review
FileSize
7.73 KB

Initial patch

Status: Needs review » Needs work

The last submitted patch, 5: 2802457-settings-tray-5.patch, failed testing.

corbacho’s picture

Status: Needs work » Needs review
FileSize
62.45 KB
8.36 KB

Tested the patch:
* Bug: The test seems to fail because it expects a constant, not a number ? (In this case 200)
* Bug: IE Edge shows the default browser arrow, resulting in 2 arrows (the default and custom ones). See screenshot
* Note: In Chrome now the item shows focused styles (without the patch, there is no visual styles for focused select form). So the patch improves the a11y of the select form.

I created a new patch, that:
Wrong fix: * Adds the CSS_AGGREGATE_AFTER_THEME constant in the interface ( I guess it's the right place? #2807785: Move global constants from *.module files into interfaces
* Adds a new rule to override the default appareance of the selct form for IE11. "appareance:none" doesn't work. The solution is based on ::-ms-expand See http://stackoverflow.com/questions/20163079/remove-select-arrow-on-ie

Status: Needs review » Needs work

The last submitted patch, 7: 2802457-settings-tray-6.patch, failed testing.

corbacho’s picture

Status: Needs work » Needs review
FileSize
6.51 KB

Forget about the comments of test failing. The yml file doesn't need to be touched

yoroy’s picture

Title: Style selects in the offcanvas tray » Style selects in the Settings Tray
Status: Needs review » Needs work
FileSize
16.83 KB

I'm seeing this with the latest patch in simplytest:

- The proposed design seems to use a darker gray
- Font size of the values in the select list seems (too) small

tkoleary’s picture

  1. +++ b/core/modules/outside_in/css/outside_in.form.css
    @@ -38,18 +38,16 @@
    -  max-width: 100%;
    

    We need this for inputs where the default option text is very long so that they dont overflow the edge of the tray. It's the same solution we use for mobile.

  2. +++ b/core/modules/outside_in/css/outside_in.theme.css
    @@ -309,7 +309,7 @@
    -.js .dropbutton-toggle .dropbutton-arrow:hover {
    

    I missed that. Nice catch.

corbacho’s picture

Mhh.. I'm confused. Actually I didn't change any CSS in your patch. Just the fact that I re-rolled the patch on latest code might have "adapted" the patch?. Next time I will upload a interdiff to see better

tkoleary’s picture

@yoroy

- The proposed design seems to use a darker gray
- Font size of the values in the select list seems (too) small

I have another patch that creates both a dark and a light theme for the tray so I pulled the dark styles out of this patch. This one just sets a generic coler that will be overridden by the dark or light CSS file.

On the font size, not sure what's happening there but there's no explicit styling of options in this patch. Maybe it's inheriting from something else?

tkoleary’s picture

@yoroy @corbacho

Ok, from what I can gather, in Firefox 'option' inherits font size from the select which is not the case in chrome. This appears to solve it.

.ui-dialog-offcanvas .form-select option {
    font-size: initial;
}
yoroy’s picture

I was using Firefox indeed.

tkoleary’s picture

Status: Needs work » Needs review
FileSize
6.65 KB
0 bytes

Firefox problem fixed.

tkoleary’s picture

Firefox problem fixed. Ignore interdiff, it's incorrect. The only changes are in lines 120-123.

tkoleary’s picture

@corbacho

Mhh.. I'm confused. Actually I didn't change any CSS in your patch. Just the fact that I re-rolled the patch on latest code might have "adapted" the patch?. Next time I will upload a interdiff to see better

Thanks. I just realized that there was some stuff in the patch introduced accidentally by me. I removed it. Rerolling.

tkoleary’s picture

corbacho’s picture

Status: Needs review » Needs work

The "font-size:initial" rule didn't help. After searching around, and finding other people with the same problem, I arrived to the conclusion that is impossible to alter the font-size of the select options in Firefox and Chrome. For example, try to make "font-size:30px", it won't be applied.

IE is a different case. You can specify "font-size:30px" to the select options in IE and it will work. But IE doesn't support the CSS3 "font-size:initial" property, any version of IE.

So.. I think the best we can do, it's to remove the font-size:initial rule, and let the browser apply his default font-size, without trying to manipulate it. What do you think?

Tested in Firefox/Chrome in OSx. IE 11 in Win 8.1 virtual machine

tkoleary’s picture

@corbacho

If we remove the specific font size attribute introduced here and just let the browser set the size the problem Yoroy pointed out *should* go away.

corbacho’s picture

I think there was no problem at all, Yoroy said the font "seems" small. But actually, I think the screenshot he shows, it's the default Firefox size for select options and you can't change it with CSS. We can't fix it.

If Yoroy, or someone else can confirm my findings, we can move forward, and remove the "font-size" attribute from the patch.

Vidushi Mehta’s picture

@corbacho I've tested applying bigger font size for select options and the font-size is changing in Firefox and Chrome hence working fine for me. Just to make it more clear i've also attached screenshots for the same.

Also, I've tested your #9 patch and it is working fine for me i couldn't find the font size small for select option. For the reference I've attached the screenshots for this as well.

Also, attached screenshots for before applying any patch just to make a check with font-size. Removed the "font-size" attribute and attaching a patch for this as well.

Vidushi Mehta’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 23: 2802457-23.patch, failed testing.

tkoleary’s picture

@Vidushi Mehta

This looks good to me. Not sure why it's not passing tests. @corbacho, any ideas?

tedbow’s picture

Status: Needs work » Needs review

The test failures from #25 are from an unrelated problem. The test are now passing for the issue.

yoroy’s picture

Assigned: tkoleary » Unassigned
Issue tags: +sprint
tkoleary’s picture

Issue summary: View changes
Status: Needs review » Needs work
FileSize
48.23 KB

looks like a regression where we are now losing the down arrow icon in chrome (tested mac)

tedbow’s picture

Status: Needs work » Needs review
FileSize
620 bytes
4.13 KB

I see what happened.

#23 did not create the new file core/misc/icons/787878/chevron-down.svg that was in #19
Could easily just been "git add core/modules/outside" which would not have included "core/misc".

Just be clear this new file was intentional in #19, correct? none the existing *-down.svg files worked.

This patch combines #23 with chevron-down.svg from #19.

Status: Needs review » Needs work

The last submitted patch, 30: 2802457-30.patch, failed testing.

tedbow’s picture

Status: Needs work » Needs review

Retesting. Weird error

21:23:36 An error was encountered while attempting to write https://www.drupal.org/files/issues/2802457-30.patch to /var/lib/drupalci/web/jenkins-default-280861
21:23:36 Execution Error
21:23:36 Error encountered while executing job build step setup:fetch

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.

tkoleary’s picture

I was not able to get the previous patch to apply cleanly in 8.4 which is why no interdiff, but the patch is relatively small in any case.

Vidushi Mehta’s picture

FileSize
123.47 KB

I applied the patch #34 but getting errors. Please see the screenshot attached.

tedbow’s picture

Issue tags: +Needs reroll

@Vidushi Mehta thanks for checking on this issue.

The patch applies for me. It looks like from your error message that you have some of the new files that this patch creates already in your working directory.

Have you applied this patch before? Make sure your git status is clean. If your git status is clean and you are still running into this problem it may mean that you are ignoring untrack files.

tedbow’s picture

Issue tags: -Needs reroll

Whoops actually does not need re-roll

Vidushi Mehta’s picture

@tedbow thank you for making me correct. I've applied the patch #34 again and tested on mac for missing down arrow icon and it's working fine. Find the attached screenshots for ff, chrome and safari.

SKAUGHT’s picture

applied #34 on simplytest.me.
certainly the images from 38 are accurate -- there is no styling to select at this time.

i appreciate the original style inspiration: but is a heavy attempt to alter a form element that most browsers (expect IE) don't like being styled with using a JS replacement [ie: http://selectric.js.org]

i think in the least the patch should make the select element {width:100%} to visually level the flow of elements as seen with (editing menus) with the 'initial visibility level' and 'number to level to display' -- treat all selects to fill the line width.

theming selects (radios and checkboxes) is always full of challenges.

SKAUGHT’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.

tedbow’s picture

Component: outside_in.module » settings_tray.module

Changing to new settings_tray.module component. @drpal thanks for script help! :)

tedbow’s picture

Issue tags: +Needs reroll

Needs reroll at least for changes in #2803375: Rename Outside-in module to "Settings Tray" for real

Also we should figure out if this is still needed because #2826722: Add a 'fence' around settings tray with aggressive CSS reset. may have fixed this

jofitz’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
5.97 KB

Re-rolled.

Status: Needs review » Needs work

The last submitted patch, 44: 2802457-44.patch, failed testing. View results

jofitz’s picture

Status: Needs work » Needs review
FileSize
3.7 KB
5.97 KB

Correct filename from "off_canvas.selects.css" to "off-canvas.selects.css".

tedbow’s picture

Status: Needs review » Needs work

@Jo Fitzgerald thanks for the re-roll!

This is problem with existing patch not the re-roll, there are a bunch of CSS changes that are unrelated to select boxes. These either need to be removed or it is no be clearer what this issue is about.

starshaped’s picture

Status: Needs work » Needs review
FileSize
91.87 KB
93.46 KB
91.32 KB
4.21 KB
3.16 KB

Removed CSS changes unrelated to select boxes. Attached are screenshots from Firefox, Chrome, and Safari showing the select boxes.

tedbow’s picture

Status: Needs review » Needs work
FileSize
45.83 KB
47.38 KB

@starshaped thanks for removing the unrelated CSS!

  1. I noticed in the Menu block. The "Initial Visibility level" select in the unpatched version it is always on the next line from the label

    while in the patched version it is always on the same line

    I tried to resize the tray and it always stayed this way.

    Is this intentional?

  2. From the issue summary

    Selects will be grey with white arrow and 2p corner radius in all browsers.

    But from #13 that look like it was taken out of the patch intentionally.

    I have another patch that creates both a dark and a light theme for the tray so I pulled the dark styles out of this patch.

    I don't think we are going to be doing the light and dark theme any more.

    So we either need to update the IS or if we want add the grey back in.

  3. For me the Firefox image in #48 still looks wrong. But maybe this not possible in FF. Not sure

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

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

Wim Leers’s picture

Do we still want this?

Vidushi Mehta’s picture

@Wim Leers Can you elaborate your question. Not getting the point.

Version: 8.6.x-dev » 8.7.x-dev

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

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

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

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

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

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

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.

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.

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.