@ons/design-system 46.1.3 → 48.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/button/_button.scss +76 -2
- package/components/document-list/_macro.njk +114 -0
- package/components/document-list/document-list.scss +182 -0
- package/components/download-resources/_download-resources.scss +2 -9
- package/components/download-resources/download-resources.js +2 -2
- package/components/error/_macro.njk +0 -1
- package/components/header/_header-nav.scss +22 -1
- package/components/header/_header.scss +12 -20
- package/components/header/_macro.njk +65 -16
- package/components/header/header-nav.dom.js +9 -0
- package/components/header/header-nav.js +5 -2
- package/components/input/_macro.njk +1 -2
- package/components/lists/_macro.njk +13 -15
- package/components/panel/_macro.njk +3 -8
- package/components/panel/_panel.scss +5 -3
- package/components/select/_macro.njk +1 -2
- package/components/textarea/_macro.njk +0 -1
- package/components/upload/_macro.njk +0 -1
- package/css/census.css +1 -1
- package/css/main.css +1 -1
- package/img/large/alison-pritchard-featured.jpg +0 -0
- package/img/large/alison-pritchard.jpg +0 -0
- package/img/large/census-monuments-lights-featured.jpg +0 -0
- package/img/large/census-monuments-lights.jpg +0 -0
- package/img/large/ons-award-winners.jpg +0 -0
- package/img/small/alison-pritchard-featured.jpg +0 -0
- package/img/small/alison-pritchard.jpg +0 -0
- package/img/small/census-monuments-lights-featured.jpg +0 -0
- package/img/small/census-monuments-lights.jpg +0 -0
- package/img/small/ons-award-winners.jpg +0 -0
- package/img/small/placeholder-portrait.png +0 -0
- package/layout/_template.njk +1 -1
- package/package.json +1 -1
- package/scripts/main.es5.js +1 -1
- package/scripts/main.js +1 -1
- package/scss/main.scss +1 -2
- package/scss/objects/_spacing.scss +1 -0
- package/scss/vars/_colors.scss +9 -3
- package/components/articles/_articles.scss +0 -86
- package/components/articles/_macro.njk +0 -81
- package/components/downloads/_downloads.scss +0 -39
- package/components/downloads/_macro.njk +0 -66
package/scss/main.scss
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
@import 'objects/index';
|
|
6
6
|
@import '../components/access-code/uac';
|
|
7
7
|
@import '../components/address-output/address-output';
|
|
8
|
-
@import '../components/articles/articles';
|
|
9
8
|
@import '../components/autosuggest/autosuggest';
|
|
10
9
|
@import '../components/breadcrumbs/breadcrumbs';
|
|
11
10
|
@import '../components/button/button';
|
|
@@ -16,8 +15,8 @@
|
|
|
16
15
|
@import '../components/collapsible/collapsible';
|
|
17
16
|
@import '../components/content-pagination/content-pagination';
|
|
18
17
|
@import '../components/cookies-banner/cookies-banner';
|
|
18
|
+
@import '../components/document-list/document-list';
|
|
19
19
|
@import '../components/download-resources/download-resources';
|
|
20
|
-
@import '../components/downloads/downloads';
|
|
21
20
|
@import '../components/external-link/external-link';
|
|
22
21
|
@import '../components/feedback/feedback';
|
|
23
22
|
@import '../components/field/field-group';
|
package/scss/vars/_colors.scss
CHANGED
|
@@ -47,13 +47,14 @@ $color-branded-supporting-tint: tint($color-branded-supporting, 90%) !default;
|
|
|
47
47
|
// Assignment
|
|
48
48
|
// =============================================================================
|
|
49
49
|
|
|
50
|
-
// Headers, footers, banners
|
|
50
|
+
// Headers, footers, banners, page
|
|
51
51
|
$color-header: $color-branded !default;
|
|
52
52
|
$color-header-top: $color-white !default;
|
|
53
53
|
$color-header-top-internal: $color-branded-secondary !default;
|
|
54
54
|
$color-cta-bg: $color-branded-tint !default;
|
|
55
55
|
$color-banner-bg: $color-grey-5 !default;
|
|
56
56
|
$color-banner-bg-dark: $color-grey-15 !default;
|
|
57
|
+
$color-page-light: $color-white !default;
|
|
57
58
|
|
|
58
59
|
// Typography
|
|
59
60
|
$color-text: $color-black !default;
|
|
@@ -68,6 +69,7 @@ $color-text-inverse-link: $color-white !default;
|
|
|
68
69
|
$color-text-inverse-link-hover: $color-grey-5 !default;
|
|
69
70
|
$color-text-banner-link: $color-grey-100 !default;
|
|
70
71
|
$color-text-banner-link-hover: $color-black !default;
|
|
72
|
+
$color-text-metadata: $color-black !default;
|
|
71
73
|
|
|
72
74
|
// Foundations
|
|
73
75
|
$color-focus: $color-sun-yellow !default;
|
|
@@ -76,8 +78,12 @@ $color-highlight: $color-neon-yellow !default;
|
|
|
76
78
|
// Borders
|
|
77
79
|
$color-borders: $color-grey-75 !default;
|
|
78
80
|
$color-borders-indent: $color-grey-35 !default;
|
|
79
|
-
$color-
|
|
80
|
-
$color-document-
|
|
81
|
+
$color-borders-list: $color-grey-35 !default;
|
|
82
|
+
$color-borders-document-image: $color-grey-15 !default;
|
|
83
|
+
$color-borders-document-image-focus: $color-black !default;
|
|
84
|
+
|
|
85
|
+
// Placeholders
|
|
86
|
+
$color-placeholder: $color-grey-15 !default;
|
|
81
87
|
|
|
82
88
|
// Form elements
|
|
83
89
|
$color-button: $color-leaf-green !default;
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
.ons-article {
|
|
2
|
-
@include mq(s) {
|
|
3
|
-
align-items: flex-start;
|
|
4
|
-
display: flex;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
& + & {
|
|
8
|
-
border-top: 1px solid $color-grey-75;
|
|
9
|
-
margin: 1.5rem 0 0;
|
|
10
|
-
padding: 1.5em 0 0;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
&__content {
|
|
14
|
-
max-width: 660px; // Equivalent to 8 Columns;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
&__image {
|
|
18
|
-
flex-shrink: 0;
|
|
19
|
-
margin-bottom: 1rem;
|
|
20
|
-
max-width: 140px;
|
|
21
|
-
|
|
22
|
-
@include mq(s) {
|
|
23
|
-
display: flex;
|
|
24
|
-
margin-bottom: 0;
|
|
25
|
-
margin-right: 1.5rem;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
&__image-link {
|
|
30
|
-
box-sizing: border-box;
|
|
31
|
-
display: inline-block;
|
|
32
|
-
outline-offset: 0;
|
|
33
|
-
vertical-align: top;
|
|
34
|
-
|
|
35
|
-
&:focus {
|
|
36
|
-
box-shadow: 0 0 0 2px $color-black !important;
|
|
37
|
-
outline: 4px solid $color-focus !important;
|
|
38
|
-
outline-offset: 2px;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
&__meta {
|
|
43
|
-
color: $color-grey-100;
|
|
44
|
-
display: flex;
|
|
45
|
-
margin-bottom: 1rem;
|
|
46
|
-
padding-left: 0;
|
|
47
|
-
|
|
48
|
-
&-item {
|
|
49
|
-
display: block;
|
|
50
|
-
margin: 0 1rem 0 0;
|
|
51
|
-
padding-left: 0;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
&-link {
|
|
55
|
-
color: inherit;
|
|
56
|
-
|
|
57
|
-
&:hover {
|
|
58
|
-
color: $color-black;
|
|
59
|
-
text-decoration: underline solid $color-black 2px;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// Featured
|
|
65
|
-
&--featured {
|
|
66
|
-
background-color: $color-grey-5;
|
|
67
|
-
border-top: 0;
|
|
68
|
-
padding-bottom: 0;
|
|
69
|
-
padding-top: 0;
|
|
70
|
-
|
|
71
|
-
.ons-article__image {
|
|
72
|
-
margin-bottom: 1.5rem;
|
|
73
|
-
margin-right: 0;
|
|
74
|
-
max-width: 379px;
|
|
75
|
-
|
|
76
|
-
@include mq(m) {
|
|
77
|
-
margin-bottom: 0;
|
|
78
|
-
margin-right: 1.5rem;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.ons-article__image img {
|
|
83
|
-
width: 100%;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
{% macro onsArticles(params) %}
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
{% for article in (params.articles if params.articles is iterable else params.articles.items()) %}
|
|
5
|
-
<article class="ons-article{% if article.featured %} ons-article--featured {% endif %}{{ ' ' + params.classes if params.classes else '' }}">
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
{% if article.featured is defined and article.featured %}
|
|
9
|
-
<div class="ons-container">
|
|
10
|
-
<div class="ons-grid ons-u-pt-l ons-u-pb-l">
|
|
11
|
-
<div class="ons-grid__col ons-col-5@m">
|
|
12
|
-
{% endif %}
|
|
13
|
-
|
|
14
|
-
<div class="ons-article__image" aria-hidden="true">
|
|
15
|
-
|
|
16
|
-
<a class="ons-article__image-link" href="{{ article.url }}" tabindex="-1">
|
|
17
|
-
|
|
18
|
-
{% if article.featured is defined and article.featured %}
|
|
19
|
-
|
|
20
|
-
{% if article.image is defined and article.image and article.image.smallSrc is defined and article.image.smallSrc %}
|
|
21
|
-
<img height="248" width="379" srcset="{{ article.image.smallSrc }} 1x, {{ article.image.largeSrc }} 2x" src="{{ article.image.smallSrc }}" alt="{{ article.image.alt }}" loading="lazy">
|
|
22
|
-
{% else %}
|
|
23
|
-
<img height="248" width="379" srcset="{{ article.placeholderURL if article.placeholderURL is defined and article.placeholderURL }}/img/small/placeholder-news-medium.png 1x, {{ article.placeholderURL if article.placeholderURL is defined and article.placeholderURL }}/img/large/placeholder-news-medium.png 2x" src="{{ article.placeholderURL if article.placeholderURL is defined and article.placeholderURL }}/img/small/placeholder-news-medium.png" alt="Image placeholder" loading="lazy">
|
|
24
|
-
{% endif %}
|
|
25
|
-
|
|
26
|
-
{% else %}
|
|
27
|
-
|
|
28
|
-
{% if article.image is defined and article.image and article.image.smallSrc is defined and article.image.smallSrc %}
|
|
29
|
-
<img height="92" width="140" srcset="{{ article.image.smallSrc }} 1x, {{ article.image.largeSrc }} 2x" src="{{ article.image.smallSrc }}" alt="{{ article.image.alt }}" loading="lazy">
|
|
30
|
-
{% else %}
|
|
31
|
-
<img height="92" width="140" srcset="{{ article.placeholderURL if article.placeholderURL is defined and article.placeholderURL }}/img/small/placeholder-news.png 1x, {{ article.placeholderURL if article.placeholderURL is defined and article.placeholderURL }}/img/large/placeholder-news.png 2x" src="{{ article.placeholderURL if article.placeholderURL is defined and article.placeholderURL }}/img/small/placeholder-news.png" alt="Image placeholder" loading="lazy">
|
|
32
|
-
{% endif %}
|
|
33
|
-
|
|
34
|
-
{% endif %}
|
|
35
|
-
|
|
36
|
-
</a>
|
|
37
|
-
|
|
38
|
-
</div>
|
|
39
|
-
|
|
40
|
-
{% if article.featured is defined and article.featured %}
|
|
41
|
-
</div>
|
|
42
|
-
<div class="ons-grid__col ons-col-7@m">
|
|
43
|
-
{% endif %}
|
|
44
|
-
|
|
45
|
-
<div class="ons-article__content">
|
|
46
|
-
|
|
47
|
-
<h2 class="ons-article__heading">
|
|
48
|
-
<a href="{{ article.url }}">{{ article.title }}</a>
|
|
49
|
-
</h2>
|
|
50
|
-
|
|
51
|
-
<ul class="ons-u-fs-s ons-article__meta">
|
|
52
|
-
{%- if article.date is defined and article.date %}<li class="ons-article__meta-item"><span class="ons-u-hidden">Posted on </span> <time datetime="{{ article.date.iso }}">{{ article.date.short }}</time></li>{% endif %}
|
|
53
|
-
{%- if article.category is defined and article.category %}
|
|
54
|
-
<li class="ons-article__meta-item">
|
|
55
|
-
<span class="ons-u-hidden">in </span>
|
|
56
|
-
{%- if article.category.url is defined and article.category.url %}
|
|
57
|
-
<a class="ons-article__meta-link" href="{{ article.category.url }}">{{ article.category.title }}</a>
|
|
58
|
-
{% else %}
|
|
59
|
-
{{ article.category.title }}
|
|
60
|
-
{% endif %}
|
|
61
|
-
</li>
|
|
62
|
-
{% endif %}
|
|
63
|
-
</ul>
|
|
64
|
-
|
|
65
|
-
{% if article.excerpt is defined and article.excerpt %}
|
|
66
|
-
<p class="ons-u-mb-no">{{ article.excerpt | safe }}</p>
|
|
67
|
-
{% endif %}
|
|
68
|
-
|
|
69
|
-
</div>
|
|
70
|
-
|
|
71
|
-
{% if article.featured is defined and article.featured %}
|
|
72
|
-
</div>
|
|
73
|
-
</div>
|
|
74
|
-
</div>
|
|
75
|
-
{% endif %}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
</article>
|
|
79
|
-
{% endfor %}
|
|
80
|
-
|
|
81
|
-
{% endmacro %}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
.ons-download {
|
|
2
|
-
display: flex;
|
|
3
|
-
|
|
4
|
-
& + & {
|
|
5
|
-
border-top: 1px solid $color-grey-75;
|
|
6
|
-
margin: 1.5rem 0 0;
|
|
7
|
-
padding: 1.5em 0 0;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
&__image {
|
|
11
|
-
flex: 0 0 auto;
|
|
12
|
-
margin-right: 1.5rem;
|
|
13
|
-
width: 96px;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
&__image-link {
|
|
17
|
-
border: 2px solid $color-grey-15;
|
|
18
|
-
box-sizing: content-box;
|
|
19
|
-
display: block;
|
|
20
|
-
width: 100%;
|
|
21
|
-
|
|
22
|
-
&:focus {
|
|
23
|
-
border-color: $color-document-border-focus;
|
|
24
|
-
box-shadow: none;
|
|
25
|
-
outline: 4px solid $color-focus !important;
|
|
26
|
-
outline-offset: 0;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
&__meta {
|
|
31
|
-
color: $color-grey-100;
|
|
32
|
-
display: block;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
&__excerpt {
|
|
36
|
-
margin-bottom: 0;
|
|
37
|
-
max-width: 660px; // Equivalent to 8 Columns
|
|
38
|
-
}
|
|
39
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
{% macro onsDownloads(params) %}
|
|
2
|
-
|
|
3
|
-
{% for download in (params.downloads if params.downloads is iterable else params.downloads.items()) %}
|
|
4
|
-
|
|
5
|
-
<div class="ons-download{{ ' ' + params.classes if params.classes else '' }}">
|
|
6
|
-
|
|
7
|
-
<div class="ons-download__image" aria-hidden="true">
|
|
8
|
-
<a class="ons-download__image-link" href="{{ download.url }}" tabindex="-1">
|
|
9
|
-
{% if download.thumbnail is defined and download.thumbnail and download.thumbnail.smallSrc is defined and download.thumbnail.smallSrc and download.thumbnail.largeSrc is defined and download.thumbnail.largeSrc %}
|
|
10
|
-
<img srcset="{{ download.thumbnail.smallSrc }} 1x, {{ download.thumbnail.largeSrc }} 2x" src="{{ download.thumbnail.smallSrc }}" alt="" loading="lazy">
|
|
11
|
-
{% else %}
|
|
12
|
-
<img srcset="{{ download.placeholderURL if download.placeholderURL is defined and download.placeholderURL }}/img/small/placeholder-portrait.png 1x, {{ download.placeholderURL if download.placeholderURL is defined and download.placeholderURL }}/img/large/placeholder-portrait.png 2x" src="{{ download.placeholderURL if download.placeholderURL is defined and download.placeholderURL }}/img/small/placeholder-portrait.png" alt="" loading="lazy">
|
|
13
|
-
{% endif %}
|
|
14
|
-
</a>
|
|
15
|
-
</div>
|
|
16
|
-
|
|
17
|
-
<div class="ons-download__content">
|
|
18
|
-
{% set titleTag = params.titleTag | default("h2") %}
|
|
19
|
-
<{{ titleTag }} class="ons-u-fs-m ons-u-mt-no ons-u-mb-xs">
|
|
20
|
-
<a href="{{ download.url }}">{{ download.title }}<span class="ons-u-vh">,
|
|
21
|
-
|
|
22
|
-
{%- if download.meta is defined and download.meta %}
|
|
23
|
-
|
|
24
|
-
{% set metaItems = [] %}
|
|
25
|
-
|
|
26
|
-
{% if download.meta.fileType is defined and download.meta.fileType %}{% set metaItems = (metaItems.push(download.meta.fileType + ' document download'), metaItems) %}{% endif %}
|
|
27
|
-
{% if download.meta.fileSize is defined and download.meta.fileSize %}{% set metaItems = (metaItems.push(download.meta.fileSize), metaItems) %}{% endif %}
|
|
28
|
-
{% if download.meta.filePages is defined and download.meta.filePages %}{% set metaItems = (metaItems.push(download.meta.filePages), metaItems) %}{% endif %}
|
|
29
|
-
|
|
30
|
-
{{ metaItems|join(', ') }}
|
|
31
|
-
|
|
32
|
-
{% endif -%}
|
|
33
|
-
|
|
34
|
-
</span></a>
|
|
35
|
-
</{{ titleTag }}>
|
|
36
|
-
|
|
37
|
-
<span class="ons-u-fs-s ons-u-mb-xs ons-download__meta" aria-hidden="true">
|
|
38
|
-
|
|
39
|
-
{%- if download.type is defined and download.type %}
|
|
40
|
-
{{ download.type }}{%- if download.meta is defined and download.meta %},{% endif %}
|
|
41
|
-
{% endif %}
|
|
42
|
-
|
|
43
|
-
{%- if download.meta is defined and download.meta %}
|
|
44
|
-
|
|
45
|
-
{% set metaItems = [] %}
|
|
46
|
-
|
|
47
|
-
{% if download.meta.fileType is defined and download.meta.fileType %}{% set metaItems = (metaItems.push(download.meta.fileType), metaItems) %}{% endif %}
|
|
48
|
-
{% if download.meta.fileSize is defined and download.meta.fileSize %}{% set metaItems = (metaItems.push(download.meta.fileSize), metaItems) %}{% endif %}
|
|
49
|
-
{% if download.meta.filePages is defined and download.meta.filePages %}{% set metaItems = (metaItems.push(download.meta.filePages), metaItems) %}{% endif %}
|
|
50
|
-
|
|
51
|
-
{{ metaItems|join(', ') }}
|
|
52
|
-
|
|
53
|
-
{% endif -%}
|
|
54
|
-
|
|
55
|
-
</span>
|
|
56
|
-
|
|
57
|
-
{% if download.excerpt is defined and download.excerpt %}
|
|
58
|
-
<p class="ons-download__excerpt">{{ download.excerpt | safe }}</p>
|
|
59
|
-
{% endif %}
|
|
60
|
-
|
|
61
|
-
</div>
|
|
62
|
-
|
|
63
|
-
</div>
|
|
64
|
-
{% endfor %}
|
|
65
|
-
|
|
66
|
-
{% endmacro %}
|