Skip to content

Commit

Permalink
glyphicons asset-url
Browse files Browse the repository at this point in the history
  • Loading branch information
glebm committed May 28, 2013
1 parent 5525d66 commit 40534b5
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 22 deletions.
34 changes: 19 additions & 15 deletions asseturl.patch
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
diff --git a/vendor/assets/stylesheets/_variables.scss b/vendor/assets/stylesheets/_variables.scss
index e29dc59..85f4d56 100644
--- a/vendor/assets/stylesheets/_variables.scss
+++ b/vendor/assets/stylesheets/_variables.scss
@@ -151,8 +151,8 @@ $zindexModal: 1050 !default;

// Sprite icons path
// -------------------------
-$iconSpritePath: "../img/glyphicons-halflings.png" !default;
-$iconWhiteSpritePath: "../img/glyphicons-halflings-white.png" !default;
+$iconSpritePath: image-path("glyphicons-halflings.png") !default;
+$iconWhiteSpritePath: image-path("glyphicons-halflings-white.png") !default;


// Input placeholder text color
diff --git a/vendor/assets/stylesheets/bootstrap/_glyphicons.scss b/vendor/assets/stylesheets/bootstrap/_glyphicons.scss
index b7dbdb6..ebcf0f4 100644
--- a/vendor/assets/stylesheets/bootstrap/_glyphicons.scss
+++ b/vendor/assets/stylesheets/bootstrap/_glyphicons.scss
@@ -21,11 +21,11 @@
// Import the fonts
@font-face {
font-family: 'Glyphicons Halflings';
- src: url('#{$glyphicons-font-path}/glyphiconshalflings-regular.eot');
- src: url('#{$glyphicons-font-path}/glyphiconshalflings-regular.eot?#iefix') format('embedded-opentype'),
- url('#{$glyphicons-font-path}/glyphiconshalflings-regular.woff') format('woff'),
- url('#{$glyphicons-font-path}/glyphiconshalflings-regular.ttf') format('truetype'),
- url('#{$glyphicons-font-path}/glyphiconshalflings-regular.svg#glyphicons_halflingsregular') format('svg');
+ src: url(font-path("#{$glyphicons-font-path}/glyphiconshalflings-regular.eot"));

This comment has been minimized.

Copy link
@etienne

etienne Jun 3, 2013

Contributor

If I'm not mistaken, font-path() is specific to the Rails assets pipeline and is not part of CSS. It shouldn't be here.

This comment has been minimized.

Copy link
@thomas-mcdonald

thomas-mcdonald Jun 3, 2013

Member

Icon font compatibility with Rails & Compass - modify functions as appropriate

We define an image-path function that is used for Compass/Sprockets applications, we're going to do the same (soon) so font--path works on Compass.

This comment has been minimized.

Copy link
@etienne

etienne Jun 3, 2013

Contributor

OK thanks, I missed that.

+ src: url(font-path("#{$glyphicons-font-path}/glyphiconshalflings-regular.eot?#iefix")) format('embedded-opentype'),
+ url(font-path("#{$glyphicons-font-path}/glyphiconshalflings-regular.woff")) format('woff'),
+ url(font-path("#{$glyphicons-font-path}/glyphiconshalflings-regular.ttf")) format('truetype'),
+ url(font-path("#{$glyphicons-font-path}/glyphiconshalflings-regular.svg#glyphicons_halflingsregular")) format('svg');
}
4 changes: 2 additions & 2 deletions update-bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ cp -r $TMP/img/* $ROOT/images
rm -r $ROOT/javascripts/tests
rm -r $ROOT/stylesheets/bootstrap/tests

# Patch the asset-url in _variables.scss
patch -f vendor/assets/stylesheets/bootstrap/_variables.scss < asseturl.patch
# Patch the asset-url in _glyphicons.scss
patch -f vendor/assets/stylesheets/bootstrap/_glyphicons.scss < asseturl.patch

# Patch paths in bootstrap.scss and responsive.scss
sed -i .bak 's_@import \"_@import \"bootstrap/_g' $ROOT/stylesheets/bootstrap/{bootstrap,responsive}.scss
Expand Down
10 changes: 5 additions & 5 deletions vendor/assets/stylesheets/bootstrap/_glyphicons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
// Import the fonts
@font-face {
font-family: 'Glyphicons Halflings';
src: url('#{$glyphicons-font-path}/glyphiconshalflings-regular.eot');
src: url('#{$glyphicons-font-path}/glyphiconshalflings-regular.eot?#iefix') format('embedded-opentype'),
url('#{$glyphicons-font-path}/glyphiconshalflings-regular.woff') format('woff'),
url('#{$glyphicons-font-path}/glyphiconshalflings-regular.ttf') format('truetype'),
url('#{$glyphicons-font-path}/glyphiconshalflings-regular.svg#glyphicons_halflingsregular') format('svg');
src: url(font-path("#{$glyphicons-font-path}/glyphiconshalflings-regular.eot"));
src: url(font-path("#{$glyphicons-font-path}/glyphiconshalflings-regular.eot?#iefix")) format('embedded-opentype'),
url(font-path("#{$glyphicons-font-path}/glyphiconshalflings-regular.woff")) format('woff'),
url(font-path("#{$glyphicons-font-path}/glyphiconshalflings-regular.ttf")) format('truetype'),
url(font-path("#{$glyphicons-font-path}/glyphiconshalflings-regular.svg#glyphicons_halflingsregular")) format('svg');
}

// Catchall baseclass
Expand Down

0 comments on commit 40534b5

Please sign in to comment.