Skip to content

Commit

Permalink
Merge pull request #1289 from alphagov/update-grid-frontend
Browse files Browse the repository at this point in the history
Update grid usages to GOV.UK Frontend
  • Loading branch information
Vanita Barrett authored Apr 29, 2019
2 parents df79707 + ebe6054 commit 960e79d
Show file tree
Hide file tree
Showing 62 changed files with 212 additions and 222 deletions.
7 changes: 3 additions & 4 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// The main application stylesheet

// Components from govuk_publishing_components gem
@import 'govuk_publishing_components/all_components';

// govuk_frontend_toolkit imports
@import 'colours';
@import 'measurements';
@import 'shims';
@import 'typography';

Expand All @@ -21,9 +23,6 @@
// Components from this application
@import 'components/*';

// Components from govuk_publishing_components gem
@import 'govuk_publishing_components/all_components';

// pages specific view imports
@import 'views/case-studies';
@import 'views/coming-soon';
Expand Down
6 changes: 3 additions & 3 deletions app/assets/stylesheets/components/_back-to-top.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.app-c-back-to-top {
@include core-16;
display: inline-block;
margin-bottom: $gutter-half;
margin-left: $gutter-half;
margin-right: $gutter-half;
margin-bottom: govuk-spacing(3);
margin-left: govuk-spacing(3);
margin-right: govuk-spacing(3);
}

.app-c-back-to-top__icon {
Expand Down
14 changes: 6 additions & 8 deletions app/assets/stylesheets/components/_banner.scss
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
@import "grid_layout";

.app-c-banner {
@include responsive-bottom-margin;
@include core-19;
@include white-links;
background: $govuk-blue;
color: $white;
padding: $gutter-half;
padding: govuk-spacing(3);
clear: both;

@include media(tablet) {
padding: $gutter-two-thirds $gutter;
padding: govuk-spacing(4) govuk-spacing(6);
}
}

.app-c-banner--grid {
.app-c-banner--aside {
@include media(tablet) {
padding: $gutter;
padding: govuk-spacing(6);
}
}

Expand All @@ -26,12 +24,12 @@

.app-c-banner__title {
@include bold-27;
margin-bottom: $gutter-one-third;
margin-bottom: govuk-spacing(2);
}

.app-c-banner__desc {
@include core-19;
// Ensure the text has a line-length of around 60 characters
max-width: 30em;
padding-top: $gutter-one-third;
padding-top: govuk-spacing(2);
}
10 changes: 5 additions & 5 deletions app/assets/stylesheets/components/_contents-list-with-body.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
}

.app-c-contents-list-with-body__link-wrapper {
padding-bottom: $gutter-one-third;
padding-bottom: govuk-spacing(2);

.app-c-back-to-top {
padding-bottom: $gutter-one-third;
padding-bottom: govuk-spacing(2);
}
}

Expand All @@ -32,17 +32,17 @@
z-index: 1;

@include media(tablet) {
padding-left: $gutter-one-third;
padding-left: govuk-spacing(2);
}

.app-c-back-to-top {
color: $link-colour;
margin-bottom: 0;
padding: $gutter-half;
padding: govuk-spacing(3);
width: percentage(2 / 3);

@include media(tablet) {
padding: $gutter-two-thirds;
padding: govuk-spacing(4);
}
}

Expand Down
6 changes: 3 additions & 3 deletions app/assets/stylesheets/components/_download-link.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.app-c-download-link {
display: inline-block;
@include bold-19;
margin-top: $gutter-half;
margin-bottom: $gutter-half;
margin-top: govuk-spacing(3);
margin-bottom: govuk-spacing(3);

@include media(tablet) {
margin-top: $gutter;
margin-top: govuk-spacing(6);
}
}

Expand Down
8 changes: 4 additions & 4 deletions app/assets/stylesheets/components/_figure.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@include responsive-bottom-margin;

border-top: 1px solid $border-colour;
padding-top: $gutter-half;
padding-top: govuk-spacing(3);
}

.app-c-figure__image {
Expand All @@ -28,19 +28,19 @@

box-sizing: border-box;
float: left;
padding-left: $gutter-half;
padding-left: govuk-spacing(3);
width: 50%;
}

@include media(mobile) {
margin-top: $gutter-one-third;
margin-top: govuk-spacing(2);
}
}

.app-c-figure__figcaption-text {
margin-bottom: 0;

@include media(desktop, tablet) {
margin-bottom: $gutter-one-third;
margin-bottom: govuk-spacing(2);
}
}
6 changes: 3 additions & 3 deletions app/assets/stylesheets/components/_important-metadata.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
@include white-links;
background: $govuk-blue;
color: $white;
padding: $gutter-half;
padding: govuk-spacing(3);

@include media(tablet) {
overflow: auto;
padding: $gutter-two-thirds $gutter;
padding: govuk-spacing(4) govuk-spacing(6);
}
}

Expand All @@ -25,7 +25,7 @@

.app-c-important-metadata__term {
float: left;
padding-right: $gutter-one-third / 2;
padding-right: govuk-spacing(1);
}

.app-c-important-metadata__definition {
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/components/_published-dates.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
}

.app-c-published-dates--history {
padding-top: $gutter-one-third;
padding-top: govuk-spacing(2);
border-top: 1px solid $border-colour;
}
4 changes: 2 additions & 2 deletions app/assets/stylesheets/components/_publisher-metadata.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.app-c-publisher-metadata {
@include responsive-bottom-margin;
@include core-16;
padding-top: $gutter-half;
padding-top: govuk-spacing(3);
}

.app-c-publisher-metadata__other a {
Expand All @@ -10,7 +10,7 @@

.app-c-publisher-metadata__term {
float: left;
padding-right: $gutter-one-third / 2;
padding-right: govuk-spacing(1);

.direction-rtl & {
float: none;
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/helpers/_content-bottom-margin.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.content-bottom-margin {
margin-bottom: $gutter-two-thirds;
margin-bottom: govuk-spacing(4);

@include media(tablet) {
@include responsive-bottom-margin;
Expand Down
16 changes: 8 additions & 8 deletions app/assets/stylesheets/helpers/_parts.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
@mixin parts {
.part-navigation-container {
margin-top: $gutter;
margin-bottom: $gutter;
padding-bottom: $gutter-half;
margin-top: govuk-spacing(6);
margin-bottom: govuk-spacing(6);
padding-bottom: govuk-spacing(3);

@include media(tablet) {
margin-top: 0;
margin-bottom: 0;
padding-bottom: $gutter-half;
padding-bottom: govuk-spacing(3);
}

border-bottom: 1px solid $grey-2;
Expand All @@ -33,12 +33,12 @@

.part-title {
@include bold-27;
margin-bottom: $gutter-half;
margin-top: $gutter-half;
margin-bottom: govuk-spacing(3);
margin-top: govuk-spacing(3);

@include media(tablet) {
margin-bottom: $gutter-two-thirds;
margin-top: $gutter-two-thirds;
margin-bottom: govuk-spacing(4);
margin-top: govuk-spacing(4);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// roll out the combination of metadata + logo across
// formats so they may ultimately become component styles.
.metadata-logo-wrapper {
@extend %contain-floats;
@include govuk-clearfix;
border-top: 1px solid $border-colour;
margin-left: $gutter-half;
margin-right: $gutter-half;
margin-left: govuk-spacing(3);
margin-right: govuk-spacing(3);

.metadata-column {
padding-left: 0;
Expand All @@ -14,8 +14,8 @@
.metadata-logo {
max-height: 90px;
max-width: 100%;
padding-bottom: $gutter-half;
padding-top: $gutter-half;
padding-bottom: govuk-spacing(3);
padding-top: govuk-spacing(3);

@include media(tablet) {
float: right;
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/helpers/_sidebar-with-body.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@mixin sidebar-with-body {
.sidebar-with-body {
position: relative;
margin-bottom: $gutter * 1.5;
margin-bottom: govuk-spacing(8);
}
}
8 changes: 4 additions & 4 deletions app/assets/stylesheets/mixins/_margins.scss
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
@mixin responsive-bottom-margin {
margin-bottom: $gutter-half;
margin-bottom: govuk-spacing(3);

@include media(tablet) {
margin-bottom: $gutter * 1.5;
margin-bottom: govuk-spacing(8);
}
}

@mixin responsive-top-margin {
margin-top: $gutter-half;
margin-top: govuk-spacing(3);

@include media(tablet) {
margin-top: $gutter * 1.5;
margin-top: govuk-spacing(8);
}
}

Expand Down
1 change: 0 additions & 1 deletion app/assets/stylesheets/print.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// govuk_frontend_toolkit imports
@import 'measurements';
@import 'typography';

@import 'govuk_publishing_components/all_components_print';
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/views/_answer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
@include add-title-margin;

.last-updated {
padding-bottom: $gutter-half;
padding-bottom: govuk-spacing(3);
}
}
2 changes: 1 addition & 1 deletion app/assets/stylesheets/views/_coming-soon.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.coming-soon {
.summary {
@include core-24;
margin-bottom: $gutter-half;
margin-bottom: govuk-spacing(3);
}
}
2 changes: 1 addition & 1 deletion app/assets/stylesheets/views/_consultation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
border-top: 1px solid $border-colour;

@include media(tablet) {
padding-top: $gutter;
padding-top: govuk-spacing(6);
}
}
}
8 changes: 4 additions & 4 deletions app/assets/stylesheets/views/_document-collection.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

.group-title {
@include bold-27;
margin-top: $gutter;
margin-bottom: $gutter-half;
margin-top: govuk-spacing(6);
margin-bottom: govuk-spacing(3);

@include media(desktop) {
margin-top: $gutter * 1.5;
margin-bottom: $gutter-two-thirds;
margin-top: govuk-spacing(8);
margin-bottom: govuk-spacing(4);
}

&:first-child {
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/views/_help-page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
@include add-title-margin;

.last-updated {
padding-bottom: $gutter-half;
padding-bottom: govuk-spacing(3);
}
}
Loading

0 comments on commit 960e79d

Please sign in to comment.