module MaterialComponentsWeb::Sass

Constants

VERSION

Public Class Methods

fonts_path() click to toggle source
# File lib/material_components_web-sass.rb, line 26
def fonts_path
  File.join(gem_path, 'vendor/assets/fonts')
end
gem_path() click to toggle source
# File lib/material_components_web-sass.rb, line 14
def gem_path
  @gem_path ||= File.expand_path('..', File.dirname(__FILE__))
end
javascripts_path() click to toggle source
# File lib/material_components_web-sass.rb, line 22
def javascripts_path
  File.join(gem_path, 'vendor/assets/javascripts')
end
load!() click to toggle source
# File lib/material_components_web-sass.rb, line 4
def load!
  if defined?(::Rails)
    register_rails_engine
  elsif defined?(::Sprockets)
    register_sprockets
  end

  configure_sass
end
stylesheets_path() click to toggle source
# File lib/material_components_web-sass.rb, line 18
def stylesheets_path
  File.join(gem_path, 'vendor/assets/stylesheets')
end

Private Class Methods

configure_sass() click to toggle source
# File lib/material_components_web-sass.rb, line 32
def configure_sass
  require 'sass'

  ::Sass.load_paths << stylesheets_path
end
register_rails_engine() click to toggle source
# File lib/material_components_web-sass.rb, line 38
def register_rails_engine
  require 'material_components_web/sass/engine'
  require 'autoprefixer-rails'
end
register_sprockets() click to toggle source
# File lib/material_components_web-sass.rb, line 43
def register_sprockets
  Sprockets.append_path(stylesheets_path)
  Sprockets.append_path(javascripts_path)
  Sprockets.append_path(fonts_path)
end