mp-design-system 0.8.4 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. package/dist/build/js/app.js +1 -1
  2. package/dist/build/js/app.js.map +1 -1
  3. package/dist/build/scss/library.css +1 -1
  4. package/dist/build/scss/library.css.map +1 -1
  5. package/dist/build/scss/main.css +1 -1
  6. package/dist/build/scss/main.css.map +1 -1
  7. package/package.json +1 -1
  8. package/src/_includes/components/button/button.config.js +6 -0
  9. package/src/_includes/components/button/button.scss +6 -2
  10. package/src/_includes/components/campaign/campaign.scss +16 -8
  11. package/src/_includes/components/hero/hero.config.js +24 -24
  12. package/src/_includes/components/hero/hero.njk +3 -1
  13. package/src/_includes/components/hero/hero.scss +4 -4
  14. package/src/_includes/components/input/input.njk +2 -2
  15. package/src/_includes/components/input/input.scss +13 -0
  16. package/src/_includes/components/quote/quote.scss +6 -4
  17. package/src/_includes/components/tabs/tabs.scss +2 -2
  18. package/src/_includes/includes/system-header.njk +1 -1
  19. package/src/_includes/layout.njk +1 -1
  20. package/src/_includes/library-navigation/brand-nav.njk +1 -0
  21. package/src/_includes/system-home-page.njk +2 -1
  22. package/src/assets/js/imports/hero-video.js +25 -6
  23. package/src/assets/scss/foundations/colour.scss +3 -3
  24. package/src/assets/scss/library.scss +9 -1
  25. package/src/assets/scss/objects/prose.scss +5 -4
  26. package/src/assets/scss/tools/cutoff.scss +56 -0
  27. package/src/assets/scss/tools/index.scss +1 -0
  28. package/src/assets/scss/utilities/index.scss +0 -4
  29. package/src/brand/basics.md +35 -0
  30. package/src/brand/colors.njk +3 -3
  31. package/src/brand/index.njk +74 -7
  32. package/src/brand/logo.md +1 -1
  33. package/src/brand/typography.md +9 -12
  34. package/src/checklist.md +4 -3
  35. package/src/components/colour.njk +1 -1
  36. package/src/components/flow.njk +9 -0
  37. package/src/components/installation.md +3 -3
  38. package/src/components/utilities.md +39 -13
  39. package/src/index.njk +33 -27
  40. package/src/patterns/form.njk +8 -0
  41. package/src/static/img/favicon.svg +1 -0
  42. package/src/static/svg/crop-diagram-2.svg +1 -1
  43. package/src/static/svg/imaging-matrix.svg +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mp-design-system",
3
- "version": "0.8.4",
3
+ "version": "0.9.2",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "dev": "npm-run-all --parallel bundle:*",
@@ -37,6 +37,12 @@ module.exports = {
37
37
  context: {
38
38
  colour: 'outline-white'
39
39
  }
40
+ },
41
+ {
42
+ title: 'Small',
43
+ context: {
44
+ classes: 'c-button--small'
45
+ }
40
46
  }
41
47
  ],
42
48
  props: [
@@ -11,8 +11,7 @@
11
11
  font-family: $font-stack;
12
12
  }
13
13
 
14
- .mp.c-button,
15
- .c-button {
14
+ %c-button {
16
15
  // Reset
17
16
  border-radius: 0;
18
17
  background: transparent;
@@ -45,6 +44,11 @@
45
44
  text-decoration: none;
46
45
  color: color("white");
47
46
  }
47
+ }
48
+
49
+ .mp.c-button,
50
+ .c-button {
51
+ @extend %c-button;
48
52
 
49
53
  &--wide {
50
54
  width: 100%;
@@ -1,14 +1,19 @@
1
+ $angle: 225deg;
2
+
1
3
  .c-campaign {
4
+ @include cutoff;
5
+
2
6
  position: relative;
3
- background: color('grey');
4
7
  max-width: calc(#{$wrapper}) !important;
5
8
  padding: 0 !important;
6
9
 
7
10
  &__link {
8
11
  @extend .u-fill, .u-fill--link;
9
12
  }
10
-
13
+
11
14
  &__content {
15
+ background: color('grey');
16
+ background: linear-gradient($angle, color('grey', 'step--2'), color('grey'));
12
17
  color: color('white');
13
18
  width: 100%;
14
19
  @include padding('m-l');
@@ -33,9 +38,10 @@
33
38
  }
34
39
 
35
40
  &--petrol {
36
- background: color('petrol', 'step-2');
37
-
41
+
38
42
  .c-campaign__content {
43
+ background: color('petrol', 'step-2');
44
+ background: linear-gradient($angle, color('petrol', 'step-2'), color('petrol', 'step-3'));
39
45
  color: color('grey');
40
46
  }
41
47
 
@@ -45,9 +51,10 @@
45
51
  }
46
52
 
47
53
  &--blue {
48
- background: color('blue', 'step-3');
49
-
54
+
50
55
  .c-campaign__content {
56
+ background: color('blue', 'step-3');
57
+ background: linear-gradient($angle, color('blue', 'step-2'), color('blue', 'step-3'));
51
58
  color: color('grey');
52
59
  }
53
60
 
@@ -57,9 +64,10 @@
57
64
  }
58
65
 
59
66
  &--orange {
60
- background: color('utility-orange', 'step-2');
61
-
67
+
62
68
  .c-campaign__content {
69
+ background: color('utility-orange', 'step-2');
70
+ background: linear-gradient($angle, color('utility-orange', 'step-2'), color('utility-orange', 'step-3'));
63
71
  color: color('grey', 'step--1');
64
72
  }
65
73
 
@@ -96,30 +96,30 @@ module.exports = {
96
96
  homepage: 'light'
97
97
  }
98
98
  },
99
- // {
100
- // title: 'Homepage with video',
101
- // context: {
102
- // title: 'We\'re big on small.',
103
- // subtitle: null,
104
- // content: '<p>We make scientific instruments and services that make the invisible visible, and the impossible possible.</p>',
105
- // videoplaceholder: {
106
- // src: 'https://p3.aprimocdn.net/malvernpanalytical/bf169dc6-9edb-4609-9ba8-add301206d1e/bridge-bg_Original%20file.webp?quality=60'
107
- // },
108
- // shortvideo: [
109
- // { src: '' },
110
- // { type: 'video/mp4' },
111
- // ],
112
- // longvideo: [
113
- // { src: '' },
114
- // { type: 'video/mp4' },
115
- // ],
116
- // cta: {
117
- // label: 'About Malvern Panalytical',
118
- // link: ''
119
- // },
120
- // homepage: 'dark'
121
- // },
122
- // }
99
+ {
100
+ title: 'Homepage with video',
101
+ context: {
102
+ title: 'We\'re big on small.',
103
+ subtitle: null,
104
+ content: '<p>We make scientific instruments and services that make the invisible visible, and the impossible possible.</p>',
105
+ videoplaceholder: {
106
+ src: 'https://p3.aprimocdn.net/malvernpanalytical/bf169dc6-9edb-4609-9ba8-add301206d1e/bridge-bg_Original%20file.webp?quality=60'
107
+ },
108
+ shortvideo: [
109
+ { src: '' },
110
+ { type: 'video/mp4' },
111
+ ],
112
+ longvideo: [
113
+ { src: '' },
114
+ { type: 'video/mp4' },
115
+ ],
116
+ cta: {
117
+ label: 'About Malvern Panalytical',
118
+ link: ''
119
+ },
120
+ homepage: 'dark'
121
+ }
122
+ }
123
123
  ],
124
124
  props: [
125
125
  {
@@ -75,6 +75,7 @@
75
75
  {% endif %}
76
76
  </figure>
77
77
 
78
+ {% if params.longvideo %}
78
79
  <div id="lightboxVideo" class="c-lightbox u-hidden">
79
80
  <div class="c-lightbox__close">
80
81
  {{ icon({ id: 'cross' }) }}
@@ -84,4 +85,5 @@
84
85
  <source src="https://p3.aprimocdn.net/malvernpanalytical/304f04aa-ae04-4bed-9946-ae3101152327/PN12593_Brand_Movie_Malvern_Panalytical_MIX_0dBfs_website_header_Original%20file.mp4" type="video/mp4">
85
86
  </video>
86
87
  </div>
87
- </div>
88
+ </div>
89
+ {% endif %}
@@ -106,10 +106,10 @@
106
106
  .u-wrap {
107
107
  @include padding-bottom('l-3xl');
108
108
 
109
- &:before,
110
- &:after {
111
- display: none;
112
- }
109
+ // &:before,
110
+ // &:after {
111
+ // display: none;
112
+ // }
113
113
  }
114
114
 
115
115
  .c-hero {
@@ -1,9 +1,9 @@
1
1
  {% inputWrapper params.error %}
2
- <label class="{{ 'u-hidden' if params.hideLabel else 'c-label' }}{{ params.classes }}" for="{{ params.id }}">{{ params.label }}</label>
2
+ <label class="{{ 'u-hidden' if params.hideLabel else 'c-label' }}" for="{{ params.id }}">{{ params.label }}</label>
3
3
  {% if params.button %}
4
4
  <div class="u-flex u-border">
5
5
  {% endif %}
6
- <input type="{{ params.type or 'text' }}" class="c-input {{ 'c-input--with-button' if params.button }}" name="{{ params.name or params.id }}" placeholder="{{ params.placeholder }}" id="{{ params.id }}" {{ 'required' if params.required }} />
6
+ <input type="{{ params.type or 'text' }}" class="c-input {{ 'c-input--with-button' if params.button }}{{ params.classes }}" name="{{ params.name or params.id }}" placeholder="{{ params.placeholder }}" id="{{ params.id }}" {{ 'required' if params.required }} />
7
7
  {% if params.button %}
8
8
  <button type="button" class="mp c-button--white">Search</button>
9
9
  {% endif %}
@@ -41,6 +41,19 @@
41
41
  min-height: 10rem;;
42
42
  }
43
43
 
44
+ &--file {
45
+ border: 0;
46
+ padding: 0;
47
+ cursor: pointer;
48
+
49
+ @at-root ::-webkit-file-upload-button {
50
+ @extend %c-button;
51
+ @extend .c-button--blue;
52
+ display: inline-flex;
53
+ @include margin-right('xs');
54
+ }
55
+ }
56
+
44
57
  &-error {
45
58
  --error-state: #{color('red')};
46
59
  position: relative;
@@ -1,21 +1,23 @@
1
1
  .c-quote {
2
2
  color: color('petrol', 'step-1');
3
3
  padding-top: 74px;
4
- @include padding-top('2xl');
4
+ @include padding('2xl', 0, 'l', 'xl');
5
5
  position: relative;
6
6
 
7
7
  &:before {
8
8
  content: '“';
9
- // color: color('petrol', 'step-2');
9
+ color: color('petrol', 'step-3');
10
10
  position: absolute;
11
11
  height: 57px;
12
12
  width: 45px;
13
13
  left: 0;
14
- top: 0;
14
+ top: 0.1em;
15
+ font-family: "Arial", sans-serif;
15
16
  font-size: 10em;
16
17
  font-weight: 900;
17
18
  line-height: 0.9;
18
- margin-left: -0.05em;
19
+ margin-left: -0.025em;
20
+ z-index: -1;
19
21
  }
20
22
 
21
23
  p {
@@ -37,7 +37,7 @@
37
37
  overflow-x: auto;
38
38
 
39
39
  &-list {
40
- border-bottom: 4px solid color('petrol', 'step-2');
40
+ border-bottom: 4px solid color('utility-blue', 'step-3');
41
41
  display: flex;
42
42
  width: 100%;
43
43
  min-width: min-content;
@@ -58,7 +58,7 @@
58
58
  @include padding(0, 0 , 's-m');
59
59
  @include margin-right('m');
60
60
  display: block;
61
- border-bottom: 4px solid color('petrol', 'step-2');
61
+ border-bottom: 4px solid color('utility-blue', 'step-3');
62
62
  margin-bottom: -4px;
63
63
  position: relative;
64
64
  z-index: 1;
@@ -13,7 +13,7 @@
13
13
  <ul class="u-row">
14
14
  <li><a href="/brand" class="{% if '/brand' in page.url %}c-library-page-active{% endif %}">Brand & visual identity</a></li>
15
15
  <li><a href="/content" class="{% if '/content' in page.url %}c-library-page-active{% endif %}">Tone of voice</a></li>
16
- <li><a href="/components" class="{% if '/components' in page.url or '/patterns' in page.url %}c-library-page-active{% endif %}">Web components</a></li>
16
+ <li><a href="/components" class="{% if '/components' in page.url or '/patterns' in page.url %}c-library-page-active{% endif %}">Component library</a></li>
17
17
  <li class="u-petrol-step-2">V.{{ config.dsVersion }}</li>
18
18
  </ul>
19
19
  </nav>
@@ -39,7 +39,7 @@
39
39
  document.documentElement.style.setProperty('--headerHeight', headerHeight)
40
40
  }, 250);
41
41
  </script>
42
- <link rel="icon" type="image/png" sizes="32x32" href="/static/img/favicon-32x32.png">
42
+ <link rel="icon" type="image/png" sizes="32x32" href="/static/img/favicon.svg">
43
43
  <link rel="stylesheet" href="/build/scss/main.css" />
44
44
  <script>window.MSInputMethodContext && document.documentMode && document.write('<script src="https://cdn.jsdelivr.net/gh/nuxodin/ie11CustomProperties@4.1.0/ie11CustomProperties.min.js"><\/script>');</script>
45
45
  <script src="https://polyfill.io/v3/polyfill.min.js?features=Array.prototype.forEach%2CDOMTokenList.prototype.forEach%2CNodeList.prototype.forEach%2CArray.from"></script>
@@ -5,6 +5,7 @@
5
5
  <h3>Brand & visual identity</h3>
6
6
  <ul>
7
7
  {{ libraryList('Overview', '/brand/', page.url) }}
8
+ {{ libraryList('The basics', '/brand/basics/', page.url) }}
8
9
  {{ libraryList('Downloads', '/brand/downloads/', page.url) }}
9
10
  {{ libraryList('Logo', '/brand/logo/', page.url) }}
10
11
  {{ libraryList('Colors', '/brand/colors/', page.url) }}
@@ -14,7 +14,8 @@ sidebar: false
14
14
  cover: true,
15
15
  gradient: true,
16
16
  pattern: 'dots',
17
- inverse: true
17
+ inverse: true,
18
+ classes: 'c-library__hero'
18
19
  }) }}
19
20
 
20
21
  <div class="u-wrap u-flow--l">
@@ -8,25 +8,44 @@ function HeroVideo() {
8
8
  }
9
9
 
10
10
  const lightboxTrigger = document.getElementById('playVideo');
11
- const lightboxVideo = document.getElementById('lightboxVideo');
11
+ const lightboxContainer = document.getElementById('lightboxVideo');
12
+ const lightboxVideo = lightboxContainer.querySelector('.c-lightbox__video');
12
13
 
13
14
  lightboxTrigger.addEventListener('click', e => {
14
- videoBackground.removeAttribute('autoplay');
15
- lightboxVideo.classList.remove('u-hidden');
15
+ videoBackground.pause();
16
+ lightboxContainer.classList.remove('u-hidden');
17
+ checkVideos();
16
18
  });
17
19
 
18
- lightboxVideo.addEventListener('click', (e) => {
20
+ lightboxContainer.addEventListener('click', (e) => {
19
21
  if (!e.target.classList.contains('c-lightbox__video')) {
20
22
  videoBackground.setAttribute('autoplay','');
21
- lightboxVideo.classList.add('u-hidden');
23
+ lightboxContainer.classList.add('u-hidden');
24
+ checkVideos();
22
25
  }
23
26
  });
24
27
  window.addEventListener('keydown', function(e) {
25
28
  if (e.key == "Escape") {
26
29
  videoBackground.setAttribute('autoplay','');
27
- lightboxVideo.classList.add('u-hidden');
30
+ lightboxContainer.classList.add('u-hidden');
31
+ checkVideos();
28
32
  }
29
33
  });
34
+
35
+ function checkVideos() {
36
+ if(lightboxContainer.classList.contains('u-hidden')) {
37
+ if (videoBackground.paused) {
38
+ videoBackground.play();
39
+ }
40
+ if (!lightboxVideo.paused) {
41
+ lightboxVideo.pause();
42
+ }
43
+ } else {
44
+ if (!videoBackground.paused) {
45
+ videoBackground.pause();
46
+ }
47
+ }
48
+ }
30
49
  }
31
50
  });
32
51
  }
@@ -71,10 +71,10 @@ $colours: (
71
71
 
72
72
  'grey': (
73
73
  -50: mix(black, #CCC, 50%),
74
- 'step--2': mp-mix($f-mp-grey, black, 76%),
75
- 'step--1': mp-mix($f-mp-grey, black, 28%),
74
+ 'step--2': mp-mix($f-mp-grey, black, 80%),
75
+ 'step--1': mp-mix($f-mp-grey, black, 45%),
76
76
  'step-0': $f-mp-grey,
77
- 'step-1': mp-mix($f-mp-grey, white, 28%),
77
+ 'step-1': mp-mix($f-mp-grey, white, 48%),
78
78
  'step-2': mp-mix($f-mp-grey, white, 76%),
79
79
  'step-3': mp-mix($f-mp-grey, white, 92%)
80
80
  ),
@@ -55,6 +55,11 @@
55
55
  }
56
56
  }
57
57
 
58
+ &__hero {
59
+ color: white;
60
+ background: linear-gradient(color('petrol'), transparent), linear-gradient(45deg, color('blue'), color('petrol'));
61
+ }
62
+
58
63
  &__body {
59
64
  display: grid;
60
65
  grid-template-rows: auto auto;
@@ -244,12 +249,15 @@
244
249
  }
245
250
 
246
251
  iframe {
247
- position: absolute;
248
252
  height: 100%;
249
253
  width: 100%;
250
254
  left: 0;
251
255
  top: 0;
252
256
  transition: all .3s cubic-bezier(0.22, 0.61, 0.36, 1);
257
+
258
+ @media only screen and (min-width: 600px) {
259
+ position: absolute;
260
+ }
253
261
  }
254
262
  }
255
263
 
@@ -91,7 +91,8 @@
91
91
  }
92
92
 
93
93
  li + li,
94
- li + li {
94
+ li > ul,
95
+ li > ol {
95
96
  @include margin-top('2xs');
96
97
  }
97
98
  }
@@ -130,15 +131,15 @@
130
131
 
131
132
  @media (min-width: 35em) {
132
133
  &:not(.o-prose--left-blockquote) blockquote {
133
- padding-left: 107px;
134
+ @include padding-left('3xl');
134
135
 
135
136
  &:before {
136
- left: 107px;
137
+ left: var(--space-xl);
137
138
  }
138
139
  }
139
140
 
140
141
  &.o-prose--left-blockquote blockquote {
141
- padding-right: 107px;
142
+ @include padding-right('3xl');
142
143
  }
143
144
  }
144
145
 
@@ -0,0 +1,56 @@
1
+ // Cutoff corner effect
2
+
3
+ $g : var(--gutter);
4
+ $og : calc(100% - var(--gutter));
5
+
6
+ @mixin cutoff($corner:"bottom-right") {
7
+ @if $corner == "top-left" {
8
+ clip-path: polygon(
9
+ $g 0,
10
+ 100% 0,
11
+ 100% 100%,
12
+ 0 100%,
13
+ 0 $g
14
+ );
15
+ } @else if $corner == "top-right" {
16
+ clip-path: polygon(
17
+ 0 0,
18
+ $og 0,
19
+ 100% $g,
20
+ 100% 100%,
21
+ 0 100%
22
+ );
23
+ } @else if $corner == "bottom-left" {
24
+ clip-path: polygon(
25
+ 0 0,
26
+ 100% 0,
27
+ 100% 100%,
28
+ $g 100%,
29
+ 0 $og
30
+ );
31
+ } @else {
32
+ clip-path: polygon(
33
+ 0 0,
34
+ 100% 0,
35
+ 100% $og,
36
+ $og 100%,
37
+ 0 100%
38
+ );
39
+ }
40
+ }
41
+
42
+ .u-cutoff {
43
+ @include cutoff
44
+ }
45
+
46
+ .u-cutoff--top-right {
47
+ @include cutoff("top-right")
48
+ }
49
+
50
+ .u-cutoff--top-left {
51
+ @include cutoff("top-left")
52
+ }
53
+
54
+ .u-cutoff--bottom-left {
55
+ @include cutoff("bottom-left")
56
+ }
@@ -1,4 +1,5 @@
1
1
  @import './breakout.scss';
2
+ @import './cutoff.scss';
2
3
 
3
4
  @function color($palette, $tone: 'step-0') {
4
5
  @return map-get(map-get($colours, $palette), $tone);
@@ -1,7 +1,3 @@
1
- html {
2
- font-size:18px;
3
- }
4
-
5
1
  html body {
6
2
 
7
3
  @import './typography.scss';
@@ -0,0 +1,35 @@
1
+ ---
2
+ title: The basics of our digital brand
3
+ layout: content-page
4
+ sidebar: brand
5
+ tags: brand
6
+ version: 0.0.0
7
+ status: 'Development'
8
+ ---
9
+
10
+ ## Text
11
+ - Our font is [Inter](/brand/typography).
12
+ - Text is colored MP Charcoal (#333333).
13
+ - 18px font size.
14
+ - We write in American English using [sentence case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
15
+
16
+ ## Buttons
17
+ {% button 'Primary button' %}
18
+ {% button 'Secondary button' '' 'c-button--blue' %}
19
+ {% button 'Tertiary button' '' 'c-button--outline-green' %}
20
+ - Primary buttons are always colored MP Green (#13AA13). Please use this color sparingly, for the most important elements on the page.
21
+ - Secondary buttons may be colored MP Blue (#00A2C2), or outlined.
22
+ - The font is Inter Bold, 18px.
23
+ - 6px border-radius.
24
+ - Padding is 0.777em (horizontal) and 1.5em (vertical).
25
+
26
+ ## Layout
27
+ - Use a plain white background, with a splash of color to emphasise important elements.
28
+ - Reduce visual clutter by using space to separate items, rather than lines or boxes. Don't be afraid of white space!
29
+ - Text is most comfortable to read when it's between 50-75 characters wide. This translates to 30-50 em.
30
+
31
+ ## More details
32
+ - [Fonts and typography](../typography)
33
+ - [Colors](../colors)
34
+ - [Buttons](/components/button)
35
+ - [Tone of voice](/content)
@@ -21,7 +21,7 @@ Step 0 is the 'default' shade for each color."
21
21
  <div class="u-wrap--content">
22
22
 
23
23
  {{ alert({
24
- content: "<p>This page applies to printed materials and Office files such as Powerpoint etc. If you're building a website see the <a href='/components/colour'>Components -> colors</a> page instead.</p>",
24
+ content: "<p>If you're building a website which consumes the Franklin CSS via CDN, see the <a href='/components/colour'>Components colors</a> page instead.</p>",
25
25
  type: "info"
26
26
  })}}
27
27
 
@@ -139,7 +139,7 @@ Step 0 is the 'default' shade for each color."
139
139
 
140
140
  {
141
141
  name: "-1",
142
- hex: '252525',
142
+ hex: '1c1c1c',
143
143
  cmyk: '00.00.00.95'
144
144
  },
145
145
  {
@@ -149,7 +149,7 @@ Step 0 is the 'default' shade for each color."
149
149
  },
150
150
  {
151
151
  name: 1,
152
- hex: '6c6c6c',
152
+ hex: '959595',
153
153
  cmyk: '00.00.00.70'
154
154
  },
155
155
  {