Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap-sass.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Mazovetskiy <glex.spb@gmail.com>2014-07-12 19:22:15 +0400
committerGleb Mazovetskiy <glex.spb@gmail.com>2014-07-12 19:22:15 +0400
commitbbda75fb7fc6b49c8264866aa6ae670dd49bbbbb (patch)
treeb157688f7cf4439fa1f43e4eaa0c475165d37028
parent1a3726a7f97b6b7268aa02de07a81eddb1a0c6f2 (diff)
$icon-font-path fallback to relative for pure Sass
Refs #650 #662
-rw-r--r--README.md4
-rw-r--r--assets/stylesheets/bootstrap/_variables.scss5
-rw-r--r--tasks/converter/less_conversion.rb7
3 files changed, 12 insertions, 4 deletions
diff --git a/README.md b/README.md
index f9dffc96..4bb4bbfe 100644
--- a/README.md
+++ b/README.md
@@ -196,9 +196,9 @@ The fonts are referenced as:
"#{$icon-font-path}#{$icon-font-name}.eot"
```
-`$icon-font-path` defaults to `bootstrap/`.
+`$icon-font-path` defaults to `bootstrap/` if asset path helpers are used, and `../fonts/bootstrap/` otherwise.
-When using with Compass, Sprockets, or Mincer, make sure to import the relevant path helpers before Bootstrap itself, for example:.
+When using bootstrap-sass with Compass, Sprockets, or Mincer, you **must** import the relevant path helpers before Bootstrap itself, for example:
```scss
@import "bootstrap-compass";
diff --git a/assets/stylesheets/bootstrap/_variables.scss b/assets/stylesheets/bootstrap/_variables.scss
index e3dcc368..9049d460 100644
--- a/assets/stylesheets/bootstrap/_variables.scss
+++ b/assets/stylesheets/bootstrap/_variables.scss
@@ -77,7 +77,10 @@ $headings-color: inherit !default;
//## Specify custom location and filename of the included Glyphicons icon font. Useful for those including Bootstrap via Bower.
//** Load fonts from this directory.
-$icon-font-path: "../fonts/bootstrap/" !default;
+
+// [converter] Asset helpers such as Sprockets and Node.js Mincer do not resolve relative paths
+$icon-font-path: if($bootstrap-sass-asset-helper, "bootstrap/", "../fonts/bootstrap/") !default;
+
//** File name for all font files.
$icon-font-name: "glyphicons-halflings-regular" !default;
//** Element ID within SVG icon file.
diff --git a/tasks/converter/less_conversion.rb b/tasks/converter/less_conversion.rb
index b3841d42..5dddfcfa 100644
--- a/tasks/converter/less_conversion.rb
+++ b/tasks/converter/less_conversion.rb
@@ -94,7 +94,12 @@ class Converter
// in Sass 3.3 this can be improved with: function-exists(twbs-font-path)
$bootstrap-sass-asset-helper: (twbs-font-path("") != unquote('twbs-font-path("")')) !default;
SCSS
- file = replace_all file, /(\$icon-font-path:\s+".*)(" !default)/, '\1bootstrap/\2'
+ file = replace_all file, %r{(\$icon-font-path): \s*"(.*)" (!default);}, <<-SCSS
+
+// [converter] Asset helpers such as Sprockets and Node.js Mincer do not resolve relative paths
+\\1: if($bootstrap-sass-asset-helper, "bootstrap/", "\\2bootstrap/") \\3;
+SCSS
+ '\1: if($bootstrap-sass-asset-helper, "bootstrap/", "\2bootstrap/")\3'
when 'close.less'
# extract .close { button& {...} } rule
file = extract_nested_rule file, 'button&'