-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable cookie banner to set link styled as a button #2164
Merged
hannalaakso
merged 3 commits into
master
from
enable-cookie-banner-to-set-link-as-button
Mar 10, 2021
Merged
Enable cookie banner to set link styled as a button #2164
hannalaakso
merged 3 commits into
master
from
enable-cookie-banner-to-set-link-as-button
Mar 10, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Enable the action to be a link styled as a button, with role="button" and draggable="false", if both href and type="button" are provided. This matches the [Start buttons](https://design-system.service.gov.uk/components/button/#start-buttons). ( A more terse solution to achieve this in the macro would be to skip the first condition with ``` {% if action.href && action.type != "button"% } ``` and pass a `href` to the button macro in `else`. This would work since Nunjucks doesn't render blank attributes for options whose values aren't specified in the macro. However, other templating languages might not follow a similar pattern - and we should try and keep our macro aligned with what ports of GOV.UK Frontend do in their macros.)
Rename the example to distinguish it from the new link button example.
|
4 tasks
@hannalaakso Have commented on the Google Doc for the content change. :) |
vanitabarrett
approved these changes
Mar 9, 2021
Merging this as @EoinShaughnessy has pulled the docs changes into #2168, including updates to the changelog. |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It should be possible to render a link styled as a button in the cookie banner. This is an edge case but could be useful for rendering the 'Hide' button if:
This PR:
role="button"
anddraggable="false"
, if bothhref
andtype="button"
are provided. The resulting markup matches Start buttons.We need to add some extra documentation to the macro options for this change. There are a few concepts mixed up in this change so I've started a doc for @EoinShaughnessy to help us finalise the wording.