Sha256: 8892b034c4600fdeccfb76c0700b2e53785423e98c6fb7cccae8d66d5b3c59f9

Contents?: true

Size: 845 Bytes

Versions: 5

Compression:

Stored size: 845 Bytes

Contents

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

if defined?(Sprockets::SasscCompressor)
  module Jekyll
    module Assets
      module Compressors
        class SassC < Sprockets::SasscCompressor
          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_sassc, SassC
        Hook.register :env, :after_init, priority: 3 do |e|
          e.css_compressor = nil
          next unless e.asset_config[:compression]
          Utils.activate("sassc") do
            e.css_compressor = :assets_sassc
          end
        end
      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/sassc.rb
jekyll-assets-3.0.11 lib/jekyll/assets/compressors/sassc.rb
jekyll-assets-3.0.10 lib/jekyll/assets/compressors/sassc.rb
jekyll-assets-3.0.9 lib/jekyll/assets/compressors/sassc.rb
jekyll-assets-3.0.8 lib/jekyll/assets/compressors/sassc.rb