Skip to content

Commit

Permalink
Render the inverse button on a blue background
Browse files Browse the repository at this point in the history
  • Loading branch information
peteryates committed May 23, 2023
1 parent 73328a4 commit a66ce10
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion guide/content/form-elements/submit.slim
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ p.govuk-body

== render('/partials/example.*',
caption: 'Generating submit button with inverted colours',
code: inverse_button)
code: inverse_button,
render_on_brand_background: true)

== render('/partials/example.*',
caption: 'Generating a submit button with a custom class',
Expand Down
4 changes: 4 additions & 0 deletions guide/content/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ $x-govuk-brand-colour: #28a;
}
}

.branded-background {
background: govuk-colour(blue);
}

// inverse buttons, this can be removed once the functionality is supported by
// the design system. https://github.com/alphagov/govuk-frontend/pull/3556
$govuk-inverse-button-colour: govuk-colour("white");
Expand Down
2 changes: 1 addition & 1 deletion guide/layouts/partials/example.slim
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ figure.app-example
a.govuk-tabs__tab href=%(#output-html-#{anchor_id(caption)})
| HTML

.govuk-tabs__panel id=%(output-rendered-#{anchor_id(caption)})
.govuk-tabs__panel id=%(output-rendered-#{anchor_id(caption)}) class=("branded-background" if defined?(render_on_brand_background) && render_on_brand_background)
== format_slim(code, f: builder(display_errors), **form_data)

.govuk-tabs__panel id=%(output-html-#{anchor_id(caption)})
Expand Down

0 comments on commit a66ce10

Please sign in to comment.