Skip to content

Latest commit

 

History

History
32 lines (21 loc) · 997 Bytes

File metadata and controls

32 lines (21 loc) · 997 Bytes

Components

Find components in src/govuk/components.

Components must use the .govuk- namespace.

For example, .govuk-button.

Writing CSS for components

Components must follow the conventions described in our CSS coding standards.

Components must:

  • use classes for child elements, scoped to the parent component
  • be flexible, not set a width or external padding and margins
  • set internal margins in a single direction
  • not rely on any other selector outside of the component scss file to style its children

Component folder structure and naming

Component folder and files should be singular, except in cases where they are more commonly used in groups, for example, radios, breadcrumbs and checkboxes.

The folder structure should be:

component-name
  - `_component-name.scss`
  - `component-name.html`
  - `component-name.js`
  - `README.md`

Nunjucks template API

Read more about the way we write component templates.