Sha256: c374331e16d669fbf6ca06315e571376cbeab5333568f6f18d4023fa9a6e1dd2

Contents?: true

Size: 872 Bytes

Versions: 101

Compression:

Stored size: 872 Bytes

Contents

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

      def initialize(options)
        @heading_tag = "h2"
        @heading_tag = "h#{options[:heading_level]}" if [1, 2, 3, 4, 5, 6].include? options[:heading_level]
        @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--margin-bottom-#{options[:margin_bottom]}" if [2, 4].include? options[:margin_bottom]
        @classes << " gem-c-heading--border-top-#{options[:border_top]}" if [1, 2, 5].include? options[:border_top]
      end
    end
  end
end

Version data entries

101 entries across 101 versions & 1 rubygems

Version Path
govuk_publishing_components-16.1.0 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-16.0.0 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-15.3.0 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-15.2.0 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-15.1.0 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-15.0.0 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-14.0.0 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-13.8.1 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-13.8.0 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-13.7.0 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-13.6.1 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-13.6.0 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-13.5.4 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-13.5.3 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-13.5.2 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-13.5.1 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-13.5.0 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-13.4.0 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-13.3.0 lib/govuk_publishing_components/presenters/heading_helper.rb
govuk_publishing_components-13.2.0 lib/govuk_publishing_components/presenters/heading_helper.rb