ONSdigital / design-system

ONS Design System
https://service-manual.ons.gov.uk/design-system
MIT License
27 stars 17 forks source link

Document all utility classes #3138

Open daniellecorke opened 2 months ago

daniellecorke commented 2 months ago

Background

This ticket was split from #1982.

Issue

We need to document all the utility style override classes. Should these all sit in one place e.g. 'get started' or could they be separated into styles sections e.g. 'spacing' etc?

Tasks

List all of the utility classes that start with ons-u- Divide them in relevant sections eg: spacing, size, display etc.. Add them in the comment section of this ticket. Bring them back to a tech session for next steps.

adi-unni commented 2 months ago

Let's display this:

Many components in the design system have a parameter in their macro 'classes': ' ' that allows the service to input any additional modifiers like utility classes into the component. The utility classes can be split into different categories:

Colours - apply foreground and background colours.

Display - hide elements when there is or isnt js

Float - additional float settings:

Grid - all the grid ones are documented in grid settings. Would be good to consolidate them with the rest of these. There are some utility classes that have been missed however:

Margin:

Margins can be specified with the respective sizes in this format:

Sizes:

Margin Type:

Padding (similar to margin):

The format is: ons-u-{pt | pr | pl | pb | p}-{no | xxs | xs | s | m | l } where the values represent:

Sizes:

with padding types:

Typography - Additional typography fonts, only affects the fonts in the elements:

Element-wise utilities - These affect elements and values inside elements on a generic scale:

Visibility - These affect the overall visibility of elements including breakpoint management:

daniellecorke commented 2 months ago

On the UCD board: https://jira.ons.gov.uk/browse/CU-67.

adi-unni commented 2 months ago

remove the visually hidden class along with the focusable elements. remove the ir classes. add !important to utility classes. New ticket to be created (both breaking changes). rewrite the grid section.

daniellecorke commented 3 weeks ago

This issue is currently parked on the UCD Board.