I’m trying to cobble together something that will take all my scss, compile it, minify it, then drop it between two <style>
tags at the top of my document.
Since I want to differentiate between development and build, I have two layouts: one, called development.erb that includes a stylesheet_link_tag to both main.scss and development.scss, and another, called build.erb, which would do something like https://github.com/kaiinui/middleman-inliner. My plan was to do something like <%= stylesheet_inline_tag "all_build" %>
, where all_build would include a sprockets directive including all the CSS I wanted. Unfortunately, it seems that the inliner I mentioned above just takes the raw data in all_build.css and drops it between <style>
tags, without rendering the CSS or minifying it first.
Any thoughts on how to use sprockets directives with a custom CSS/SCSS and JS inliner of some sort?