Open daniellecorke opened 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
display:none
when js is enableddisplay:none
when js is disabledFloat - 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:
.ons-grid--float - reduces letter spacing to 0
.ons-grid--center - this selector centers text outside of columns, individual columns will still be left aligned
.ons-grid--center-all - this will center the text in all objects in the grid
.ons-grid-vertical-align - aligns content vertically in the middle of its containing cell
.ons-grid-stagger-align - allign the content in the contents to be staggered left - right (needs verifying)
.ons-highlight - highlight foreground and background colour. Related link to typography
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:
visibility: hidden
hides the element from being rendered but will still take space, but display: none
removes it from the layout and from taking up spaceOn the UCD board: https://jira.ons.gov.uk/browse/CU-67.
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.
This issue is currently parked on the UCD Board.
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.