Skip to content

Commit dbfaa89

Browse files
authored
feat: Add Orange font-face for Helvetica Neue plus medium font weight (#3255)
1 parent 5ffa46d commit dbfaa89

File tree

9 files changed

+46
-12
lines changed

9 files changed

+46
-12
lines changed

packages/orange/scss/tokens/_composite.scss

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,19 @@ $ouds-elevation-sticky: $ouds-elevation-x-sticky $ouds-elevation-y-sticky $ouds-
1414

1515
// Font
1616

17+
// stylelint-disable value-keyword-case, scss/dollar-variable-colon-space-after
18+
// scss-docs-start ouds-composite-font-sans-serif
1719
$custom-font-name: "HelvNeueOrange" !default;
1820

1921
// Map of CDN URLs for custom font, with weight as keys
20-
$custom-font-cdn-urls: () !default;
22+
$custom-font-cdn-urls: (
23+
$ouds-font-weight-system-web-default: "https://mastermedia.dam-broadcast.com/pm_12751_490_490071-myaimdgylf--HelveticaNeue-Default.woff2",
24+
$ouds-font-weight-system-web-moderate: "https://mastermedia.dam-broadcast.com/pm_12751_490_490074-tqtijgs7e4--HelveticaNeue-Moderate.woff2",
25+
$ouds-font-weight-system-web-strong: "https://mastermedia.dam-broadcast.com/pm_12751_490_490077-wejriti88u--HelveticaNeue-Strong.woff2"
26+
) !default;
2127

22-
// stylelint-disable value-keyword-case, scss/dollar-variable-colon-space-after
23-
// scss-docs-start ouds-composite-font-sans-serif
2428
$ouds-font-family-sans-serif-stack:
25-
// Custom OUDS font
29+
// OUDS custom font
2630
$custom-font-name,
2731
// Older macOS and iOS
2832
"Helvetica Neue",

packages/sosh/scss/tokens/_composite.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ $ouds-elevation-sticky: $ouds-elevation-x-sticky $ouds-elevation-y-sticky $ouds-
1414

1515
// Font
1616

17+
// stylelint-disable value-keyword-case, scss/dollar-variable-colon-space-after
18+
// scss-docs-start ouds-composite-font-sans-serif
1719
$custom-font-name: "Sosh" !default;
1820

1921
// Map of CDN URLs for custom font, with weight as keys
@@ -22,10 +24,8 @@ $custom-font-cdn-urls: (
2224
$ouds-font-weight-system-web-strong: "https://mastermedia.dam-broadcast.com/pm_12751_481_481815-qd9nelrt7o--Sosh-Bold.woff2"
2325
) !default;
2426

25-
// stylelint-disable value-keyword-case, scss/dollar-variable-colon-space-after
26-
// scss-docs-start ouds-composite-font-sans-serif
2727
$ouds-font-family-sans-serif-stack:
28-
// Custom OUDS font
28+
// OUDS custom font
2929
$custom-font-name,
3030
// Basic web fallback
3131
Arial,

scss/_maps.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ $ouds-font-sizes: (
120120

121121
$ouds-font-weights: (
122122
normal: $ouds-font-weight-system-web-default,
123-
bold: $ouds-font-weight-system-web-strong
123+
medium: $ouds-font-weight-system-web-moderate,
124+
bold: $ouds-font-weight-system-web-strong,
124125
) !default;
125126

126127
$ouds-icon-sizes: ("small", "medium", "large") !default;

scss/tests/customize/_ouds-web-bootstrap-utilities.test.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3500,6 +3500,10 @@ $utilities: ();
35003500
font-weight: 400 !important;
35013501
}
35023502

3503+
.fw-medium {
3504+
font-weight: 500 !important;
3505+
}
3506+
35033507
.fw-bold {
35043508
font-weight: 700 !important;
35053509
}
@@ -14315,6 +14319,10 @@ $utilities: ();
1431514319
font-weight: 400 !important;
1431614320
}
1431714321

14322+
.fw-medium {
14323+
font-weight: 500 !important;
14324+
}
14325+
1431814326
.fw-bold {
1431914327
font-weight: 700 !important;
1432014328
}

site/src/content/docs/content/reboot.mdx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,17 @@ The `:root` and child elements are updated to provide better page-wide defaults.
5050
- The `:root` children also sets a global `font-family`, `font-weight`, `line-height`, and `color`. This is inherited later by some form elements to prevent font inconsistencies.
5151
- For safety, the `:root` children has a declared `background-color`, defaulting to `#fff`.
5252

53-
## Native font stack
53+
## Font stack
54+
OUDS Web uses custom fonts loaded from a CDN, to ensure optimum text rendering on every device and OS, and to benefit from the browser's cache.
5455

55-
OUDS Web utilizes a "native font stack" or "system font stack" for optimum text rendering on every device and OS. These system fonts have been designed specifically with today’s devices in mind, with improved rendering on screens, variable font support, and more. Read more about [native font stacks in this *Smashing Magazine* article](https://www.smashingmagazine.com/2015/11/using-system-ui-fonts-practical-guide/).
56+
OUDS Web utilizes a native font stack or system font stack” — as a fallback for custom font — for optimum text rendering on every device and OS. These system fonts have been designed specifically with today’s devices in mind, with improved rendering on screens, variable font support, and more. Read more about [native font stacks in this *Smashing Magazine* article](https://www.smashingmagazine.com/2015/11/using-system-ui-fonts-practical-guide/).
5657

5758
<ScssDocs name="ouds-composite-font-sans-serif" file={`packages/${getConfig().brand}/scss/tokens/_composite.scss`} />
5859

5960
This `font-family` is applied to the `<body>` and automatically inherited globally throughout OUDS Web. To switch the global `font-family`, update `$font-family-base` and recompile OUDS Web.
6061

62+
The font faces are generated directly in the `_root.scss` file, based on the `$custom-font-cdn-urls` map variable. You can customize these URLs if needed (for example, to avoid loading resources from the Internet).
63+
6164
The following `font-family` is applied on every code basis element. To switch the global `font-family`, update `$font-family-code` and recompile OUDS Web.
6265

6366
<ScssDocs name="ouds-composite-font-monospace" file={`packages/${getConfig().brand}/scss/tokens/_composite.scss`} />

site/src/content/docs/content/typography.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ toc: true
1010

1111
OUDS Web sets basic global display, typography, and link styles. When more control is needed, check out the [textual utility classes]([[docsref:/utilities/text]]).
1212

13-
- Use a [native font stack]([[docsref:/content/reboot#native-font-stack]]) that selects the best `font-family` for each OS and device.
13+
- Use a [font stack]([[docsref:/content/reboot#font-stack]]) of a custom font with native fonts fallback that selects the best `font-family` for each OS and device.
1414
- For a more inclusive and accessible type scale, we use the browser’s default root `font-size` (typically 16px) so visitors can customize their browser defaults as needed.
1515
- Use the `$font-family-base`, `$font-size-base`, and `$line-height-base` attributes as our typographic base applied to the `:root` children.
1616
- Use `max-width` on all font references for readability reasons. If you want to get rid of the `max-width`, please make sure to use our `.mw-none` [width utility]([[docsref:/utilities/sizing]]).

site/src/content/docs/migrations/migration-from-boosted.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,15 @@ From now on, OUDS Web won’t embed Bootstrap elements that are not part of Oran
4242

4343
## Fonts
4444

45-
OUDS Web doesn’t use the Helvetica Neue font. Instead, it uses the system font stack. This means that the font will be slightly different depending on the operating system and browser being used.
45+
OUDS Web doesn’t provide Helvetica Neue font files. Instead, it loads the font from a CDN in order to share the cached files between every project using OUDS Web.
4646

4747
Technically, it means that you can get rid of the following things:
4848
- Helvetica Neue woff2 files: `fonts/HelvNeue55_W1G.woff2`, `fonts/HelvNeue75_W1G.woff2`, `fonts/HelveticaNeueW20-55Roman.woff2`, and `fonts/HelveticaNeueW20-75Bold.woff2`.
4949
- `orange-helvetica.*.css` file (default, RTL, or minified version).
5050
- If you were customizing your Sass compilation, you can remove the `@import "orange-helvetica";` line from your Sass files if it was there.
5151

52+
Read more about the [font stack]([[docsref:/content/reboot#font-stack]]) for more details.
53+
5254
## Content styles
5355

5456
### Typography

site/src/content/docs/migrations/migration.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ toc: true
1212

1313
<hr />
1414

15+
### Core
16+
17+
- <span class="tag tag-small rounded-none tag-positive">New</span> OUDS Web now uses custom fonts loaded from a CDN for consistency in visual rendering across environments. Read more about the [font stack]([[docsref:/content/reboot#font-stack]]).
18+
1519
### Forms
1620

1721
#### Checkboxes

site/src/content/docs/utilities/text.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,20 @@ Customize your available `font-size`s by modifying the `$font-sizes` Sass map.
150150

151151
Quickly change the `font-weight` of text with these utilities. `font-weight` utilities are abbreviated as `.fw-*`.
152152

153+
<BrandSpecific brand="orange">
154+
<Callout type="warning">
155+
The medium font-weight can only be used with `label` and `body` [font references]([[docsref:/content/typography/#regular-texts]]).
156+
</Callout>
157+
158+
<Example code={`<p class="fw-bold">Bold text.</p>
159+
<p class="fw-medium">Medium weight text.</p>
160+
<p class="fw-normal">Normal weight text.</p>`} />
161+
</BrandSpecific>
162+
163+
<BrandSpecific brand="sosh">
153164
<Example code={`<p class="fw-bold">Bold text.</p>
154165
<p class="fw-normal">Normal weight text.</p>`} />
166+
</BrandSpecific>
155167

156168
<BootstrapCompatibility>
157169

0 commit comments

Comments
 (0)