Skip to content

Commit 8ed1bb8

Browse files
docs(site): clarify spacing migration examples
Make the spacing demo legible on the docs site and explain what the standalone example is showing. Carry the spacing-specific QA refinements onto the spacing review branch without pulling in the later typography example cleanup.
1 parent 9bd1e69 commit 8ed1bb8

File tree

3 files changed

+24
-25
lines changed

3 files changed

+24
-25
lines changed

packages/site/styles/design-example-overrides.scss

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,23 @@ body {
2727
}
2828

2929
/*
30-
In order to show how the grid works, we need to have an element inside the
31-
grid that is visible and fills the available space with a background color.
30+
Spacing examples need a visible content block so the responsive gap beneath
31+
each item is easy to inspect in the docs iframe.
3232
*/
33-
.ofh-grid-row > .spacing-example div > p {
34-
background-color: $ofh-color-brand-blue-royal-2;
35-
color: $ofh-color-greyscale-white;
36-
padding: 20px;
37-
text-align: center;
33+
.spacing-example__item {
34+
border-left: 4px solid $ofh-color-brand-blue-royal-4;
3835
}
3936

40-
/*
41-
Spacing examples for on divs
42-
*/
43-
.spacing-example div {
44-
background: $ofh-color-brand-blue-royal-5;
37+
.spacing-example__item > p {
38+
background-color: $ofh-color-brand-blue-royal-2;
39+
color: $ofh-color-greyscale-white;
40+
margin: 0;
41+
padding: 12px 16px;
42+
width: fit-content;
4543
}
4644

47-
.spacing-example div:nth-of-type(odd) {
48-
background: $ofh-color-brand-blue-royal-4;
45+
.spacing-example__item:nth-of-type(odd) > p {
46+
background-color: $ofh-color-brand-blue-royal-4;
4947
}
5048

5149
/*
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<div class="spacing-example">
2-
<div class="ofh-u-padding-bottom-56"></div>
3-
<div class="ofh-u-padding-bottom-48"></div>
4-
<div class="ofh-u-padding-bottom-40"></div>
5-
<div class="ofh-u-padding-bottom-32"></div>
6-
<div class="ofh-u-padding-bottom-24"></div>
7-
<div class="ofh-u-padding-bottom-16"></div>
8-
<div class="ofh-u-padding-bottom-12"></div>
9-
<div class="ofh-u-padding-bottom-8"></div>
10-
<div class="ofh-u-padding-bottom-4"></div>
11-
<div class="ofh-u-padding-bottom-2"></div>
2+
<div class="spacing-example__item ofh-u-padding-bottom-56"><p>Size key 56</p></div>
3+
<div class="spacing-example__item ofh-u-padding-bottom-48"><p>Size key 48</p></div>
4+
<div class="spacing-example__item ofh-u-padding-bottom-40"><p>Size key 40</p></div>
5+
<div class="spacing-example__item ofh-u-padding-bottom-32"><p>Size key 32</p></div>
6+
<div class="spacing-example__item ofh-u-padding-bottom-24"><p>Size key 24</p></div>
7+
<div class="spacing-example__item ofh-u-padding-bottom-16"><p>Size key 16</p></div>
8+
<div class="spacing-example__item ofh-u-padding-bottom-12"><p>Size key 12</p></div>
9+
<div class="spacing-example__item ofh-u-padding-bottom-8"><p>Size key 8</p></div>
10+
<div class="spacing-example__item ofh-u-padding-bottom-4"><p>Size key 4</p></div>
11+
<div class="spacing-example__item ofh-u-padding-bottom-2"><p>Size key 2</p></div>
1212
</div>

packages/site/views/design-system/styles/spacing/index.njk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{% set pageDescription = "Spacing pages and setting the width of page elements so that they are consistent, responsive and clear." %}
33
{% set pageSection = "Design system" %}
44
{% set subSection = "Foundation styles" %}
5-
{% set dateUpdated = "April 2023" %}
5+
{% set dateUpdated = "March 2026" %}
66
{% set backlog_issue_id = "24" %}
77
{% set hideContact = "true" %}
88

@@ -145,6 +145,7 @@
145145
<p class="rich-text">The last part of the class is the spacing size key. For example, <code>ofh-u-margin-56</code> uses the <code>56</code> responsive spacing token.</p>
146146

147147
<h3 id="spacing-examples" class="ofh-u-padding-top-12">Examples</h3>
148+
<p>In the default example below, the blue label is the content block and the white gap underneath it is the responsive spacing being applied.</p>
148149

149150
{{ designExample({
150151
group: "styles",

0 commit comments

Comments
 (0)