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

Add boilerplate template #731

Merged
merged 13 commits into from
May 31, 2018
Merged

Add boilerplate template #731

merged 13 commits into from
May 31, 2018

Conversation

NickColley
Copy link
Contributor

@NickColley NickColley commented May 29, 2018

I have tested this by integrating the template within our own review application, and in the GOV.UK Design System.

Default example

Custom example

Template area documentation

Changes from govuk_template:

Breaking changes:

  • Removed stylesheets relating to govuk_template.css, we now recommend people bundle stylesheets in their application.

  • Removed stylesheets relating to print, we do this at a component level.

  • Removed stylesheets relating to font, we now have a new font loading strategy that does not require a different bundle.

  • Removed ie8 specific class being added to the html element, since we don't require functionality

  • Remove ie.js, used to shim HTML5 files, add JSON2 support, we now recommend people bundle in their application.

  • Removed functionality to remove js-enabled class if window.GOVUK is not defined, at the moment we can't guarantee that this global will be set with GOV.UK Frontend.
    See Degrade gracefully when external JS can’t be loaded govuk_template#248 for details on this feature.

Features:

  • Added a headIcon block, which allows you to override icons, useful for unbranded layouts
  • Allow changing the theme-color, useful for unbranded layouts.
  • Added a main block, now skip link works by default, this block can be overridden.

Patch:

  • Moved Skip link into it's own block, calling the Skip link component by default instead of being inlined.
  • Moved footer into it's own block, calling the Footer component by default instead of being inlined.
  • Moved header into it's own block, calling the Header component by default instead of being inlined.
  • Changed the default main id to be #main-content to avoid being styled by GOV.UK Elements.

https://trello.com/c/UcWg3ro2/290-epic-allow-a-user-to-set-up-an-app-without-govuk-template-eg-boilerplate

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-731 May 29, 2018 17:55 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-731 May 29, 2018 17:56 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-731 May 30, 2018 11:25 Inactive
@NickColley
Copy link
Contributor Author

NickColley commented May 30, 2018

GOV.UK Template sets a grey background so the footer does not cut off.

We could do the same, or do something like a box-shadow, ::after element that extends to the bottom of the page.

Alternatively, template could have it's own CSS?

screen shot 2018-05-30 at 13 26 46

Update:

Resolved this by following the same approach as GOV.UK Template for now.

Potentially using CSS Grid might be more appropriate later on.

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-731 May 30, 2018 12:46 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-731 May 30, 2018 12:49 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-731 May 30, 2018 12:57 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-731 May 30, 2018 13:07 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-731 May 30, 2018 14:33 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-731 May 30, 2018 14:37 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-731 May 30, 2018 16:29 Inactive
@NickColley
Copy link
Contributor Author

I'm planning on moving the template areas example into the design system when we document this for consumption.

@NickColley NickColley changed the title WIP: Add boilerplate template Add boilerplate template May 30, 2018
src/template.njk Outdated

{% block pageStart %}{% endblock %}
<!DOCTYPE html>
<html lang="{{ htmlLang | default('en') }}" class="govuk-template">
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how does one extend this to add custom classes or ie specific classes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, I'll add that feature

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-731 May 31, 2018 09:45 Inactive
@kr8n3r
Copy link

kr8n3r commented May 31, 2018

changelog 📓

Changes from [govuk_template](https://github.com/alphagov/govuk_template):

Breaking changes:
- Removed stylesheets relating to `govuk_template.css`, we now recommend people bundle stylesheets in their application.
- Removed stylesheets relating to `print`, we do this at a component level.
- Removed stylesheets relating to `font`, we now have a [new font loading strategy](#726) that does not require a different bundle.
- Removed `ie8` specific class being added to the `html` element, since we don't require functionality
- Remove `ie.js`, used to shim HTML5 files, add JSON2 support, we now recommend people bundle in their application.

- Removed functionality to remove `js-enabled` class if `window.GOVUK` is not defined, at the moment we can't guarantee that this global will be set with GOV.UK Frontend.
See alphagov/govuk_template#248 for details on this feature.

Features:
- Added a main block, now skip link works by default, this block can be overridden.

Patch:
- Moved Skip link into it's own block, calling the [Skip link component](https://github.com/alphagov/govuk-frontend/tree/master/src/components/skip-link) by default instead of being inlined.
- Moved footer into it's own block, calling the [Footer component](https://github.com/alphagov/govuk-frontend/tree/master/src/components/footer) by default instead of being inlined.
- Moved header into it's own block, calling the [Header component](https://github.com/alphagov/govuk-frontend/tree/master/src/components/header) by default instead of being inlined.
- Changed the default `main` `id` to be `#main-content` to avoid being [styled by GOV.UK Elements](https://github.com/alphagov/govuk_elements/blob/8216538c1d2efb8b33372a22f28e1ea81d879ecd/assets/sass/elements/_layout.scss#L9).
Inspired by the GOV.UK Prototype Kit: https://govuk-prototype-kit.herokuapp.com/docs/examples/template-partial-areas

We may want to move this into the GOV.UK Design System website.
This is consistent with the original GOV.UK Template approach.

- We need to reset default margins set by user-agents
- We need to set background-colors
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-731 May 31, 2018 09:54 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-731 May 31, 2018 09:56 Inactive
src/template.njk Outdated
<meta name="theme-color" content="{{ themeColor | default('#0b0c0c') }}" /> {# Hardcoded value of $govuk-black #}

{% block headIcons %}
<link rel="shortcut icon" href="{{ assetPath | default('assets/') }}images/favicon.ico" type="image/x-icon" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all of the default asset paths should be /assets, with a leading slash so they resolve from the domain root. For example, at the minute the paths in the example resolve to e.g. /examples/assets/images/favicon.ico

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-731 May 31, 2018 10:06 Inactive
@NickColley NickColley dismissed 36degrees’s stale review May 31, 2018 10:08

Resolved assets not resolving from the domain root

Copy link
Contributor

@alex-ju alex-ju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 🚀

},
{
"href": "#3",
"text": "Contactez nous"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a blocker: Hyphenate (Contactez-nous) as in Aidez-moi

tag: {
text: "alpha"
},
html: 'C\'est un nouveau service - vos <a class="govuk-link" href="#"> commentaires </a> nous aideront à l\'améliorer.'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a blocker: the anchor element has extra spaces before and after the text. If you update don't forget to update the test too.

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-731 May 31, 2018 10:22 Inactive
Copy link

@kr8n3r kr8n3r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@NickColley NickColley merged commit 35a41ab into master May 31, 2018
@NickColley NickColley deleted the add-boilerplate branch May 31, 2018 11:41
@NickColley NickColley mentioned this pull request May 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants