Sha256: 48f63c65eb9510fc0c1c330f8147ff268da8c0e7400db4d86e7efb8ec3f6a7b9

Contents?: true

Size: 1.47 KB

Versions: 61

Compression:

Stored size: 1.47 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

    mattr_accessor :use_es6_components
    self.use_es6_components = false

    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

61 entries across 61 versions & 1 rubygems

Version Path
govuk_publishing_components-51.1.0 lib/govuk_publishing_components/config.rb
govuk_publishing_components-51.0.0 lib/govuk_publishing_components/config.rb
govuk_publishing_components-50.0.1 lib/govuk_publishing_components/config.rb
govuk_publishing_components-50.0.0 lib/govuk_publishing_components/config.rb
govuk_publishing_components-49.1.0 lib/govuk_publishing_components/config.rb
govuk_publishing_components-49.0.0 lib/govuk_publishing_components/config.rb
govuk_publishing_components-48.0.0 lib/govuk_publishing_components/config.rb
govuk_publishing_components-47.0.0 lib/govuk_publishing_components/config.rb
govuk_publishing_components-46.4.0 lib/govuk_publishing_components/config.rb
govuk_publishing_components-46.3.1 lib/govuk_publishing_components/config.rb
govuk_publishing_components-46.3.0 lib/govuk_publishing_components/config.rb
govuk_publishing_components-46.2.0 lib/govuk_publishing_components/config.rb
govuk_publishing_components-46.1.0 lib/govuk_publishing_components/config.rb
govuk_publishing_components-46.0.0 lib/govuk_publishing_components/config.rb
govuk_publishing_components-45.10.0 lib/govuk_publishing_components/config.rb
govuk_publishing_components-45.9.0 lib/govuk_publishing_components/config.rb
govuk_publishing_components-45.8.0 lib/govuk_publishing_components/config.rb
govuk_publishing_components-45.7.0 lib/govuk_publishing_components/config.rb
govuk_publishing_components-45.6.1 lib/govuk_publishing_components/config.rb
govuk_publishing_components-45.6.0 lib/govuk_publishing_components/config.rb