Skip to content

Commit

Permalink
Prefer mixin mq() versus govuk-media-query()
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrotherham committed Feb 20, 2025
1 parent 49f12b0 commit cbcf74b
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions packages/components/error-summary/_error-summary.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
// Not using responsive spacing as we want smaller margin on mobile
margin-bottom: nhsuk-spacing(5);

@include govuk-media-query($from: tablet) {
@include mq($from: tablet) {
margin-bottom: nhsuk-spacing(7);
}

border: $nhsuk-border-width-mobile solid $nhsuk-error-color;

@include govuk-media-query($from: tablet) {
@include mq($from: tablet) {
border: $nhsuk-border-width solid $nhsuk-error-color;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/components/tabs/_tabs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

// JavaScript enabled
.js-enabled {
@include govuk-media-query($from: tablet) {
@include mq($from: tablet) {
.nhsuk-tabs__list {
@include clearfix;
border-bottom: 1px solid $nhsuk-border-color;
Expand Down
6 changes: 3 additions & 3 deletions packages/core/objects/_width-container.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@

max-width: $nhsuk-page-width; // [2]

@include govuk-media-query($from: desktop) {
@include mq($from: desktop) {
margin: 0 $nhsuk-gutter; // [3]
}

// [4]
@include govuk-media-query($and: "(min-width: #{($nhsuk-page-width + $nhsuk-gutter * 2)})") {
@include mq($and: "(min-width: #{($nhsuk-page-width + $nhsuk-gutter * 2)})") {
margin: 0 auto;
}
}
Expand All @@ -31,7 +31,7 @@
margin: 0 $nhsuk-gutter-half;
max-width: 100%; // [5]

@include govuk-media-query($from: desktop) {
@include mq($from: desktop) {
margin: 0 $nhsuk-gutter; // [3]
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/tools/_grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ $_nhsuk-grid-widths: (
@if $at != desktop {
width: 100%;
}
@include govuk-media-query($from: $at) {
@include mq($from: $at) {
float: $float;
width: grid-width($width);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/tools/_spacing.scss
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
#{$property}-#{$direction}: $breakpoint-value iff($important, !important);
}
} @else {
@include govuk-media-query($from: $breakpoint) {
@include mq($from: $breakpoint) {
@if $direction == all {
#{$property}: $breakpoint-value iff($important, !important);
} @else {
Expand Down
6 changes: 3 additions & 3 deletions packages/core/tools/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
@mixin nhsuk-text-color {
color: $nhsuk-text-color;

@include govuk-media-query($media-type: print) {
@include mq($media-type: print) {
color: $nhsuk-print-text-color;
}
}
Expand Down Expand Up @@ -133,12 +133,12 @@
font-size: $font-size-rem;
line-height: $line-height;
} @else if $breakpoint == "print" {
@include govuk-media-query($media-type: print) {
@include mq($media-type: print) {
font-size: $font-size;
line-height: $line-height;
}
} @else {
@include govuk-media-query($from: $breakpoint) {
@include mq($from: $breakpoint) {
font-size: $font-size;
font-size: $font-size-rem;
line-height: $line-height;
Expand Down

0 comments on commit cbcf74b

Please sign in to comment.