Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add compact grid #758

Merged
merged 22 commits into from
Nov 17, 2023
Merged

Add compact grid #758

merged 22 commits into from
Nov 17, 2023

Conversation

VincentSmedinga
Copy link
Contributor

@VincentSmedinga VincentSmedinga commented Nov 16, 2023

This adds:

  1. a compact version of the grid through a density property
  2. options to add vertical whitespace above and below a grid through three margin* padding-* properties
  3. a property for Screen to left-align it.

These changes were made in the context of a prototype. Although we prefer pull requests to focus on one feature, in this case I think it would not be efficient to split them up after the fact.

The sizing of the compact grid has been presented to teams currently designing applications. They are evaluating but I don’t expect any changes.

Implementing generic utility classes for spacing seemed a bridge too far. They’re only available to the grid. Consequently, the class names are many and verbose for now.

A next step is to implement a concept of ‘theming’, as we want all grid instances to have the same density and to have typography react to the same setting. After that, we can extend the margin props to generic utility classes.

I’ve removed the temporary inner vertical whitespace in Highlight and Footer

@github-actions github-actions bot temporarily deployed to demo-DES-450-compact-grid November 16, 2023 11:52 Destroyed
@github-actions github-actions bot temporarily deployed to demo-DES-450-compact-grid November 16, 2023 11:58 Destroyed
@github-actions github-actions bot temporarily deployed to demo-DES-450-compact-grid November 16, 2023 12:38 Destroyed
@github-actions github-actions bot temporarily deployed to demo-DES-450-compact-grid November 16, 2023 12:47 Destroyed
@github-actions github-actions bot temporarily deployed to demo-DES-450-compact-grid November 16, 2023 13:26 Destroyed
packages/css/src/grid/grid.scss Outdated Show resolved Hide resolved
packages/css/src/grid/grid.scss Outdated Show resolved Hide resolved
packages/css/src/screen/screen.scss Outdated Show resolved Hide resolved
packages/react/src/Grid/Grid.tsx Outdated Show resolved Hide resolved
packages/react/src/Grid/Grid.tsx Show resolved Hide resolved
storybook/storybook-docs/src/grid.stories.mdx Outdated Show resolved Hide resolved
storybook/storybook-react/src/Grid/Grid.docs.mdx Outdated Show resolved Hide resolved
storybook/storybook-react/src/shared/argTypes.ts Outdated Show resolved Hide resolved
storybook/storybook-react/src/shared/argTypes.ts Outdated Show resolved Hide resolved
@VincentSmedinga VincentSmedinga marked this pull request as ready for review November 16, 2023 14:29
packages/css/src/grid/grid.scss Show resolved Hide resolved
packages/css/src/grid/grid.scss Show resolved Hide resolved
packages/react/src/Grid/Grid.tsx Show resolved Hide resolved
storybook/storybook-docs/src/grid.stories.mdx Outdated Show resolved Hide resolved
packages/react/src/Grid/Grid.tsx Outdated Show resolved Hide resolved
@github-actions github-actions bot temporarily deployed to demo-DES-450-compact-grid November 17, 2023 10:57 Destroyed
@github-actions github-actions bot temporarily deployed to demo-DES-450-compact-grid November 17, 2023 11:35 Destroyed
@github-actions github-actions bot temporarily deployed to demo-DES-450-compact-grid November 17, 2023 11:46 Destroyed
@github-actions github-actions bot temporarily deployed to demo-DES-450-compact-grid November 17, 2023 11:49 Destroyed
@alimpens alimpens changed the base branch from main to develop November 17, 2023 12:24
alimpens
alimpens previously approved these changes Nov 17, 2023
@alimpens alimpens changed the base branch from develop to main November 17, 2023 12:25
@alimpens alimpens dismissed their stale review November 17, 2023 12:25

The base branch was changed.

@github-actions github-actions bot temporarily deployed to demo-DES-450-compact-grid November 17, 2023 12:26 Destroyed
@VincentSmedinga VincentSmedinga merged commit 7650233 into main Nov 17, 2023
3 checks passed
@VincentSmedinga VincentSmedinga deleted the feature/DES-450-compact-grid branch November 17, 2023 12:32
alimpens added a commit that referenced this pull request Nov 17, 2023
* Add padding classes

* Rename padding to space and use margin

* Use padding again because of collapsing margins

* Allow start alignment of screen

* Remove explicit horizontal centring of grid

* Implement dense grid

* Add documentation

* Make spacing a local prop for Grid for now

* Document vertical spacing

* Rename ‘space’ to ‘margin’

* Finish rename

* Prevent using vertical margin together with top or bottom

* Update design documentation

* Remove unnecessary test

* Halve the number of margin classes with local custom properties

* Add compact story and a control for density

* Revert "Allow start alignment of screen"

This reverts commit b09357d.

* Improve documentation and story controls

* Capitalise column headers

* Rename ‘margin’ to ‘padding’

* Remove docs covered by TypeScript types

Co-authored-by: Vincent Smedinga <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants