Sha256: 1ca4b5c17b755a2ef4bfa9fd5187066a0dbb979ad3b603b8b9c59c78989289d0
Contents?: true
Size: 1.4 KB
Versions: 35
Compression:
Stored size: 1.4 KB
Contents
module GovukPublishingComponents def self.configure yield(Config) end module Config APP_COMPONENT_DIRECTORY = "components".freeze mattr_accessor :component_guide_title self.component_guide_title = "Component Guide" mattr_accessor :application_dir self.application_dir = "" mattr_accessor :application_stylesheet self.application_stylesheet = "application" mattr_accessor :application_javascript self.application_javascript = "application" mattr_accessor :exclude_css_from_static self.exclude_css_from_static = true def self.component_directory_name APP_COMPONENT_DIRECTORY end def self.gem_directory Gem::Specification.find_by_name("govuk_publishing_components").gem_dir end def self.all_stylesheets stylesheets = Dir.glob("#{gem_directory}/app/assets/stylesheets/govuk_publishing_components/components/*.scss") # _copy-to-clipboard.css is removed due to being an empty stylesheet included_files = stylesheets.reject { |path| path.include?("copy-to-clipboard") } application_stylesheet_hash = { "#{gem_directory}/app/assets/stylesheets/component_guide/application.scss" => "component_guide/application.css" } included_files.each_with_object(application_stylesheet_hash) do |path, hsh| hsh[path] = "govuk_publishing_components/components/#{File.basename(path, '.*')}.css" end end end end
Version data entries
35 entries across 35 versions & 1 rubygems