Skip to content

Commit

Permalink
Document that Gap is not to be used on Grid
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentSmedinga committed Aug 30, 2024
1 parent a6b4db4 commit f4dec99
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/css/src/components/gap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ The five sizes of [Component Space](/docs/brand-design-tokens-space--docs) are a
## Guidelines

- Use this utility class to vertically separate the children of a parent element from each other.
- It can be used on any element and sets the `gap` CSS property.
- Do not use it on the Grid component.
Grid is responsible for its own gaps.
- It can be used on any other element and sets the `gap` CSS property.
It also makes the element a grid container; the gap would be ignored otherwise.
These declarations are marked with the `!important` flag to ensure they override any other gaps and display modes.
- To add a gap between 2 siblings, the first one can be given a [Margin Bottom](/docs/utilities-css-margin--docs) instead.
Expand Down
2 changes: 2 additions & 0 deletions packages/css/src/components/grid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Multiple instances of the grid component are possible on a page, but the columns
Within the grid, you create cells containing the desired content.
A cell often spans multiple columns of the grid.

The Gap utility classes must not be used on the Grid component.

## Design

The [design choices](/docs/brand-design-tokens-grid--docs) are described in the general documentation.

0 comments on commit f4dec99

Please sign in to comment.