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

Condensed container component #10617

Closed
1 task done
janhassel opened this issue Feb 2, 2022 · 1 comment · Fixed by #13287
Closed
1 task done

Condensed container component #10617

janhassel opened this issue Feb 2, 2022 · 1 comment · Fixed by #13287
Assignees
Labels
proposal: accepted This request has gone through triaging and we are accepting PR's against it. type: enhancement 💡

Comments

@janhassel
Copy link
Member

janhassel commented Feb 2, 2022

Summary

Related: #6202, #7704, #10616

This issue is to further discuss the addition of a utility component which would locally override spacing tokens to support condensed UI zones like sidebars based on a discussion with @tw15egan and @aagonzales.


In situations where many components (especially form elements) are placed in a narrow container such as a sidebar, the need for more condensed components has been identified. The current sm size or proposed xs size variants do not fully cover this use case as the horizontal space / padding inside the components is critical.

The idea @tw15egan, @aagonzales and I came up with is to offer a utility component that locally overrides the spacing token scale to only affect its children.
This would mean that (theoretically) no additional prop or individual component work would be needed and all components should adapt correctly and consistently.

:root {
  --cds-spacing-05: 1rem;
}

.cds--condensed-zone {
  --cds-spacing-05: 0.5rem; // can be hardcoded or dynamically calculated with a predefined factor
}

Any component using spacing-05 (like for padding-left and padding-right) would then render as a narrow / condensed variant. Obviously, the entire spacing scale should be redefined instead of just individual values.

This utility component should only be used in contexts with no alignment to other components, meaning that it should not be used in the main area of a UI for example but only in something like a slide-in or slide-over sidebar. In this context all components should be children of the utility component to achieve consistency and alignment within the zone. This needs to be clearly stated in the design guidance / documentation.

The type scale would also likely need to be adjusted a bit.

Justification

No response

Desired UX and success metrics

No response

Required functionality

No response

Specific timeline issues / requests

No response

Available extra resources

Our UX Engineering team will be able to support the development of this enhancement

Code of Conduct

@tw15egan tw15egan added proposal: open This request has gone through triaging. We're determining whether we take this on or not. and removed status: needs triage 🕵️‍♀️ labels Feb 2, 2022
@thyhmdo
Copy link
Member

thyhmdo commented Feb 7, 2022

This will require more research and visual/design work for this proposal

@abbeyhrt abbeyhrt added proposal: accepted This request has gone through triaging and we are accepting PR's against it. and removed proposal: open This request has gone through triaging. We're determining whether we take this on or not. labels Feb 21, 2022
@kodiakhq kodiakhq bot closed this as completed in #13287 Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal: accepted This request has gone through triaging and we are accepting PR's against it. type: enhancement 💡
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants