|
| 1 | +# 24. Usage of GOV.UK Front-end |
| 2 | + |
| 3 | +Date: 2025-02-07 |
| 4 | + |
| 5 | +## Status |
| 6 | + |
| 7 | +Accepted |
| 8 | + |
| 9 | +## Context |
| 10 | + |
| 11 | +### Background |
| 12 | + |
| 13 | +The Find Case Law website is a public government service. The GOV.UK front-end library has various useful components that are built to be used by government services. |
| 14 | + |
| 15 | +### Problem |
| 16 | + |
| 17 | +We want to build various features on the Find Case Law website at pace without having to build everything from scratch, and we want these features to use components that are accessible and work in a standard way. |
| 18 | + |
| 19 | +### Goals |
| 20 | + |
| 21 | +- Build features on the Find Case Law website that are accessible |
| 22 | +- Build features on the Find Case Law website at pace |
| 23 | +- Build features on the Find Case law that work in an industry standard way |
| 24 | +- Have minimal code to maintain |
| 25 | + |
| 26 | +### Options considered |
| 27 | + |
| 28 | +- Build our own component library from scratch |
| 29 | +- Add the GOV.UK front-end library as a dependency and override any styling that doesn't match Find Case Law |
| 30 | +- Create a copy of the GOV.UK component library and make changes to the core code for styles that doesn't match Find Case Law |
| 31 | +- Use a non-government supported component library and style it to match the Find Case Law branding |
| 32 | + |
| 33 | +## Decision |
| 34 | + |
| 35 | +### Proposed solution |
| 36 | + |
| 37 | +- Add the GOV.UK front-end library as a dependency |
| 38 | +- Override styling that doesn't match Find Case law |
| 39 | +- Ensure the CSS for overriding is as decoupled from our application as possible |
| 40 | +- Ensure the HTML for usage of the components is decoupled from our application as possible by creating Find Case Law equivalent components that inherit from the GOV.UK components |
| 41 | + |
| 42 | +### Justification |
| 43 | + |
| 44 | +- By adding the GOV.UK front-end library as a dependency, we will get any new features and changes that happen upstream |
| 45 | +- By overriding styling that doesn't match Find Case Law, it means we'll have less breaking changes when we update the library and we don't couple our styling heavily with the usage of the library |
| 46 | +- By using our own component HTML that inherits/uses the HTML from the GOV.UK front-end library, and decoupling our application from the GOV.UK front-end components, it allows updating the GOV.UK front-end library with minimal breaking changes |
| 47 | + |
| 48 | +## Consequences |
| 49 | + |
| 50 | +- We can build new features at pace without having to build too much |
| 51 | +- New components and features will be accessible |
| 52 | +- By decoupling the implementation of the GOV.UK front-end library, it requires minimal maintenance and a smaller blast radius when breaking changes happen upstream |
0 commit comments