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

Cross-browser compatible styling for input[type=file] #5424

Merged
merged 2 commits into from
Apr 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@
* If there are other assets (which are not in this file) that are being precompiled by
* 'stylesheet_link_tag' command in views, then add them on /config/initializers/assets.rb


*= require bootstrap/dist/css/bootstrap.min.css
*= require bootstrap-datepicker/dist/css/bootstrap-datepicker3.css
*= require jquery-file-upload/css/jquery.fileupload-ui.css
*= require leaflet/dist/leaflet.css
*= require_self
*= require cross_browser
*= require style
*= require feature
*= require btsp_checkbox_override
Expand Down
14 changes: 14 additions & 0 deletions app/assets/stylesheets/cross_browser.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
================================================================
Copy link
Member

Choose a reason for hiding this comment

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

Really awesome!

We can start using this file to document and fix all cross-browser inconsistencies
we find in one place
================================================================
*/


/* Firefox ignores line-height for input[type="file"] but Chrome doesn't and the result
with Bootstrap styling is it gets misaligned in Chrome. This fix is confirmed to create
compatible alignment in Chrome, Safari, and Firefox in MacOS */
input[type="file"] {
line-height: 0 !important;
}