-
Notifications
You must be signed in to change notification settings - Fork 333
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
Conversation
4282842
to
8f2aa43
Compare
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? Update: Resolved this by following the same approach as GOV.UK Template for now. Potentially using CSS Grid might be more appropriate later on. |
1d2fe1c
to
72bd736
Compare
68bd122
to
5d7dc15
Compare
705869f
to
4370679
Compare
I'm planning on moving the template areas example into the design system when we document this for consumption. |
src/template.njk
Outdated
|
||
{% block pageStart %}{% endblock %} | ||
<!DOCTYPE html> | ||
<html lang="{{ htmlLang | default('en') }}" class="govuk-template"> |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
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
0aacb01
to
b6e51e8
Compare
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" /> |
There was a problem hiding this comment.
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
Resolved assets not resolving from the domain root
There was a problem hiding this 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" |
There was a problem hiding this comment.
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.' |
There was a problem hiding this comment.
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.
efd7031
to
3e2cd9e
Compare
Also splits template example into two
3e2cd9e
to
ddf78a5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 thehtml
element, since we don't require functionalityRemove
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 ifwindow.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:
Patch:
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