Sha256: 245223682b04e177bee3403ce77d64a6826ad7ecec27df051496a794fdf341cd

Contents?: true

Size: 765 Bytes

Versions: 5

Compression:

Stored size: 765 Bytes

Contents

# Frozen-string-literal: true
# Copyright: 2017 - 2018 - MIT License
# Author: Jordon Bedwell
# Encoding: utf-8

module Jekyll
  module Assets
    module Compressors
      class Scss < Sprockets::SassCompressor
        def call(input)
          out = super(input)
          Hook.trigger :asset, :after_compression do |h|
            h.call(input, out, "text/css")
          end
          out
        end
      end

      # --
      Sprockets.register_compressor "text/css", :assets_scss, Scss
      Hook.register :env, :after_init, priority: 3 do |e|
        next if Utils.activate("sassc") && !Utils.old_sprockets?

        e.css_compressor = nil
        next unless e.asset_config[:compression]
        e.css_compressor = :assets_scss
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
jekyll-assets-3.0.12 lib/jekyll/assets/compressors/scss.rb
jekyll-assets-3.0.11 lib/jekyll/assets/compressors/scss.rb
jekyll-assets-3.0.10 lib/jekyll/assets/compressors/scss.rb
jekyll-assets-3.0.9 lib/jekyll/assets/compressors/scss.rb
jekyll-assets-3.0.8 lib/jekyll/assets/compressors/scss.rb