Skip to content

Commit

Permalink
RFR: Print styling on timetable service listings. #417. (#420)
Browse files Browse the repository at this point in the history
* Print styling on timetable service listings. #417.

* use existing styling on button

* wire up print function

* hide some more elements
  • Loading branch information
szappacosta authored and vincelee888 committed Oct 17, 2018
1 parent ebc1b1a commit a0c36d8
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/js/find-help.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const browser = require('./browser')
const print = require('./navigation/print')
const querystring = require('./get-url-parameter')
import { PostcodeProximity } from './components/PostcodeProximity'

Expand Down Expand Up @@ -31,6 +32,8 @@ const FindHelp = function (location) {
: querystring.parameter('range')

self.initFindHelpPostcodesLocationSelector = (onChangeCallback) => {
print.init()

const decoratedCallback = (locationResult, range) => {
self.currentRange = range
const location = browser.location()
Expand Down
3 changes: 3 additions & 0 deletions src/partials/find-help/header.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<header class="multi-form-header">
<h1 class="h1">\{{{categoryName}}}</h1>
\{{{categorySynopsis}}}
<button class="btn btn--brand-d js-print-btn">
<span class="btn__text">Print this page</span>
</button>
</header>
1 change: 1 addition & 0 deletions src/scss/partials/_accordion.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@

@media print {
& {
background: none;
padding-left: 0px;
color: black;
font-size: 20px;
Expand Down
4 changes: 4 additions & 0 deletions src/scss/partials/_block.scss
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,10 @@
}
}

.block-tabs--cards {
@include printHide();
}

.block-tabs__tab {
@include span(1 of 2);

Expand Down
4 changes: 4 additions & 0 deletions src/scss/partials/_btn.scss
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,7 @@
margin: 0;
}
}

.js-print-btn {
@include printHide();
}
29 changes: 29 additions & 0 deletions src/scss/partials/_card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,41 @@ $spacing: 20px;
@include span(7 of 12);
@include first();
}

@media print {
& {
width: 100%;
float: none;
margin-right: 0;

.accordion {
max-width: 100%;
box-shadow: none;

.accordion__header {
padding-left: 10px;
color: white;

.accordion__icon {
display: none;
}
}
}
}
}
}
}

.card {
border-radius: $radius;
margin-bottom: $spacing;
text-align: center;

@media print {
& {
box-shadow: none;
}
}
}

.card__details {
Expand Down Expand Up @@ -261,6 +289,7 @@ $spacing: 20px;
}
.card__details__link {
text-decoration: underline;
@include printHide();
}
}

Expand Down
3 changes: 3 additions & 0 deletions src/scss/partials/_form.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
background: white;
padding: 20px 20px 5px 20px;
margin: 15px 0 30px 0;

@include printHide();

@include mq($from: m) {
@include span(2 of 6);
@include last();
Expand Down
2 changes: 2 additions & 0 deletions src/scss/partials/_social-share.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
text-align: center;
line-height: 40px;

@include printHide();

&--home {
margin-top: 20px;
}
Expand Down

0 comments on commit a0c36d8

Please sign in to comment.