Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve appearance of <select> elements in Safari #515

Merged
merged 1 commit into from
Nov 3, 2021

Conversation

matthew-white
Copy link
Member

@matthew-white matthew-white commented Oct 22, 2021

Right now select elements look different in Safari than other browsers. Even within Safari, select elements look different from input elements. Right now in Safari, a select element looks like this:

select_safari_default

In Chrome, it looks like:

select_chrome

Firefox:

select_firefox

After this change, Chrome and Firefox will look like the same as now, but Safari will look like this:

select_safari_none

Comment on lines +421 to +425
appearance: none;
appearance: auto;
Copy link
Member Author

@matthew-white matthew-white Oct 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have autoprefixing set up, so the -webkit- property will also be specified.

The goal is to specify -webkit-appearance: none; for Safari while still specifying appearance: auto; for Chrome and Firefox. One challenge is that Chrome and Firefox both pay attention to -webkit-appearance. Safari doesn't support auto, so it will ignore the second appearance and end up with none.

We could also specify appearance: none; for all browsers. That would have the effect of removing the chevron that's shown to the right of the select element in Chrome and Firefox (those browsers add the chevron).

Comment on lines -1750 to -1751
-webkit-appearance: none;
-moz-appearance: none;
Copy link
Member Author

@matthew-white matthew-white Oct 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have autoprefixing set up, so these properties don't need to be specified.

The goal is to specify `-webkit-appearance: none;` for Safari while
still specifying `appearance: auto;` for Chrome and Firefox.

Also removing some unneeded prefixed appearance properties from
Bootstrap CSS.
@matthew-white matthew-white force-pushed the select-appearance-safari branch from 01459d5 to 9efbed2 Compare October 22, 2021 02:43
Copy link
Contributor

@issa-tseng issa-tseng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol

@matthew-white matthew-white merged commit 245f5d3 into master Nov 3, 2021
@matthew-white matthew-white deleted the select-appearance-safari branch November 3, 2021 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants