Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to GOV.UK Frontend #512

Merged
merged 41 commits into from
Jun 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
43b1735
Remove dependencies on GOV.UK Elements, Template, Toolkit
NickColley Jun 19, 2018
1d8578c
Update Nunjucks dependency
NickColley Jun 19, 2018
57b5e72
Add GOV.UK Frontend as a dependency
NickColley Jun 19, 2018
5cf186d
Remove copy-govuk-modules tasks
NickColley Jun 19, 2018
dc874bd
Import GOV.UK Frontend instead of GOV.UK Elements
NickColley Jun 19, 2018
8ecc90e
Update SCSS to use GOV.UK Frontend
NickColley Jun 19, 2018
8b40dfa
Import new template from GOV.UK Frontend
NickColley Jun 19, 2018
e5403ae
Add related items partial
NickColley Jun 19, 2018
f856dbf
Add components to main layout files
NickColley Jun 19, 2018
32e20ec
Update check your answers to new conventions
NickColley Jun 19, 2018
5f98729
Update task list pattern to use new conventions
NickColley Jun 20, 2018
5135436
Update headings to use new GOV.UK Frontend classes
NickColley Jun 20, 2018
d4f9067
Update grid classes to GOV.UK Frontend
NickColley Jun 20, 2018
5747932
Update list classes to GOV.UK Frontend
NickColley Jun 20, 2018
09d8989
Update lede classes to GOV.UK Frontend
NickColley Jun 20, 2018
e4b767b
Update to use GOV.UK Frontend breadcrumbs
NickColley Jun 20, 2018
2f1b36b
Add prose scope to install and documentation pages
NickColley Jun 20, 2018
7e58181
Update to use GOV.UK Frontend button component
NickColley Jun 20, 2018
1dbd46e
Update titles in layouts to camelCase
NickColley Jun 20, 2018
dcc75b0
Update to use back link GOV.UK Frontend component
NickColley Jun 20, 2018
9dbbf93
Update form buttons to use GOV.UK Frontend component
NickColley Jun 20, 2018
cc57585
Remove duplicate <main>
NickColley Jun 25, 2018
96bce64
Update branch example to use GOV.UK Frontend component
NickColley Jun 25, 2018
3d655e7
Fix branching guide code highlighting
NickColley Jun 25, 2018
6bdf19e
Fix passing data code highlighting
NickColley Jun 25, 2018
62d0819
Update pass-data examples to use GOV.UK Frontend components
NickColley Jun 25, 2018
ee95b95
Fix download link spacing
NickColley Jun 25, 2018
bcf6b13
Style blockquotes like inset text
NickColley Jun 25, 2018
16f777a
Fix serviceName being set in docs pages
NickColley Jun 25, 2018
0e5d026
Replace partial areas with Design System docs
NickColley Jun 25, 2018
78cb636
Update JavaScript to use GOV.UK Frontend
NickColley Jun 26, 2018
9d44b49
Remove Elements references from documentation
NickColley Jun 25, 2018
1dc5e95
Improve release documentation
NickColley Jun 25, 2018
b5c1c67
Set custom head icons in unbranded template
NickColley Jun 25, 2018
8d424a6
Fix cookies page tables
NickColley Jun 25, 2018
a8ea5e3
Update tips and tricks guidance
NickColley Jun 25, 2018
f2e38d5
Update upgrading the kit guidance
NickColley Jun 25, 2018
3a1d5b9
Remove unused files
NickColley Jun 25, 2018
e4af699
Update page_scripts to camelcase
NickColley Jun 25, 2018
16fb479
Add cookie banner component
NickColley Jun 25, 2018
4fd81b0
Update confirmation page to use panel component
NickColley Jun 26, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
.start.pid
.port.tmp
public
lib/govuk_template.html
govuk_modules
node_modules/*
.tmuxp.*
package-lock.json
7 changes: 2 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ Please raise feature requests as issues before contributing any code.

This ensures they are discussed properly before any time is spent on them.

## GOV.UK Elements

The project contains code taken from the [GOV.UK Elements](https://github.com/alphagov/govuk_elements/) project.
Please check that any issues related to that code are raised with that project, not this one.

## Contributing code

### Indentation and whitespace
Expand All @@ -56,6 +51,8 @@ which describes how we prefer git history and commit messages to read.

## To release a new version

Checkout a new branch for the release.

Update [CHANGELOG.md](https://github.com/alphagov/govuk_prototype_kit/blob/master/CHANGELOG.md) to summarise the changes made since the last release.

To see the commits to be summarised in the changelog since the last release, [compare the latest-release branch with master](https://github.com/alphagov/govuk_prototype_kit/compare/latest-release...master).
Expand Down
14 changes: 1 addition & 13 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
/* global $ */
/* global GOVUK */

// Warn about using the kit in production
if (window.console && window.console.info) {
window.console.info('GOV.UK Prototype Kit - do not use for production')
}

$(document).ready(function () {
// Use GOV.UK shim-links-with-button-role.js to trigger a link styled to look like a button,
// with role="button" when the space key is pressed.
GOVUK.shimLinksWithButtonRole.init()

// Details/summary polyfill from frontend toolkit
GOVUK.details.init()

// Show and hide toggled content
// Where .multiple-choice uses the data-target attribute
// to toggle hidden content
var showHideContent = new GOVUK.ShowHideContent()
showHideContent.init()
window.GOVUKFrontend.initAll()
})
42 changes: 0 additions & 42 deletions app/assets/javascripts/bind.js

This file was deleted.

3 changes: 1 addition & 2 deletions app/assets/sass/application-ie8.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
$is-ie: true;
$ie-version: 8;
$govuk-is-ie8: true;

@import "application";
36 changes: 10 additions & 26 deletions app/assets/sass/application.scss
Original file line number Diff line number Diff line change
@@ -1,31 +1,15 @@
// Path to assets for use with the file-url function
// in the govuk frontend toolkit's url-helpers partial
$path: "/public/images/";
// global styles for <a> and <p> tags
$govuk-global-styles: true;

// Import GOV.UK elements from /govuk-modules/, this will import the frontend toolkit and some base styles.
// Take a look in /govuk-modules/_govuk-elements.scss to see which files are imported.
@import 'govuk-elements';
// Import GOV.UK Frontend
@import "node_modules/govuk-frontend/all";

// Take a look at in app/assets/sass/patterns/ to see which files are imported.
@import 'patterns/check-your-answers';
@import 'patterns/task-list';
// Patterns that aren't in Frontend
@import "patterns/check-your-answers";
@import "patterns/task-list";
@import "patterns/related-items";

// Related items
// (These styles will be moved to GOV.UK elements, duplicating here for now.)
.govuk-related-items {
margin-top: $gutter;
border-top: 10px solid $govuk-blue;
padding-top: 5px;

.heading-medium {
margin-top: 0.3em;
margin-bottom: 0.5em;
}

li {
margin-bottom: 10px;
list-style-type: none;
}
}
// Components that aren't in Frontend
@import "components/cookie-banner";

// Add extra styles here, or re-organise the Sass files in whichever way makes most sense to you
24 changes: 24 additions & 0 deletions app/assets/sass/components/_cookie-banner.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.app-cookie-banner {
@include govuk-font(16);
@include govuk-text-colour;

box-sizing: border-box;
width: 100%;

padding-top: govuk-spacing(3);
padding-right: govuk-spacing(3);
padding-bottom: govuk-spacing(3);
padding-left: govuk-spacing(3);
background-color: lighten(desaturate(govuk-colour("light-blue"), 8.46), 42.55);
}

.app-cookie-banner__message {
margin: 0;
@include govuk-width-container;
}

@include govuk-media-query($media-type: print) {
.app-cookie-banner {
display: none !important;
}
}
22 changes: 0 additions & 22 deletions app/assets/sass/examples.scss

This file was deleted.

128 changes: 58 additions & 70 deletions app/assets/sass/patterns/_check-your-answers.scss
Original file line number Diff line number Diff line change
@@ -1,95 +1,83 @@
// Recommended - Use these styles for the check your answers pattern
.govuk-check-your-answers {
.app-check-your-answers {

@include media(desktop) {
display: table;
}

> * {
position: relative;
border-bottom: 1px solid $border-colour;

@include media(desktop) {
display: table-row;
border-bottom-width: 0;
}

> * {
display: block;

@include media(desktop) {
display: table-cell;
border-bottom: 1px solid $border-colour;
padding: em(12, 19) em(20, 19) em(9, 19) 0; // copied from Elements' td padding
margin: 0;
}
}
@include govuk-font(19);

@include media(desktop) {
&:first-child > * {
padding-top: 0;
}
}
}

.cya-question {
font-weight: bold;
margin: em(12, 19) 4em em(4,19) 0;
// top: from Elements' td
// right: due to length of "change" link (adjust if you change the link to be much longer)
// bottom: by eye
// using margin instead of padding because of easier absolutely positioning of .change
}

> *:first-child .cya-question {
margin-top: 0;
@include govuk-media-query($from: desktop) {
display: table;
}
}

@include media(desktop) {
.app-check-your-answers--short {
@include govuk-media-query($from: desktop) {
// to make group of q&a line up horizontally (unless there is just one group)
&.cya-questions-short,
&.cya-questions-long {
width: 100%;
}

width: 100%;
// recommended for mostly short questions
&.cya-questions-short .cya-question {
.app-check-your-answers__question {
width: 30%;
}
}
}

.app-check-your-answers--long {
@include govuk-media-query($from: desktop) {
// to make group of q&a line up horizontally (unless there is just one group)
width: 100%;
// recommended for mostly long questions
&.cya-questions-long .cya-question {
.app-check-your-answers__question {
width: 50%;
}
}
}

.app-check-your-answers__contents {
position: relative;
border-bottom: 1px solid $govuk-border-colour;

.cya-answer {
padding-bottom: em(9, 19); // from Elements' td
@include govuk-media-query($from: desktop) {
display: table-row;
border-bottom-width: 0;
}
}

.cya-change {
text-align: right;
position: absolute;
top: 0;
right: 0;
.app-check-your-answers__contents:first-child .app-check-your-answers__question,
.app-check-your-answers__contents:first-child .app-check-your-answers__answer,
.app-check-your-answers__contents:first-child .app-check-your-answers__change {
@include govuk-media-query($from: desktop) {
padding-top: 0;
}
}

@include media(desktop) {
position: static;
padding-right: 0;
}
.app-check-your-answers__question,
.app-check-your-answers__answer,
.app-check-your-answers__change {
display: block;
margin: 0;
@include govuk-media-query($from: desktop) {
display: table-cell;
border-bottom: 1px solid $govuk-border-colour;
padding: govuk-em(12, 19) govuk-em(20, 19) govuk-em(9, 19) 0;
}
}

.app-check-your-answers__question {
font-weight: bold;
margin: govuk-em(12, 19) 4em govuk-em(4,19) 0;
// using margin instead of padding because of easier absolutely positioning of .app-check-your-answers__change
}

// Deprecated - these styles will be removed in a later release
.check-your-answers {
td {
@include core-19;
vertical-align: top;
}
.change-answer {
text-align: right;
font-weight: bold;
.app-check-your-answers__answer {
padding-bottom: govuk-em(9, 19);
}

.app-check-your-answers__change {
text-align: right;
position: absolute;
top: 0;
right: 0;

@include govuk-media-query($from: desktop) {
position: static;
padding-right: 0;
}
}
11 changes: 11 additions & 0 deletions app/assets/sass/patterns/_related-items.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// This is a GOV.UK Publishing specific component that
// can be seen at http://govuk-static.herokuapp.com/component-guide/related_items

.app-related-items {
border-top: 10px solid govuk-colour("blue");
padding-top: govuk-spacing(2);
}

.app-related-items .govuk-list > li {
margin-bottom: govuk-spacing(2);
}
Loading