Skip to content

Commit

Permalink
Cross-browser compatible styling for input[type=file] (publiclab#5424)
Browse files Browse the repository at this point in the history
* Apply styling

* Add comments
  • Loading branch information
sashadev-sky authored and digitaldina committed May 12, 2019
1 parent 20c4fd0 commit 7a706a1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
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 @@
/*
================================================================
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;
}

0 comments on commit 7a706a1

Please sign in to comment.