From 8ca3c6360c1bed9f3da2d925cb83ad584e73bed2 Mon Sep 17 00:00:00 2001 From: Leon Klingele Date: Thu, 11 Jun 2015 15:28:00 +0200 Subject: [PATCH] Move inline CSS to its own file --- bootstrap.file-input.js | 9 --------- demo-style.css | 26 +++++++++++++++++++++++++- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/bootstrap.file-input.js b/bootstrap.file-input.js index 8a566b3..98a9519 100644 --- a/bootstrap.file-input.js +++ b/bootstrap.file-input.js @@ -126,13 +126,4 @@ $.fn.bootstrapFileInput = function() { }; -// Add the styles before the first stylesheet -// This ensures they can be easily overridden with developer styles -var cssHtml = ''; -$('link[rel=stylesheet]').eq(0).before(cssHtml); - })(jQuery); diff --git a/demo-style.css b/demo-style.css index be4c873..2a17b80 100644 --- a/demo-style.css +++ b/demo-style.css @@ -17,4 +17,28 @@ body .navbar .brand { pre.prettyprint { padding: 10px; margin-top: 10px; -} \ No newline at end of file +} + +.file-input-wrapper { + overflow: hidden; + position: relative; + cursor: pointer; + z-index: 1; +} + +.file-input-wrapper input[type=file], +.file-input-wrapper input[type=file]:focus, +.file-input-wrapper input[type=file]:hover { + position: absolute; + top: 0; + left: 0; + cursor: pointer; + opacity: 0; + filter: alpha(opacity=0); + z-index: 99; outline: 0; +} + +.file-input-name { + margin-left: 8px; +} +