Skip to content

Commit 57a7042

Browse files
Prefer NHS default $at param
1 parent 945f8dd commit 57a7042

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

packages/core/tools/_grid.scss

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@
7373
/// Grid widths are defined in the `$nhsuk-grid-widths` map.
7474
///
7575
/// By default the column width changes from 100% to specified width at the
76-
/// 'tablet' breakpoint, but other breakpoints can be specified using the `$at`
76+
/// 'desktop' breakpoint, but other breakpoints can be specified using the `$at`
7777
/// parameter.
7878
///
7979
/// @param {String} $width [full] name of a grid width from $nhsuk-grid-widths
8080
/// @param {String} $float [left] left | right
81-
/// @param {String} $at [tablet] - mobile | tablet | desktop | any custom breakpoint
81+
/// @param {String} $at [desktop] - mobile | tablet | desktop | any custom breakpoint
8282
/// @param {String} $class [nhsuk-grid-column] CSS class name (deprecated)
8383
///
8484
/// @example scss - Default
@@ -87,8 +87,8 @@
8787
/// }
8888
///
8989
/// @example scss - Customising the breakpoint where width percentage is applied
90-
/// .nhsuk-grid-column-one-half-at-desktop {
91-
/// @include nhsuk-grid-column(one-half, $at: desktop);
90+
/// .nhsuk-grid-column-one-half-at-tablet {
91+
/// @include nhsuk-grid-column(one-half, $at: tablet);
9292
/// }
9393
///
9494
/// @example scss - Customising the float direction
@@ -101,14 +101,14 @@
101101
///
102102
/// @link https://github.com/alphagov/govuk-frontend Original code taken from GDS (Government Digital Service)
103103

104-
@mixin nhsuk-grid-column($width: full, $float: left, $at: tablet, $class: "nhsuk-grid-column") {
104+
@mixin nhsuk-grid-column($width: full, $float: left, $at: desktop, $class: "nhsuk-grid-column") {
105105
@if $class {
106106
.#{$class}-#{$width} {
107107
@include nhsuk-grid-column($width, $float, $at, $class: false);
108108
}
109109
} @else {
110110
box-sizing: border-box;
111-
@if $at != desktop {
111+
@if $at != tablet {
112112
width: 100%;
113113
}
114114
padding: 0 $nhsuk-gutter-half;

packages/core/tools/grid.unit.test.mjs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ describe('Grid system', () => {
124124
width: 100%;
125125
padding: 0 16px;
126126
}
127-
@media (min-width: 40.0625em) {
127+
@media (min-width: 48.0625em) {
128128
.nhsuk-grid-column-full {
129129
width: 100%;
130130
float: left;
@@ -152,7 +152,7 @@ describe('Grid system', () => {
152152
width: 100%;
153153
padding: 0 16px;
154154
}
155-
@media (min-width: 40.0625em) {
155+
@media (min-width: 48.0625em) {
156156
.nhsuk-grid-column-two-thirds {
157157
width: 66.6666666667%;
158158
float: left;
@@ -177,6 +177,7 @@ describe('Grid system', () => {
177177
expect(results.css).toBe(outdent`
178178
.nhsuk-grid-column-one-quarter-at-desktop {
179179
box-sizing: border-box;
180+
width: 100%;
180181
padding: 0 16px;
181182
}
182183
@media (min-width: 48.0625em) {
@@ -235,7 +236,7 @@ describe('Grid system', () => {
235236
width: 100%;
236237
padding: 0 16px;
237238
}
238-
@media (min-width: 40.0625em) {
239+
@media (min-width: 48.0625em) {
239240
.nhsuk-grid-column-one-half-right {
240241
width: 50%;
241242
float: right;
@@ -261,7 +262,7 @@ describe('Grid system', () => {
261262
width: 100%;
262263
padding: 0 16px;
263264
}
264-
@media (min-width: 40.0625em) {
265+
@media (min-width: 48.0625em) {
265266
.nhsuk-grid-column-full {
266267
width: 100%;
267268
float: left;
@@ -287,7 +288,7 @@ describe('Grid system', () => {
287288
width: 100%;
288289
padding: 0 16px;
289290
}
290-
@media (min-width: 40.0625em) {
291+
@media (min-width: 48.0625em) {
291292
.large-column-three-quarters {
292293
width: 75%;
293294
float: left;

0 commit comments

Comments
 (0)