From 155a06528176719050daea21018715f8b346674b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Moreira?= Date: Mon, 14 May 2018 16:50:00 +0100 Subject: [PATCH] feat(ui-toolkit): update spacing guidelines --- packages/ui-toolkit/src/grids/Baseline.md | 13 - packages/ui-toolkit/src/grids/Readme.md | 14 + .../ui-toolkit/src/grids/inline-example.svg | 89 ++++ packages/ui-toolkit/src/grids/inline.svg | 20 + .../ui-toolkit/src/grids/inset-example.svg | 168 +++++++ packages/ui-toolkit/src/grids/inset.svg | 74 ++++ packages/ui-toolkit/src/grids/spacing.svg | 14 + .../src/grids/squish-inset-example.svg | 416 ++++++++++++++++++ .../ui-toolkit/src/grids/squish-inset.svg | 90 ++++ .../ui-toolkit/src/grids/stack-example.svg | 103 +++++ packages/ui-toolkit/src/grids/stack.svg | 24 + packages/ui-toolkit/src/grids/vertical.md | 121 +++++ packages/ui-toolkit/styleguide.config.js | 12 +- 13 files changed, 1144 insertions(+), 14 deletions(-) delete mode 100644 packages/ui-toolkit/src/grids/Baseline.md create mode 100644 packages/ui-toolkit/src/grids/inline-example.svg create mode 100644 packages/ui-toolkit/src/grids/inline.svg create mode 100644 packages/ui-toolkit/src/grids/inset-example.svg create mode 100644 packages/ui-toolkit/src/grids/inset.svg create mode 100644 packages/ui-toolkit/src/grids/spacing.svg create mode 100644 packages/ui-toolkit/src/grids/squish-inset-example.svg create mode 100644 packages/ui-toolkit/src/grids/squish-inset.svg create mode 100644 packages/ui-toolkit/src/grids/stack-example.svg create mode 100644 packages/ui-toolkit/src/grids/stack.svg create mode 100644 packages/ui-toolkit/src/grids/vertical.md diff --git a/packages/ui-toolkit/src/grids/Baseline.md b/packages/ui-toolkit/src/grids/Baseline.md deleted file mode 100644 index 2211de4b..00000000 --- a/packages/ui-toolkit/src/grids/Baseline.md +++ /dev/null @@ -1,13 +0,0 @@ -### Baseline & Spacing - -Most of the horizontal spacing between different elements and components is derived from 6 px. For example, the most common horizontal distance between elements of a component or components is 18 px. Another, less frequent, measurement is 12 px. The choice between 6, 12 or 18 px is based on visual and functional proximity of objects. - -```jsx noeditor -const baseline = require('./baseline.svg'); - - -``` diff --git a/packages/ui-toolkit/src/grids/Readme.md b/packages/ui-toolkit/src/grids/Readme.md index f4fa968a..8eb55a8f 100644 --- a/packages/ui-toolkit/src/grids/Readme.md +++ b/packages/ui-toolkit/src/grids/Readme.md @@ -33,3 +33,17 @@ const small = require('./small.svg'); marginBottom: 40 }} src={small} /> ``` + +### Baseline & Spacing + +Most of the horizontal spacing between different elements and components is derived from 6 px. For example, the most common horizontal distance between elements of a component or components is 18 px. Another, less frequent, measurement is 12 px. The choice between 6, 12 or 18 px is based on visual and functional proximity of objects. + +```jsx noeditor +const baseline = require('./baseline.svg'); + + +``` diff --git a/packages/ui-toolkit/src/grids/inline-example.svg b/packages/ui-toolkit/src/grids/inline-example.svg new file mode 100644 index 00000000..a0db7540 --- /dev/null +++ b/packages/ui-toolkit/src/grids/inline-example.svg @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/ui-toolkit/src/grids/inline.svg b/packages/ui-toolkit/src/grids/inline.svg new file mode 100644 index 00000000..0d950869 --- /dev/null +++ b/packages/ui-toolkit/src/grids/inline.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/packages/ui-toolkit/src/grids/inset-example.svg b/packages/ui-toolkit/src/grids/inset-example.svg new file mode 100644 index 00000000..e6c7d9ba --- /dev/null +++ b/packages/ui-toolkit/src/grids/inset-example.svg @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/ui-toolkit/src/grids/inset.svg b/packages/ui-toolkit/src/grids/inset.svg new file mode 100644 index 00000000..43ad179d --- /dev/null +++ b/packages/ui-toolkit/src/grids/inset.svg @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/ui-toolkit/src/grids/spacing.svg b/packages/ui-toolkit/src/grids/spacing.svg new file mode 100644 index 00000000..496ade33 --- /dev/null +++ b/packages/ui-toolkit/src/grids/spacing.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/packages/ui-toolkit/src/grids/squish-inset-example.svg b/packages/ui-toolkit/src/grids/squish-inset-example.svg new file mode 100644 index 00000000..d1ba06e2 --- /dev/null +++ b/packages/ui-toolkit/src/grids/squish-inset-example.svg @@ -0,0 +1,416 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/ui-toolkit/src/grids/squish-inset.svg b/packages/ui-toolkit/src/grids/squish-inset.svg new file mode 100644 index 00000000..83e68171 --- /dev/null +++ b/packages/ui-toolkit/src/grids/squish-inset.svg @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/ui-toolkit/src/grids/stack-example.svg b/packages/ui-toolkit/src/grids/stack-example.svg new file mode 100644 index 00000000..d77b8bdb --- /dev/null +++ b/packages/ui-toolkit/src/grids/stack-example.svg @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/ui-toolkit/src/grids/stack.svg b/packages/ui-toolkit/src/grids/stack.svg new file mode 100644 index 00000000..18ab1073 --- /dev/null +++ b/packages/ui-toolkit/src/grids/stack.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/ui-toolkit/src/grids/vertical.md b/packages/ui-toolkit/src/grids/vertical.md new file mode 100644 index 00000000..7054e8ff --- /dev/null +++ b/packages/ui-toolkit/src/grids/vertical.md @@ -0,0 +1,121 @@ +### Spacing + +In order to mainitain visual consistency and to make building as painless as possible, Triton employs a series of pre-defined spacing values and a variety of ways to implement those values. + +### Spacing values + +When defining the space necessary between and within components, alway use one of these pre-defined values. By using only 5 preset values, we can minimize inconsistency and ensure meaningful use of whitespace. + +```jsx noeditor +const spacing = require('./spacing.svg'); + + +``` + +### Stack - Vertical spacing + +Stack, or the vertical spacing between elements, uses all of the values provided above and is the most common form of spacing used in Triton. Stack is used to seperate components from one another, but is not used for internal padding of cards. + +```jsx noeditor +const stack = require('./stack.svg'); + + +``` + +

Stack example

+ +```jsx noeditor +const stackExample = require('./stack-example.svg'); + + +``` + +### Inline - Horizontal spacing + +Inline, or the horizontal spacing between elements, is used to provide additional horizontal spacing when an element is not attached directly to the grid. Inline uses all the spacing values, except for the ‘Giant’ size, as when inline get’s to that size, designers should aim to attach components to the underlying grid instead of using spacing values. + +```jsx noeditor +const inline = require('./inline.svg'); + + +``` + +

Inline example

+ +```jsx noeditor +const inlineExample = require('./inline-example.svg'); + + +``` + +### Uniform Inset — Interior padding + +Uniform Inset, or the equal padding on the interior of a component, takes the place of stack and inline when attempting to correctly space the contents of a card or component. Uniform inset adopts all but the ‘Giant’ spacing value to avoid an overwhelming amount of white-space in the card designs. + +```jsx noeditor +const inset = require('./inset.svg'); + + +``` + +

Uniform Inset example

+ +```jsx noeditor +const insetExample = require('./inset-example.svg'); + + +``` + +### Squish Inset — Irregular interior padding + +Squish inset, or irregular interior padding, adopts similar patterns of use to the ‘Uniform inset’ except has a different application of the spacing values. The ‘Squish inset’ has less padding on the top and bottom compared to left and right. + +```jsx noeditor +const squishInset = require('./squish-inset.svg'); + + +``` + +

Squish Inset example

+ +```jsx noeditor +const squishInsetExample = require('./squish-inset-example.svg'); + + +``` diff --git a/packages/ui-toolkit/styleguide.config.js b/packages/ui-toolkit/styleguide.config.js index ea6e9905..096a5eb2 100644 --- a/packages/ui-toolkit/styleguide.config.js +++ b/packages/ui-toolkit/styleguide.config.js @@ -60,7 +60,17 @@ module.exports = { name: 'Grids', content: 'src/grids/Readme.md', description: - 'Triton’s grid aims to have maximum coverage over a wide range of devices. With a maximum container width of 964px, we are able to display the main desktop experience all the way down to a tradional landscape tablet device.' + 'Triton’s grid aims to have maximum coverage over a wide range of devices. With a maximum container width of 964px, we are able to display the main desktop experience all the way down to a tradional landscape tablet device.', + sections: [ + { + name: 'Horizontal', + content: 'src/grids/Readme.md' + }, + { + name: 'Vertical', + content: 'src/grids/vertical.md' + } + ] }, { name: 'Superscript',