Skip to content

Commit

Permalink
Remove $govuk-use-legacy-font code from components
Browse files Browse the repository at this point in the history
  • Loading branch information
querkmachine authored and colinrotherham committed May 4, 2023
1 parent 7cf2ca3 commit e157c7b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 75 deletions.
14 changes: 2 additions & 12 deletions src/govuk/components/back-link/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,8 @@

// Vertically align with the parent element
position: absolute;

@if $govuk-use-legacy-font {
// Begin adjustments for font baseline offset
// These should be removed when legacy font support is dropped
$offset: govuk-em(1px, $font-size);
top: $offset * -1;
bottom: $offset;
} @else {
top: 0;
bottom: 0;
}

top: 0;
bottom: 0;
left: govuk-em(3px, $font-size);

width: $chevron-size;
Expand Down
13 changes: 2 additions & 11 deletions src/govuk/components/breadcrumbs/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,8 @@
display: block;

position: absolute;

@if $govuk-use-legacy-font {
// Begin adjustments for font baseline offset
// These should be removed when legacy font support is dropped
$offset: govuk-em(1px, $font-size);
top: $offset * -1;
bottom: $offset;
} @else {
top: 0;
bottom: 0;
}
top: 0;
bottom: 0;

// Offset by the difference between the width of the non-rotated square
// and its width when rotated
Expand Down
14 changes: 0 additions & 14 deletions src/govuk/components/button/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -286,18 +286,4 @@ $govuk-button-text-colour: govuk-colour("white") !default;
// (https://github.com/w3c/csswg-drafts/issues/6310)
forced-color-adjust: auto;
}

@if $govuk-use-legacy-font {
// Begin adjustments for font baseline offset when using v1 of nta
$offset: 2;

.govuk-button {
padding-top: (govuk-spacing(2) - $govuk-border-width-form-element - ($button-shadow-size / 2) + $offset); // s1
padding-bottom: (govuk-spacing(2) - $govuk-border-width-form-element - ($button-shadow-size / 2) - $offset + 1); // s1
}

.govuk-button__start-icon {
margin-top: -3px;
}
}
}
21 changes: 0 additions & 21 deletions src/govuk/components/header/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -322,25 +322,4 @@
}
}
}

@if $govuk-use-legacy-font {
// Begin adjustments for font baseline offset
// These should be removed when the font is updated with the correct baseline
.govuk-header__logotype-crown,
.govuk-header__logotype-crown-fallback-image {
position: relative;
top: -4px;
vertical-align: middle;
}

.govuk-header {
$offset: 3px;
padding-top: $offset;
}

.govuk-header__link--homepage {
line-height: 30px;
}
// End adjustments
}
}
23 changes: 6 additions & 17 deletions src/govuk/components/tag/_index.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
@include govuk-exports("govuk/component/tag") {
.govuk-tag {
@include govuk-font($size: 16, $weight: bold, $line-height: 1);

display: inline-block;

padding-top: 5px;
padding-right: 8px;
padding-bottom: 4px;
padding-left: 8px;

// When a user customises their colours often the background is removed,
// by adding a outline we ensure that the tag component still keeps it's meaning.
// https://accessibility.blog.gov.uk/2017/03/27/how-users-change-colours-on-websites/
Expand All @@ -15,23 +21,6 @@

text-decoration: none;
text-transform: uppercase;

@if $govuk-use-legacy-font {
// Since New Transport sits slightly higher than other common fonts.
// We use intentionally uneven padding to make it balanced, this can be
// removed using the version of the font that has a more common vertical spacing.
@include govuk-font($size: 16, $weight: bold, $line-height: 1.25);
padding-top: 4px;
padding-right: 8px;
padding-bottom: 1px;
padding-left: 8px;
} @else {
@include govuk-font($size: 16, $weight: bold, $line-height: 1);
padding-top: 5px;
padding-right: 8px;
padding-bottom: 4px;
padding-left: 8px;
}
}

.govuk-tag--grey {
Expand Down

0 comments on commit e157c7b

Please sign in to comment.