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

Version Path
govuk_publishing_components-39.2.5 lib/govuk_publishing_components/config.rb
govuk_publishing_components-39.2.4 lib/govuk_publishing_components/config.rb
govuk_publishing_components-39.2.3 lib/govuk_publishing_components/config.rb
govuk_publishing_components-39.2.2 lib/govuk_publishing_components/config.rb
govuk_publishing_components-39.2.1 lib/govuk_publishing_components/config.rb
govuk_publishing_components-39.2.0 lib/govuk_publishing_components/config.rb
govuk_publishing_components-39.1.0 lib/govuk_publishing_components/config.rb
govuk_publishing_components-39.0.0 lib/govuk_publishing_components/config.rb
govuk_publishing_components-38.4.2 lib/govuk_publishing_components/config.rb
govuk_publishing_components-38.1.1 lib/govuk_publishing_components/config.rb
govuk_publishing_components-38.1.0 lib/govuk_publishing_components/config.rb
govuk_publishing_components-38.0.1 lib/govuk_publishing_components/config.rb
govuk_publishing_components-38.0.0 lib/govuk_publishing_components/config.rb
govuk_publishing_components-37.10.0 lib/govuk_publishing_components/config.rb
govuk_publishing_components-37.9.1 lib/govuk_publishing_components/config.rb
govuk_publishing_components-37.9.0 lib/govuk_publishing_components/config.rb
govuk_publishing_components-37.8.1 lib/govuk_publishing_components/config.rb
govuk_publishing_components-37.8.0 lib/govuk_publishing_components/config.rb
govuk_publishing_components-37.7.1 lib/govuk_publishing_components/config.rb
govuk_publishing_components-37.7.0 lib/govuk_publishing_components/config.rb