Skip to content

Commit

Permalink
Add guidance for text align override classes
Browse files Browse the repository at this point in the history
Add guidance for newly-added text override classes in Frontend: alphagov/govuk-frontend#2339

Put override classes into grey code boxes

Correct 'centre' in class name
  • Loading branch information
calvin-lau-sig7 committed Sep 27, 2021
1 parent 61f31d6 commit ac7b78b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/styles/typography/index.md.njk
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ The majority of your body copy should use the standard 19px paragraph size.

{{ example({group: "styles", item: "typography", example: "small", html: true, open: true}) }}

## Text alignment override classes

If you need to align text differently to how it usually displays on the page, you can use text alignment override classes.

Use:
- `govuk-!-text-align-left` to align text to the left
- `govuk-!-text-align-right` to align text to the right
- `govuk-!-text-align-centre` to align text to the centre

## Font override classes

You might need to set the font size or font weight of an element outside of the predefined heading and paragraph classes. For this you can use the font override classes in your HTML or reference the typography mixins in your own components.
Expand Down

0 comments on commit ac7b78b

Please sign in to comment.