Skip to content

Commit

Permalink
Let the compass filter do the url rewrites
Browse files Browse the repository at this point in the history
This is a little bit confusing, but it is better this way. It's
confusing because webassets doesn't set the compass image directory,
so the paths still have an "images/" prefix. However, the cssrewrite
filter uses the output URL from webassets and that will be an absolute
URL at request time. The compass filter uses only the base URL from the
environment configuration, which is relative. Letting compass do the
rewriting therefore results in merged compass files having correct, but
relative, paths regardless of whether the assets are generated at the
command line or at request time. This should make it possible to pre-
compile the assets before the first request without generating bad
URLs, and to virtual host the application under multiple URLs.
  • Loading branch information
tilgovi committed Aug 20, 2015
1 parent c6cbd3e commit 59aeb92
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
4 changes: 0 additions & 4 deletions h/assets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ admin_css:
filters:
- compass
- cleancss
- cssrewrite
contents:
- h:static/styles/admin.scss
admin_js:
Expand Down Expand Up @@ -145,7 +144,6 @@ app_css:
output: styles/app.min.css
filters:
- cleancss
- cssrewrite
contents:
- h:static/styles/vendor/angular-csp.css
- h:static/styles/vendor/angular-toastr.css
Expand Down Expand Up @@ -199,7 +197,6 @@ inject_css:
output: styles/hypothesis.min.css
filters:
- cleancss
- cssrewrite
contents:
- h:static/styles/vendor/icomoon.css
- output: styles/hypothesis.css
Expand All @@ -220,7 +217,6 @@ help_page_css:
output: styles/help-page.min.css
filters:
- cleancss
- cssrewrite
contents:
- h:static/styles/vendor/icomoon.css
- output: styles/help-page.css
Expand Down
2 changes: 1 addition & 1 deletion h/static/styles/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
//NOISE///////////
//Provides the noise background
.noise {
background: url("../images/noise_1.png");
background: image-url("images/noise_1.png");
}

.annotator-hide {
Expand Down
2 changes: 1 addition & 1 deletion h/static/styles/help-page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ body {
}

#help-2 {
background: url(../images/help-arrow.svg) 0 0 no-repeat;
background: image-url("images/help-arrow.svg") 0 0 no-repeat;
width: 60px;
height: 45px;
position: absolute;
Expand Down

0 comments on commit 59aeb92

Please sign in to comment.