Skip to content

Commit 97b034b

Browse files
Deprecate govuk-grid-row mixin
Wrapping the row functionality up in a mixin offers little other than the ability to use a custom name, but we’re not sure there’s a need for users to do that. Simplify the code by deprecating the mixin and just using the code to create the concrete class directly. See: alphagov/govuk-frontend#1090 Co-authored-by: Oliver Byford <oliver.byford@digital.cabinet-office.gov.uk>
1 parent 869f2f5 commit 97b034b

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

packages/core/objects/_grid.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55
////
66

77
@include nhsuk-exports("govuk/objects/grid") {
8-
@include govuk-grid-row;
8+
.nhsuk-grid-row {
9+
@include clearfix;
10+
margin-right: -($nhsuk-gutter-half);
11+
margin-left: -($nhsuk-gutter-half);
12+
}
13+
914
@include govuk-grid-column(one-quarter);
1015
@include govuk-grid-column(one-third);
1116
@include govuk-grid-column(one-half);

packages/core/tools/_grid.scss

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,26 @@
4141
///
4242
/// @example scss - Customising the class name
4343
/// @include govuk-grid-row("app-grid");
44+
///
45+
/// @deprecated To be removed in v10.0, replaced by the nhsuk-grid-row class
4446

45-
@mixin govuk-grid-row($class: "nhsuk-grid-row") {
47+
@mixin nhsuk-grid-row($class: "nhsuk-grid-row") {
4648
.#{$class} {
4749
@include clearfix;
4850
margin-left: -($nhsuk-gutter-half);
4951
margin-right: -($nhsuk-gutter-half);
5052
}
5153
}
5254

55+
/// Generate grid row styles (deprecated)
56+
///
57+
/// @alias nhsuk-grid-row
58+
/// @deprecated To be removed in v10.0, replaced by the nhsuk-grid-row class
59+
60+
@mixin govuk-grid-row($args...) {
61+
@include nhsuk-grid-row($args...);
62+
}
63+
5364
/// Generate grid column styles
5465
///
5566
/// Creates a cross browser grid column with a class of '.govuk-grid-column' by

0 commit comments

Comments
 (0)