summaryrefslogtreecommitdiff
path: root/xstatic/pkg/bootstrap_scss/data/scss/_bootstrap-mincer.scss
diff options
context:
space:
mode:
Diffstat (limited to 'xstatic/pkg/bootstrap_scss/data/scss/_bootstrap-mincer.scss')
-rw-r--r--xstatic/pkg/bootstrap_scss/data/scss/_bootstrap-mincer.scss17
1 files changed, 17 insertions, 0 deletions
diff --git a/xstatic/pkg/bootstrap_scss/data/scss/_bootstrap-mincer.scss b/xstatic/pkg/bootstrap_scss/data/scss/_bootstrap-mincer.scss
new file mode 100644
index 0000000..3413250
--- /dev/null
+++ b/xstatic/pkg/bootstrap_scss/data/scss/_bootstrap-mincer.scss
@@ -0,0 +1,17 @@
+// Mincer asset helper functions
+//
+// This must be imported into a .css.ejs.scss file.
+// Then, <% %>-interpolations will be parsed as strings by Sass, and evaluated by EJS after Sass compilation.
+
+
+@function twbs-font-path($path) {
+ // do something like following
+ // from "path/to/font.ext#suffix" to "<%- asset_path(path/to/font.ext)) + #suffix %>"
+ // from "path/to/font.ext?#suffix" to "<%- asset_path(path/to/font.ext)) + ?#suffix %>"
+ // or from "path/to/font.ext" just "<%- asset_path(path/to/font.ext)) %>"
+ @return "<%- asset_path('#{$path}'.replace(/[#?].*$/, '')) + '#{$path}'.replace(/(^[^#?]*)([#?]?.*$)/, '$2') %>";
+}
+
+@function twbs-image-path($file) {
+ @return "<%- asset_path('#{$file}') %>";
+}