Skip to content

Commit 7a1a9f9

Browse files
authored
Add support for GOV.UK June 2025 rebrand (#15)
1 parent 2b947d1 commit 7a1a9f9

File tree

5 files changed

+125
-50
lines changed

5 files changed

+125
-50
lines changed

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "govuk-vue",
3-
"version": "1.0.1",
3+
"version": "1.1.0",
44
"license": "MIT",
55
"author": {
66
"name": "Matt Eason"
@@ -32,7 +32,7 @@
3232
"copyfiles": "^2.4.1",
3333
"eslint": "^8.34.0",
3434
"eslint-plugin-vue": "^9.9.0",
35-
"govuk-frontend": "^5.9.0",
35+
"govuk-frontend": "^5.10.2",
3636
"jsdom": "^21.1.0",
3737
"npm-run-all": "^4.1.5",
3838
"prettier": "^3.3.3",

src/App.vue

Lines changed: 43 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -155,48 +155,52 @@ watch(files, () => {
155155
</script>
156156

157157
<template>
158-
<gv-cookie-banner
159-
:message-class="{ foo: false, baz: true }"
160-
heading="Cookies?"
161-
cookie-information="GOV.UK Vue doesn't use cookies, but here's a cookie banner anyway."
162-
accept-button-text="Accept some cookies"
163-
reject-button-text="Reject some cookies"
164-
view-cookies-link-text="View cookies"
165-
view-cookies-link-href="/cookies"
166-
@acceptClicked="acceptCookies"
167-
@rejectClicked="rejectCookies"
168-
@viewCookiesClicked="viewCookies"
169-
>
170-
<template #accepted><p class="govuk-body">You've accepted cookies</p></template>
171-
<template #rejected><p class="govuk-body">You've rejected cookies</p></template>
172-
</gv-cookie-banner>
173-
<gv-skip-link href="#skiplinktarget">Skip to the skip link target</gv-skip-link>
174-
<gv-header
175-
product-name="Test"
176-
homepage-url="foo"
177-
service-name="Test service name"
178-
service-url="bar"
179-
menu-button-text="Menu button text"
180-
menu-button-label="Menu button label"
181-
navigation-label="Test navigation label"
182-
navigation-id="main-navigation"
183-
>
184-
<gv-header-navigation-item href="x">Test navigation item 1</gv-header-navigation-item>
185-
<gv-header-navigation-item href="y" text="This should never be shown" :active="true"
186-
>Test navigation item 2</gv-header-navigation-item
158+
<div class="govuk-template--rebranded">
159+
<gv-cookie-banner
160+
:message-class="{ foo: false, baz: true }"
161+
heading="Cookies?"
162+
cookie-information="GOV.UK Vue doesn't use cookies, but here's a cookie banner anyway."
163+
accept-button-text="Accept some cookies"
164+
reject-button-text="Reject some cookies"
165+
view-cookies-link-text="View cookies"
166+
view-cookies-link-href="/cookies"
167+
@acceptClicked="acceptCookies"
168+
@rejectClicked="rejectCookies"
169+
@viewCookiesClicked="viewCookies"
187170
>
188-
<gv-header-navigation-item text="Test navigation item 3 without href" />
189-
</gv-header>
171+
<template #accepted><p class="govuk-body">You've accepted cookies</p></template>
172+
<template #rejected><p class="govuk-body">You've rejected cookies</p></template>
173+
</gv-cookie-banner>
174+
<gv-skip-link href="#skiplinktarget">Skip to the skip link target</gv-skip-link>
175+
176+
<gv-header
177+
:rebrand="true"
178+
product-name="Test"
179+
homepage-url="foo"
180+
service-name="Test service name"
181+
service-url="bar"
182+
menu-button-text="Menu button text"
183+
menu-button-label="Menu button label"
184+
navigation-label="Test navigation label"
185+
navigation-id="main-navigation"
186+
>
187+
<gv-header-navigation-item href="x">Test navigation item 1</gv-header-navigation-item>
188+
<gv-header-navigation-item href="y" text="This should never be shown" :active="true"
189+
>Test navigation item 2</gv-header-navigation-item
190+
>
191+
<gv-header-navigation-item text="Test navigation item 3 without href" />
192+
</gv-header>
193+
<gv-service-navigation service-name="Service name" service-url="https://govukvue.org">
194+
<gv-service-navigation-item :active="true" :current="true" href="http://bbc.co.uk"
195+
>Link one</gv-service-navigation-item
196+
>
197+
<gv-service-navigation-item>Text item</gv-service-navigation-item>
198+
<gv-service-navigation-item href="http://bbc.co.uk" text="Link 2 (prop)" />
199+
</gv-service-navigation>
200+
</div>
190201
<gv-phase-banner tag="Pre-alpha" text="This should never be shown">
191202
This library is still in early development
192203
</gv-phase-banner>
193-
<gv-service-navigation service-name="Service name" service-url="https://govukvue.org">
194-
<gv-service-navigation-item :active="true" :current="true" href="http://bbc.co.uk"
195-
>Link one</gv-service-navigation-item
196-
>
197-
<gv-service-navigation-item>Text item</gv-service-navigation-item>
198-
<gv-service-navigation-item href="http://bbc.co.uk" text="Link 2 (prop)" />
199-
</gv-service-navigation>
200204
<gv-error-summary title="Uh oh..." description="This should never be shown">
201205
<template #title>Title slot</template>
202206
<template #description>Error summary description slot</template>
@@ -927,7 +931,7 @@ How would you like to be contacted?
927931
Password shown: {{ passwordShown }}
928932
<button @click="() => (passwordShown = !passwordShown)">Toggle password visibility</button>
929933

930-
<gv-footer copyright-href="xyz" copyright-text="Test copyright text">
934+
<gv-footer copyright-href="xyz" copyright-text="Test copyright text" :show-crown="true">
931935
<template v-slot:navigation>
932936
<gv-footer-navigation title="Section 1" width="one-third">
933937
<gv-footer-navigation-item href="abc" text="This should never be shown"

src/components/govuk-vue/footer/GvFooter.vue

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,14 @@ defineProps({
2121
/**
2222
* The copyright information. Defaults to Crown Copyright.
2323
*/
24-
copyright: String
24+
copyright: String,
25+
/**
26+
* Whether to show the GOV.UK crown at the top of the footer.
27+
*/
28+
showCrown: {
29+
type: Boolean,
30+
default: false
31+
}
2532
})
2633
2734
//We don't use the usual hasSlot() function here because in this case we don't care if the slot has content or not.
@@ -40,6 +47,31 @@ const hasCopyrightSlot = computed(() => {
4047
<template>
4148
<footer class="govuk-footer">
4249
<div class="govuk-width-container" :class="containerClass">
50+
<svg
51+
v-if="showCrown"
52+
xmlns="http://www.w3.org/2000/svg"
53+
focusable="false"
54+
role="presentation"
55+
viewBox="0 0 64 60"
56+
height="30"
57+
width="32"
58+
fill="currentcolor"
59+
class="govuk-footer__crown"
60+
>
61+
<g>
62+
<circle cx="20" cy="17.6" r="3.7"></circle>
63+
<circle cx="10.2" cy="23.5" r="3.7"></circle>
64+
<circle cx="3.7" cy="33.2" r="3.7"></circle>
65+
<circle cx="31.7" cy="30.6" r="3.7"></circle>
66+
<circle cx="43.3" cy="17.6" r="3.7"></circle>
67+
<circle cx="53.2" cy="23.5" r="3.7"></circle>
68+
<circle cx="59.7" cy="33.2" r="3.7"></circle>
69+
<circle cx="31.7" cy="30.6" r="3.7"></circle>
70+
<path
71+
d="M33.1,9.8c.2-.1.3-.3.5-.5l4.6,2.4v-6.8l-4.6,1.5c-.1-.2-.3-.3-.5-.5l1.9-5.9h-6.7l1.9,5.9c-.2.1-.3.3-.5.5l-4.6-1.5v6.8l4.6-2.4c.1.2.3.3.5.5l-2.6,8c-.9,2.8,1.2,5.7,4.1,5.7h0c3,0,5.1-2.9,4.1-5.7l-2.6-8ZM37,37.9s-3.4,3.8-4.1,6.1c2.2,0,4.2-.5,6.4-2.8l-.7,8.5c-2-2.8-4.4-4.1-5.7-3.8.1,3.1.5,6.7,5.8,7.2,3.7.3,6.7-1.5,7-3.8.4-2.6-2-4.3-3.7-1.6-1.4-4.5,2.4-6.1,4.9-3.2-1.9-4.5-1.8-7.7,2.4-10.9,3,4,2.6,7.3-1.2,11.1,2.4-1.3,6.2,0,4,4.6-1.2-2.8-3.7-2.2-4.2.2-.3,1.7.7,3.7,3,4.2,1.9.3,4.7-.9,7-5.9-1.3,0-2.4.7-3.9,1.7l2.4-8c.6,2.3,1.4,3.7,2.2,4.5.6-1.6.5-2.8,0-5.3l5,1.8c-2.6,3.6-5.2,8.7-7.3,17.5-7.4-1.1-15.7-1.7-24.5-1.7h0c-8.8,0-17.1.6-24.5,1.7-2.1-8.9-4.7-13.9-7.3-17.5l5-1.8c-.5,2.5-.6,3.7,0,5.3.8-.8,1.6-2.3,2.2-4.5l2.4,8c-1.5-1-2.6-1.7-3.9-1.7,2.3,5,5.2,6.2,7,5.9,2.3-.4,3.3-2.4,3-4.2-.5-2.4-3-3.1-4.2-.2-2.2-4.6,1.6-6,4-4.6-3.7-3.7-4.2-7.1-1.2-11.1,4.2,3.2,4.3,6.4,2.4,10.9,2.5-2.8,6.3-1.3,4.9,3.2-1.8-2.7-4.1-1-3.7,1.6.3,2.3,3.3,4.1,7,3.8,5.4-.5,5.7-4.2,5.8-7.2-1.3-.2-3.7,1-5.7,3.8l-.7-8.5c2.2,2.3,4.2,2.7,6.4,2.8-.7-2.3-4.1-6.1-4.1-6.1h10.6,0Z"
72+
></path>
73+
</g>
74+
</svg>
4375
<template v-if="hasSlot('navigation')">
4476
<div class="govuk-footer__navigation">
4577
<!-- @slot A list of `GvFooterNavigation` columns, each containing a list of `GvFooterNavigationItem`s -->

src/components/govuk-vue/header/GvHeader.vue

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
22
import hasSlot from '@/composables/useHasSlot'
3-
import { computed, onMounted, ref, toRef } from 'vue'
3+
import { computed, ref, toRef } from 'vue'
44
import { useIsDesktop } from '@/composables/useIsDesktop'
55
import { useComputedId } from '@/composables/useComputedId'
66
@@ -74,6 +74,13 @@ const props = defineProps({
7474
menuButtonText: {
7575
type: String,
7676
default: 'Menu'
77+
},
78+
/**
79+
* Whether to use the rebranded GOV.UK logo. You'll also need to add `govuk-template--rebranded` to your `<html>` to enable the blue background.
80+
*/
81+
rebrand: {
82+
type: Boolean,
83+
default: null
7784
}
7885
})
7986
@@ -104,6 +111,38 @@ const computedNavigationLabel = props.navigationLabel ? props.navigationLabel :
104111
class="govuk-header__link govuk-header__link--homepage"
105112
>
106113
<svg
114+
v-if="rebrand"
115+
xmlns="http://www.w3.org/2000/svg"
116+
focusable="false"
117+
role="img"
118+
viewBox="0 0 324 60"
119+
height="30"
120+
width="162"
121+
fill="currentcolor"
122+
class="govuk-header__logotype"
123+
aria-label="GOV.UK"
124+
>
125+
<title>GOV.UK</title>
126+
<g>
127+
<circle cx="20" cy="17.6" r="3.7"></circle>
128+
<circle cx="10.2" cy="23.5" r="3.7"></circle>
129+
<circle cx="3.7" cy="33.2" r="3.7"></circle>
130+
<circle cx="31.7" cy="30.6" r="3.7"></circle>
131+
<circle cx="43.3" cy="17.6" r="3.7"></circle>
132+
<circle cx="53.2" cy="23.5" r="3.7"></circle>
133+
<circle cx="59.7" cy="33.2" r="3.7"></circle>
134+
<circle cx="31.7" cy="30.6" r="3.7"></circle>
135+
<path
136+
d="M33.1,9.8c.2-.1.3-.3.5-.5l4.6,2.4v-6.8l-4.6,1.5c-.1-.2-.3-.3-.5-.5l1.9-5.9h-6.7l1.9,5.9c-.2.1-.3.3-.5.5l-4.6-1.5v6.8l4.6-2.4c.1.2.3.3.5.5l-2.6,8c-.9,2.8,1.2,5.7,4.1,5.7h0c3,0,5.1-2.9,4.1-5.7l-2.6-8ZM37,37.9s-3.4,3.8-4.1,6.1c2.2,0,4.2-.5,6.4-2.8l-.7,8.5c-2-2.8-4.4-4.1-5.7-3.8.1,3.1.5,6.7,5.8,7.2,3.7.3,6.7-1.5,7-3.8.4-2.6-2-4.3-3.7-1.6-1.4-4.5,2.4-6.1,4.9-3.2-1.9-4.5-1.8-7.7,2.4-10.9,3,4,2.6,7.3-1.2,11.1,2.4-1.3,6.2,0,4,4.6-1.2-2.8-3.7-2.2-4.2.2-.3,1.7.7,3.7,3,4.2,1.9.3,4.7-.9,7-5.9-1.3,0-2.4.7-3.9,1.7l2.4-8c.6,2.3,1.4,3.7,2.2,4.5.6-1.6.5-2.8,0-5.3l5,1.8c-2.6,3.6-5.2,8.7-7.3,17.5-7.4-1.1-15.7-1.7-24.5-1.7h0c-8.8,0-17.1.6-24.5,1.7-2.1-8.9-4.7-13.9-7.3-17.5l5-1.8c-.5,2.5-.6,3.7,0,5.3.8-.8,1.6-2.3,2.2-4.5l2.4,8c-1.5-1-2.6-1.7-3.9-1.7,2.3,5,5.2,6.2,7,5.9,2.3-.4,3.3-2.4,3-4.2-.5-2.4-3-3.1-4.2-.2-2.2-4.6,1.6-6,4-4.6-3.7-3.7-4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6.3v13.5h-8.7"
142+
></path>
143+
</svg>
144+
<svg
145+
v-else
107146
focusable="false"
108147
role="img"
109148
class="govuk-header__logotype"

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy