Skip to content

Commit

Permalink
Mobile finessing (#942)
Browse files Browse the repository at this point in the history
* Mobile finessing

* round 2
  • Loading branch information
peterdavidhamilton authored Nov 3, 2023
1 parent 598ac73 commit 0c30552
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 152 deletions.
6 changes: 6 additions & 0 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ pre.code-tip {
font-weight: normal;
}

.govuk-fieldset__legend {
@include govuk-media-query($until: tablet) {
display: none;
}
}

.light-grey-box {
padding: govuk-spacing(5);
margin-bottom: govuk-spacing(5);
Expand Down
163 changes: 17 additions & 146 deletions app/assets/stylesheets/card.scss
Original file line number Diff line number Diff line change
@@ -1,140 +1,3 @@
.govuk-card__flex-container {
display: flex;
flex-wrap: wrap;
width:100%;
}

.govuk-card__flex-item {
display: flex;
overflow: hidden;
}

.govuk-card {
border-bottom: govuk-colour("blue") 3px solid;
box-sizing: border-box;
padding: 20px;
max-width: 300px;

&--contained {
background-color: govuk-colour("light-grey");
}

&--contained--on-background {
background-color: govuk-colour("white");
}
}

.card-container img {
max-width: 100%;
}

.govuk-card--borderless {
border: 0;
padding-bottom: 0;
}

.govuk-card--selectable {
position: relative;

h3 {
color: govuk-colour("blue");
}
}

.govuk-card--selectable > a {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
}

.govuk-card--selectable:hover {
background-color: govuk-colour("blue");
}

.govuk-card--selectable:hover > .govuk-card__content > h3,
.govuk-card--selectable:hover > .govuk-card__content > p,
.govuk-card--selectable:hover > .govuk-card__content > h3 > a,
.govuk-card--selectable:hover > .govuk-card__actions > ul > li > a {
color: govuk-colour("white") !important;
}

.govuk-card--selectable:hover .govuk-card__content a,
.govuk-card--selectable:hover .govuk-card__actions ul > li > a:hover {
color: lighten(#fff, 30%) !important;
}

.govuk-card--selectable > a:focus {
background-color: initial !important;
}

.govuk-card__hero {
line-height: 0;
}

.gov-card__img{
display: block;
width: 100%
}

.govuk-card__content {
padding-bottom: 0;

p {
margin-bottom: 0;
}
}

.govuk-card__actions {
padding-top:10px;
padding-bottom: 0;
}

.govuk-card__actions > .govuk-c-button {
margin-bottom: 0;
}

.govuk-card__height{
min-height:300px;
}

@media screen and (max-width:1320px) {
.govuk-card__height{
min-height:375px;
}
}

@media screen and (max-width:1037px) {
.govuk-card__height{
min-height:410px;
}
}

@media screen and (max-width:912px) {
.govuk-card__height{
min-height:430px;
}
}

@media screen and (max-width:885px) {
.govuk-card__height{
min-height:500px;
}
}

@media screen and (max-width:812px) {
.govuk-card__height{
min-height:530px;
}
}

@media screen and (max-width:812px) {
.govuk-card__height{
min-height:220px;
}
}

.grid-container {
display: flex;
flex-direction: column;
Expand All @@ -145,32 +8,40 @@
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
grid-gap: 30px;
}

}

.card-container img {
max-width: 100%;
}

.card {
position: relative;
background-color: govuk-colour("light-grey");
border-bottom: 3px solid govuk-colour("blue");
max-width: 300px;
background-color: govuk-colour('light-grey');
border-bottom: 3px solid govuk-colour('blue');

@include govuk-media-query($from: tablet) {
max-width: 300px;
}

&-container {
padding: 20px;
}

&:hover, &:focus-within {
background-color: govuk-colour("blue");
background-color: govuk-colour('blue');
a {
color: govuk-colour("white");
color: govuk-colour('white');
}
}

&:hover &-link--retake {
&:hover {
color: govuk-colour("light-grey");
color: govuk-colour('light-grey');
}

&:focus {
color: govuk-colour("black");
color: govuk-colour('black');
}
}

Expand All @@ -188,7 +59,7 @@
box-shadow: none;

.card-container & {
color: govuk-colour("black");
color: govuk-colour('black');
}
}
}
Expand All @@ -200,7 +71,7 @@

&-link--header {
text-decoration: none;
color: govuk-colour("blue");
color: govuk-colour('blue');

&:after {
position: absolute;
Expand Down
5 changes: 5 additions & 0 deletions app/assets/stylesheets/dfe-header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
margin: 0 auto;
max-width: $govuk-page-width;

@include govuk-media-query($until: tablet) {
padding-left: govuk-spacing(3);
padding-right: govuk-spacing(3);
}

&.dfe-header__container.dfe-header-f-header-flex {
display: flex;
flex-wrap: wrap;
Expand Down
7 changes: 2 additions & 5 deletions app/assets/stylesheets/prompt.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ $prompt-hue: govuk-colour('turquoise');
border-top: $prompt-hue solid 10px;
margin: govuk-spacing(5) govuk-spacing(0);
padding-left: govuk-spacing(4);
padding-right: govuk-spacing(4);

.svg-inline--fa {
position: relative;
Expand All @@ -25,12 +26,8 @@ $prompt-hue: govuk-colour('turquoise');
}

.govuk-grid-column-three-quarters {
padding: govuk-spacing(3) govuk-spacing(0);
padding: govuk-spacing(3);

@media (max-width: 40em) {
padding-left: govuk-spacing(3);
}

@media(min-width: 40em) and (max-width: 61.5em) {
padding-left: govuk-spacing(7);
}
Expand Down
5 changes: 5 additions & 0 deletions app/assets/stylesheets/section-intro.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#section-intro-panel {
padding: govuk-spacing(7);

@include govuk-media-query($until: tablet) {
padding: govuk-spacing(6);
}

background-color: govuk-colour('light-grey');
border-radius: 6px;

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/training/modules_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ModulesController < ApplicationController
:mods,
:module_table

layout 'hero'
layout 'hero', only: :show

def index
track('course_overview_page', cms: true)
Expand Down

0 comments on commit 0c30552

Please sign in to comment.