Sha256: 7d1973a8ad9950b7b6c5c094fad4f85203399ffb6483f645b4c7543c7fcf970d
Contents?: true
Size: 1.91 KB
Versions: 16
Compression:
Stored size: 1.91 KB
Contents
{%- if params.type == "success" %} {% set successBanner = true %} {% endif %} {%- if successBanner %} {% set typeClass = "govuk-notification-banner--" + params.type %} {% endif %} {% if params.role %} {% set role = params.role %} {% elif successBanner %} {# If type is success, add `role="alert"` to prioritise the information in the notification banner to users of assistive technologies #} {% set role = "alert" %} {% else %} {# Otherwise add `role="region"` to make the notification banner a landmark to help users of assistive technologies to navigate to the banner #} {% set role = "region" %} {% endif %} {%- if params.titleHtml %} {% set title = params.titleHtml | safe %} {%- elif params.titleText %} {% set title = params.titleText %} {%- elif successBanner %} {% set title = "Success" %} {%- else %} {% set title = "Important" %} {%- endif -%} <div class="govuk-notification-banner{% if typeClass %} {{ typeClass }}{% endif %}{% if params.classes %} {{ params.classes }}{% endif %}" role="{{ role }}" aria-labelledby="{{ params.titleId | default('govuk-notification-banner-title')}}" data-module="govuk-notification-banner" {%- if params.disableAutoFocus %} data-disable-auto-focus="true"{% endif %} {%- for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}> <div class="govuk-notification-banner__header"> <h{{ params.titleHeadingLevel | default(2) }} class="govuk-notification-banner__title" id="{{ params.titleId | default('govuk-notification-banner-title') }}" > {{ title }} </h{{ params.titleHeadingLevel | default(2) }}> </div> <div class="govuk-notification-banner__content"> {%- if caller or params.html -%} {{ caller() if caller else params.html | safe }} {%- elif params.text -%} {# Set default style for single line content #} <p class="govuk-notification-banner__heading">{{ params.text }}</p> {%- endif -%} </div> </div>
Version data entries
16 entries across 16 versions & 1 rubygems