Class: GovukPublishingComponents::AppHelpers::BrandHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/govuk_publishing_components/app_helpers/brand_helper.rb

Instance Method Summary collapse

Constructor Details

#initialize(brand) ⇒ BrandHelper

Returns a new instance of BrandHelper.



4
5
6
# File 'lib/govuk_publishing_components/app_helpers/brand_helper.rb', line 4

def initialize(brand)
  @brand = brand if brand
end

Instance Method Details

#border_color_classObject



16
17
18
# File 'lib/govuk_publishing_components/app_helpers/brand_helper.rb', line 16

def border_color_class
  "brand__border-color" if @brand
end

#brand_classObject

Apply government organisation branding to individual components, specifically link colour and border colour see github.com/alphagov/govuk_publishing_components/blob/master/docs/component_branding.md



12
13
14
# File 'lib/govuk_publishing_components/app_helpers/brand_helper.rb', line 12

def brand_class
  "brand--#{@brand}" if @brand
end

#color_classObject



20
21
22
# File 'lib/govuk_publishing_components/app_helpers/brand_helper.rb', line 20

def color_class
  "brand__color" if @brand
end