@dfedigital/dfe-frontend
v3.0.0
Published
DfE Frontend extends GOV.UK Frontend with departmental components and brand mode.
Readme
@dfe/dfe-frontend
Extends GOV.UK Frontend with DfE components and optional use-dfe-brand typography and header treatment.
Install
npm install govuk-frontend @dfe/dfe-frontendSass
Compile with a load path that includes node_modules (Dart Sass):
sass --load-path=node_modules path/to/your.scss output.cssFull bundle:
@use '@dfe/dfe-frontend/dfe.scss';Selective component stylesheet:
@use '@dfe/dfe-frontend/components/card.scss';JavaScript
import { initAll } from '@dfe/dfe-frontend'
initAll()Production bundles (npm package dist/)
After npm run build in this package, dist/ contains CDN- and tag-friendly builds:
| File | Use |
| --- | --- |
| dfe.min.css | Production stylesheet |
| dfe-frontend.esm.min.js | import { initAll } from '@dfe/dfe-frontend/dist/dfe-frontend.esm.min.js' or <script type="module"> |
| dfe-frontend.iife.min.js | window.DfeFrontend.initAll() (no bundler) |
| manifest.json | integrity (sha384) for each file |
Pin a semver when loading from a public npm CDN (jsDelivr, unpkg). See docs/distribution.md in the repo root.
Brand mode
Add use-dfe-brand to <body> (with govuk-template__body) and load Inter. DfE shell components and tokens apply as described in the platform specification.
