Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //admin.scss
- @import 'variables-<%= 'brand-name' %>';
- body {
- background: $primary-color;
- }
- {
- test: /.scss(.erb)?/,
- loader: 'sass-loader',
- options: { importExtensions: ['.scss', '.scss.erb', '.css'] }
- }
- # Render the template to a string
- css = Sass::Engine.new(
- render_to_string("path/to/erb_template", :layout => false),
- syntax: :scss,
- cache: false,
- read_cache: false,
- style: :standard,
- sprockets: {
- context: self.view_context,
- }
- ).render
- # respond with the rendered string
- respond_to do |format|
- format.css { render plain: css, :content_type => "text/css" }
- end
- rendered_sass = [render_to_string("stylesheets/colours", :layout => false),
- File.read(Rails.root.join("app", "javascript", "stylesheets", "main.scss")),
- File.read(Rails.root.join("app", "javascript", "stylesheets", "base.scss")),
- File.read(Rails.root.join("app", "javascript", "stylesheets", "reset.scss")),
- File.read(Rails.root.join("app", "javascript", "stylesheets", "type.scss")),
- File.read(Rails.root.join("app", "javascript", "stylesheets", "layout.scss")),
- File.read(Rails.root.join("app", "javascript", "stylesheets", "map.scss")),
- File.read(Rails.root.join("app", "javascript", "stylesheets", "audio-player.scss")),
- File.read(Rails.root.join("app", "javascript", "stylesheets", "slider.scss"))].join("nr")
Add Comment
Please, Sign In to add comment