-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(button menu): final updates to button menu and adjust page heade…
…r actions
- Loading branch information
Showing
4 changed files
with
27 additions
and
81 deletions.
There are no files selected for viewing
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
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
49 changes: 8 additions & 41 deletions
49
src/moj/components/page-header-actions/_page-header-actions.scss
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,21 @@ | ||
.moj-page-header-actions { | ||
@include govuk-clearfix; | ||
font-size: 0; // Hide whitespace between elements | ||
display: flex; | ||
flex-wrap: wrap; | ||
justify-content: space-between; | ||
align-items: center; | ||
gap: govuk-spacing(2); | ||
margin-bottom: govuk-spacing(7); | ||
min-height: govuk-spacing(7); // Match button height | ||
text-align: justify; // Trick to remove the need for floats | ||
&:after { | ||
content: ''; | ||
display: inline-block; | ||
width: 100%; | ||
} | ||
|
||
} | ||
|
||
|
||
.moj-page-header-actions__title { | ||
|
||
[class^=govuk-heading-] { | ||
margin-bottom: govuk-spacing(2); | ||
text-align: left; | ||
@include govuk-media-query($from: tablet) { | ||
margin-bottom: 0; | ||
} | ||
} | ||
|
||
@include govuk-media-query($from: tablet) { | ||
display: inline-block; | ||
vertical-align: middle; | ||
[class^="govuk-heading-"] { | ||
margin-bottom: 0; | ||
} | ||
|
||
} | ||
|
||
|
||
.moj-page-header-actions__actions { | ||
|
||
@include govuk-media-query($from: tablet) { | ||
display: inline-block; | ||
vertical-align: middle; | ||
} | ||
|
||
} | ||
|
||
.moj-page-header-actions__action { | ||
|
||
&:last-child { | ||
.moj-page-header-actions__action { | ||
margin-bottom: 0; | ||
} | ||
|
||
@include govuk-media-query($from: tablet) { | ||
margin-bottom: 0; | ||
} | ||
|
||
} | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,19 @@ | ||
{%- from "moj/components/button-menu/macro.njk" import mojButtonMenu %} | ||
|
||
<div class="moj-page-header-actions {{- ' ' + params.classes if params.classes}}" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}> | ||
|
||
<div class="moj-page-header-actions__title"> | ||
<h{{ params.heading.level | default(1) }} class="{{params.heading.classes | default('govuk-heading-xl')}}"> | ||
{{- params.heading.html | safe if params.heading.html else params.heading.text -}} | ||
</h{{ params.heading.level | default(1) }}> | ||
</div> | ||
|
||
{% if params.items %} | ||
<div class="moj-page-header-actions__actions"> | ||
{{mojButtonMenu({ | ||
buttonClasses: 'moj-page-header-actions__action', | ||
items: params.items | ||
})}} | ||
<div class="moj-page-header-actions {{- ' ' + params.classes if params.classes}}" {%- for attribute, value in params.attributes %}{{ attribute }}="{{ value }}"{% endfor %}> | ||
<div class="moj-page-header-actions__title"> | ||
<h {{ params.heading.level | default(1) }} class="{{ params.heading.classes | default("govuk-heading-xl") }}"> | ||
{{- params.heading.html | safe if params.heading.html else params.heading.text -}} | ||
</h {{ params.heading.level | default(1) }}> | ||
</div> | ||
{% endif %} | ||
|
||
{% if params.items %} | ||
<div class="moj-page-header-actions__actions"> | ||
{{ mojButtonMenu({ | ||
button: { | ||
classes: "moj-page-header-actions__action" | ||
}, | ||
alignMenu: "right", | ||
items: params.items | ||
}) }} | ||
</div> | ||
{% endif %} | ||
</div> |