Skip to content

Commit

Permalink
fix(pivotal-ui-rails): use 'font-url', not 'asset-url' for font paths
Browse files Browse the repository at this point in the history
This reverts commit 836594f.

- Previously, we thought that font-url created a compass dependency. It
  does not. 'font-url' is a rails asset pipeline helper

[Fixes #85540054]

Signed-off-by: Geoff Pleiss <gpleiss@pivotal.io>
  • Loading branch information
bebepeng authored and Geoff Pleiss committed Jan 6, 2015
1 parent 30db5ba commit 04f38d8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ You'll need to maintain the structure in the release directory to have fonts and

If you're installing PivotalUI into a Rails project, you should unzip the constituent files into a directory named `vendor/assets/pui-vX.X.X`.

When linking to the CSS file in your HTML/Sass, link to `pivotal-ui-rails.css` instead of the top-level `pivotal-ui.css`.
In your `application.scss` file, add the line `@import "pivotal-ui-rails"`

In your `application.js` file, add the line `//= require pivotal-ui` as **the very first** require declaration.

Lastly, in your application's `config/application.rb`, you'll need to add the following to make sure all vendored files are properly compiled:

```
config.assets.paths << Rails.root.join('vendor', 'assets', 'pui-vX.X.X', 'images')
config.assets.precompile << /\.(?:svg|eot|woff|ttf)\z/
config.assets.precompile += %w( pivotal-ui-rails.css pivotal-ui.js )
```

# Including SCSS variables (optional, beta)
Expand Down
4 changes: 2 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ gulp.task('_compassBuildPui', ['_cleanBuiltPuiScss'], function() {
gulp.task('_compassBuildPuiRails', ['_cleanBuiltPuiScss', '_compassBuildPui'], function() {
return gulp.src('build/pivotal-ui.css')
.pipe(
replace(/url\(('|")\.\.\/fonts\//g, 'asset-url\($1fonts\/')
replace(/url\(('|")\.\.\/fonts\//g, 'font-url\($1fonts/')
)
.pipe(
replace(/url\(('|")\.\.\/images\//g, 'image-url\($1')
replace(/url\(('|")\.\.\/images\//g, 'image-url\($1images/')
)
.pipe(rename('pivotal-ui-rails.css'))
.pipe(gulp.dest('build/'));
Expand Down

0 comments on commit 04f38d8

Please sign in to comment.