Instruction file imported from DEFRA/ai-sdlc-workshop-frontend (
.cursor/rules/govuk-frontend.mdc). Copyright stays with the author.
GOV.UK Frontend Standards
This project uses GOV.UK Frontend for consistent styling and components. Follow these guidelines:
Component Usage
- Always use GOV.UK Frontend components when available
- Follow the GOV.UK Design System patterns and components
- Use the GOV.UK Frontend Nunjucks macros for components
- Maintain accessibility standards as per GOV.UK guidelines
Styling Guidelines
- Use GOV.UK Frontend's Sass variables and mixins
- Follow the GOV.UK Design System spacing scale
- Use the GOV.UK Frontend grid system
- Maintain consistent typography using GOV.UK Frontend's font stack
Example Component Usage
{% from "govuk/components/button/macro.njk" import govukButton %}
{{ govukButton({
text: "Continue",
href: "/next-page"
}) }}
Custom Styling
- Only add custom styles when necessary
- Use BEM naming convention for custom components
- Extend GOV.UK Frontend styles rather than overriding them
- Keep custom styles in
src/public/styles/directory