question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Improve the way macros are imported from GOV.UK Frontend

See original GitHub issue

At the minute all of the the component macros are included as part of the default layout:

https://github.com/alphagov/govuk-prototype-kit/blob/3b6870fc6b09689a54793aefc76485200c5db324/app/views/layout.html#L6-L30

We do this so that users do not need to import the components themselves – despite the examples in the Design System always including the import, we tell them not to include it.

This means that:

  • when we add a new component to GOV.UK Frontend, we have to remember to add it to the list of imports
  • components are only imported into the default layout, and not the unbranded layout
  • GOV.UK Frontend works differently to any other ‘extensions’ the user has installed

We should explore ways to auto-load the components in all of the provided layouts, possibly via the extensions framework.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
edwardhorsfordcommented, Nov 24, 2020

A side advantage of a separate include is that that file could live outside of app so more easily be updated. Keeping layout for user-side changes.

0reactions
joelanmancommented, Dec 21, 2022

components are now all imported automatically via the GOV.UK Frontend Prototype Kit config file

Read more comments on GitHub >

github_iconTop Results From Across the Web

Improve macros in GOV.UK Frontend #1386 - GitHub
Add an icon next to an input using the govuk Input macro Add an icon next ... Provide a way to import all...
Read more >
Import CSS, assets and JavaScript - GOV.UK Frontend
Import specific parts of the CSS. If you want to improve how quickly your service's pages load in browsers, you can import only...
Read more >
How GDS improved GOV.UK Frontend's developer ...
UK Design System team at Government Digital Service (GDS) on improving documentation for developers using GOV.UK Frontend. GOV.
Read more >
govuk-frontend-wtf - PyPI
This repository contains a set of WTForms widgets used to render WTForm fields using GOV.UK Frontend component styling. This is done using Jinja...
Read more >
Building a resilient frontend using progressive enhancement
Progressive enhancement is a way of building websites and applications. ... improve accessibility by encouraging best practices like writing ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found