Sha256: 06b518e44ffb32234d5269c7a7ab07d6f89363f38a436061d63bac969b1d6544

Contents?: true

Size: 758 Bytes

Versions: 1

Compression:

Stored size: 758 Bytes

Contents

### Stylus Railtie
# `Railtie` responsible for injecting `stylus` inside the
# Rails application and the `Sprockets` Asset Pipeline.

require 'stylus/tilt'

module Stylus
  class Railtie < ::Rails::Railtie

    initializer :setup_stylus do |app|
      config.app_generators.stylesheet_engine :styl
      next unless app.config.assets.enabled

      # Loading `Sprockets` before Rails so we can register our own Engine.
      require 'sprockets'
      require 'sprockets/engines'
      Sprockets.register_engine '.styl', Tilt::StylusTemplate
    end

    # Includes the `Rails` asset load path into `stylus` so any
    # `.styl` file inside it can be imported.
    config.after_initialize do |app|
      Stylus.paths.concat app.assets.paths
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
stylus-0.1.0 lib/stylus/railtie.rb