Sha256: e8c7cc54768e7e8fa6370788ab9664aea1fa07997a2346cae85d7b93e9bacc59

Contents?: true

Size: 614 Bytes

Versions: 94

Compression:

Stored size: 614 Bytes

Contents

module GovukPublishingComponents
  module Presenters
    class HeadingHelper
      attr_reader :heading_tag, :id, :classes

      def initialize(options)
        @id = options[:id]

        @classes = ""
        @classes << " gem-c-heading--font-size-#{options[:font_size]}" if [24, 19].include? options[:font_size]
        @classes << " gem-c-heading--mobile-top-margin" if options[:mobile_top_margin]
        @classes << " gem-c-heading--padding" if options[:padding]
        @classes << " gem-c-heading--border-top-#{options[:border_top]}" if [1, 2, 5].include? options[:border_top]
      end
    end
  end
end

Version data entries

94 entries across 94 versions & 1 rubygems

Version Path
govuk_publishing_components-21.32.0 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-21.31.0 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-21.30.0 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-21.29.1 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-21.29.0 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-21.28.1 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-21.28.0 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-21.27.1 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-21.27.0 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-21.26.2 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-21.26.1 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-21.26.0 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-21.25.0 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-21.24.0 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-21.23.1 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-21.23.0 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-21.22.2 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-21.22.1 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-21.22.0 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-21.21.3 lib/govuk_publishing_components/presenters/heading_helper.rb