-
Notifications
You must be signed in to change notification settings - Fork 224
Spacing
Viljami Salminen edited this page Sep 28, 2018
·
12 revisions
Vue Design System uses the following framework and Sass Mixins for creating a predictable and harmonious spacing.
- Inset spacing: For all user interface containers.
- Inset squish spacing: Same as previous, but a squished inset reduces space top and bottom, for example by 50%. Used for buttons, inputs, data table cells, list items, etc.
- Stack spacing: For all stacked content. So for example panels, form fields and anything else that is stacked vertically.
- Inline spacing: For pills, tags, breadcrumbs, side-by-side form fields etc. Things that are displayed inline.
You simply use these via Sass Mixins, like so:
// Stack space
.heading {
@include stack-space($space-l);
}
// Inset space
.container {
@include inset-space($space-xl);
}
// Inline space
.pill {
@include inline-space($space-s);
}
// You can also combine inset/inset-squish and inline/stack space
.button {
@include inset-squish-space($space-l);
@include inline-space($space-s);
}
These Sass helpers are located in src/styles/_spacing.scss if you want to further tweak them.
- Most components come with spacing included using the above mixins.
- A developer is able to just lay out components and they will take care of the spacing automatically as well as they can.
- Collisions with component level spacing and inset spacing are solved systematically using advanced CSS selectors inside space mixins.
Most of these ideas are from the following articles:
- Space in Design Systems: https://medium.com/eightshapes-llc/space-in-design-systems-188bcbae0d62
- A framework for creating a predictable & harmonious spacing system for faster design-dev handoff: https://blog.prototypr.io/a-framework-for-creating-a-predictable-and-harmonious-spacing-system-8eee8aaf773c
- Padding in Lightning Design System: https://www.lightningdesignsystem.com/utilities/padding
- Getting Started: How to install and run Vue Design System.
- Terminology: Introduction to the system concepts and its hierarchy.
- Naming of Things: Naming is hard, so it’s good to have clear guidelines.
- Directory Structure: What goes where and why.
-
Working with the System: Concrete examples on how to work with
Tokens
,Elements
,Patterns
andTemplates
. - Editing Living Documentation: How to customize the living system documentation.
- Spacing: A framework for creating a predictable and harmonious spacing.
- Component Status: Clear labels that reflect the state of completion.
- Component QA: How to review new components and keep the quality high.
- Contributing: A set of guidelines for contributing to the system.
- Code of Conduct: By participating you agree to abide by its terms.
- Frequently Asked Questions: How to use icons, how to use font-face, etc.
- Changelog: See releases pafge for the full changelog.