Skip to content

Commit

Permalink
Fixes v2 font name (#1446)
Browse files Browse the repository at this point in the history
Fixes v2 font name
  • Loading branch information
aliuk2012 authored Jun 12, 2019
2 parents 42711f1 + d465dd4 commit 880ff50
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
10 changes: 5 additions & 5 deletions src/helpers/_font-faces.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@

@import "../tools/exports";

/// Font Face - GOV.UK Transport
/// Font Face - GDS Transport
///
/// Outputs the font-face declaration for GOV.UK Transport at the root of the CSS document
/// Outputs the font-face declaration for GDS Transport at the root of the CSS document
/// the first time it is called.
///
/// @access private

@mixin _govuk-font-face-govuk-transport {
@mixin _govuk-font-face-gds-transport {
@include govuk-exports("govuk/helpers/font-faces") {
@at-root {
/*! Copyright (c) 2011 by Margaret Calvert & Henrik Kubel. All rights reserved. The font has been customised for exclusive use on gov.uk. This cut is not commercially available. */

@font-face {
font-family: "GOVUKTransport";
font-family: "GDS Transport";
src: govuk-font-url("light-68f0c84f0e-v2.woff2") format("woff2"),
govuk-font-url("light-222368e53d-v2.woff") format("woff");
font-weight: normal;
Expand All @@ -29,7 +29,7 @@
}

@font-face {
font-family: "GOVUKTransport";
font-family: "GDS Transport";
src: govuk-font-url("bold-9561e2d007-v2.woff2") format("woff2"),
govuk-font-url("bold-5d3836b441-v2.woff") format("woff");
font-weight: bold;
Expand Down
6 changes: 3 additions & 3 deletions src/helpers/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;

// If the user is using the default GOV.UK Transport font we need to include
// If the user is using the default GDS Transport font we need to include
// the font-face declarations.
//
// We do not need to include the GOV.UK Transport font-face declarations if
// We do not need to include the GDS Transport font-face declarations if
// alphagov/govuk_template is being used since nta will already be included by
// default.
@if ($govuk-include-default-font-face) {
@include _govuk-font-face-govuk-transport;
@include _govuk-font-face-gds-transport;
}

@include govuk-media-query($media-type: print) {
Expand Down
10 changes: 5 additions & 5 deletions src/helpers/typography.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ describe('@mixin govuk-typography-common', () => {
const resultsString = results.css.toString()

expect(resultsString).toContain(`@font-face`)
expect(resultsString).toContain(`font-family: "GOVUKTransport"`)
expect(resultsString).toContain(`font-family: "GOVUKTransport"`)
expect(resultsString).toContain(`font-family: "GDS Transport"`)
expect(resultsString).toContain(`font-family: "GDS Transport"`)
})
it('should not output a @font-face declaration when the user has changed their font', async () => {
const sass = `
Expand All @@ -85,7 +85,7 @@ describe('@mixin govuk-typography-common', () => {
const resultsString = results.css.toString()

expect(resultsString).not.toContain(`@font-face`)
expect(resultsString).not.toContain(`font-family: "GOVUKTransport"`)
expect(resultsString).not.toContain(`font-family: "GDS Transport"`)
expect(resultsString).not.toContain(`font-family: "ntatabularnumbers"`)
})
it('should not output a @font-face declaration when the user wants compatibility with GOV.UK Template', async () => {
Expand Down Expand Up @@ -127,8 +127,8 @@ describe('@mixin govuk-typography-common', () => {
const resultsString = results.css.toString()

expect(resultsString).not.toContain(`@font-face`)
expect(resultsString).toContain(`font-family: "GOVUKTransport"`)
expect(resultsString).toContain(`font-family: "GOVUKTransport"`)
expect(resultsString).toContain(`font-family: "GDS Transport"`)
expect(resultsString).toContain(`font-family: "GDS Transport"`)
})
})

Expand Down
4 changes: 2 additions & 2 deletions src/settings/_typography-font-families.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
/// @group settings/typography
////

/// List of font families to use if using GOV.UK Transport (the default font
/// List of font families to use if using GDS Transport (the default font
/// 'stack' for GOV.UK)
///
/// @type List
/// @access public

$govuk-font-family-govuk-transport: "GOVUKTransport", Arial, sans-serif;
$govuk-font-family-gds-transport: "GDS Transport", Arial, sans-serif;

/// List of font families to use if using NTA (old font 'stack' for
/// GOV.UK)
Expand Down
6 changes: 3 additions & 3 deletions src/settings/_typography-font.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ $govuk-use-legacy-font: if((

$govuk-font-family: if($govuk-use-legacy-font,
$govuk-font-family-nta,
$govuk-font-family-govuk-transport
$govuk-font-family-gds-transport
) !default;

/// Font families to use when displaying tabular numbers
Expand All @@ -54,13 +54,13 @@ $govuk-font-family-print: sans-serif !default;
/// Include the default @font-face declarations
///
/// If you have set $govuk-font-family to something other than
/// `$govuk-font-family-govuk-transport` this option is disabled by default.
/// `$govuk-font-family-gds-transport` this option is disabled by default.
///
/// @type Boolean
/// @access public

$govuk-include-default-font-face: (
$govuk-font-family == $govuk-font-family-govuk-transport
$govuk-font-family == $govuk-font-family-gds-transport
) !default;

// =========================================================
Expand Down

0 comments on commit 880ff50

Please sign in to comment.