mp-design-system 0.6.2 → 0.7.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/build/js/app.js +6 -4
- package/dist/build/js/app.js.map +1 -1
- package/dist/build/scss/library.css +1 -1
- package/dist/build/scss/library.css.map +1 -1
- package/dist/build/scss/main.css +1 -1
- package/dist/build/scss/main.css.map +1 -1
- package/package.json +1 -1
- package/src/_includes/components/campaign/campaign.config.js +3 -3
- package/src/_includes/components/card/card.scss +4 -14
- package/src/_includes/components/comparison-table/comparison-table.scss +5 -0
- package/src/_includes/components/industry-card/industry-card.njk +2 -2
- package/src/_includes/components/industry-card/industry-card.scss +4 -4
- package/src/_includes/components/meta-box/meta-box.scss +5 -1
- package/src/_includes/components/table/table.scss +4 -0
- package/src/_includes/components/usp/usp.scss +2 -7
- package/src/_includes/includes/related-events.njk +1 -1
- package/src/_includes/includes/resources.njk +1 -1
- package/src/_includes/layout.njk +28 -4
- package/src/assets/js/app.js +2 -0
- package/src/assets/js/imports/scrollbar-width.js +15 -0
- package/src/assets/js/imports/utilities.js +10 -0
- package/src/assets/scss/components/gallery.scss +16 -18
- package/src/assets/scss/library.scss +6 -2
- package/src/assets/scss/objects/grid.scss +0 -1
- package/src/assets/scss/tools/breakout.scss +2 -0
- package/src/assets/scss/utilities/display.scss +6 -4
- package/src/assets/scss/utilities/hr.scss +4 -0
- package/src/assets/scss/utilities/index.scss +4 -0
- package/src/components/utilities.md +47 -4
- package/src/patterns/grid-of-cards.njk +57 -21
- package/src/prototype/index.njk +1 -1
package/package.json
CHANGED
@@ -24,19 +24,19 @@ module.exports = {
|
|
24
24
|
{
|
25
25
|
title: 'Petrol',
|
26
26
|
context: {
|
27
|
-
classes: 'c-
|
27
|
+
classes: 'c-campaign--petrol'
|
28
28
|
}
|
29
29
|
},
|
30
30
|
{
|
31
31
|
title: 'Blue',
|
32
32
|
context: {
|
33
|
-
classes: 'c-
|
33
|
+
classes: 'c-campaign--blue'
|
34
34
|
}
|
35
35
|
},
|
36
36
|
{
|
37
37
|
title: 'Orange',
|
38
38
|
context: {
|
39
|
-
classes: 'c-
|
39
|
+
classes: 'c-campaign--orange'
|
40
40
|
}
|
41
41
|
}
|
42
42
|
],
|
@@ -170,20 +170,6 @@
|
|
170
170
|
}
|
171
171
|
}
|
172
172
|
|
173
|
-
// &--fixed-aspect figure {
|
174
|
-
// height: 0;
|
175
|
-
// padding-bottom: 62.5%;
|
176
|
-
// aspect-ratio: 16/10;
|
177
|
-
// position: relative;
|
178
|
-
// }
|
179
|
-
// &--image-margin figure {
|
180
|
-
// @include margin("s-m", "s-m", 0, "s-m");
|
181
|
-
// }
|
182
|
-
|
183
|
-
&--layout-single &__figure {
|
184
|
-
@extend .u-16\/9;
|
185
|
-
}
|
186
|
-
|
187
173
|
&__primary {
|
188
174
|
@include flow("s");
|
189
175
|
}
|
@@ -418,3 +404,7 @@
|
|
418
404
|
@include gap("s-l");
|
419
405
|
}
|
420
406
|
}
|
407
|
+
|
408
|
+
// IE11 fix
|
409
|
+
// This forces IE11 to use display:block instead of flex for single-column cards
|
410
|
+
_:-ms-fullscreen, :root .c-card, :root .c-card--layout-single .c-card__wrapper { display:block; }
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<article class="mp c-industry-card">
|
2
2
|
<a class="c-industry-card__link u-flow--xs" href="{{ params.link }}">
|
3
|
-
<figure class="c-industry-card__image
|
4
|
-
<img class="u-
|
3
|
+
<figure class="c-industry-card__image">
|
4
|
+
<img class="u-2/1" src="{{ params.image.src }}" alt="{{ params.image.alt or params.title }}" />
|
5
5
|
</figure>
|
6
6
|
<h3 class="c-h c-h--reset">{{ params.title }}</h3>
|
7
7
|
</a>
|
@@ -2,9 +2,7 @@
|
|
2
2
|
@include padding('s-m');
|
3
3
|
border: 1px solid;
|
4
4
|
border-image-slice: 1;
|
5
|
-
border-image-source: linear-gradient(
|
6
|
-
rgba(color('blue'), 0.5),
|
7
|
-
rgba(color('green'), 0.5));
|
5
|
+
border-image-source: linear-gradient(to right, rgba(color('blue'),0.5), rgba(color('green'),0.5));
|
8
6
|
position: relative;
|
9
7
|
|
10
8
|
&__title {
|
@@ -12,10 +10,7 @@
|
|
12
10
|
color: color('petrol');
|
13
11
|
|
14
12
|
@supports(-webkit-text-fill-color:transparent) {
|
15
|
-
background-image: -
|
16
|
-
0% 0%,100% 100%,
|
17
|
-
from(color('petrol')),
|
18
|
-
to(color('blue')));
|
13
|
+
background-image: linear-gradient(to right, color('petrol'), color('blue') );
|
19
14
|
-webkit-background-clip: text;
|
20
15
|
-webkit-text-fill-color: transparent;
|
21
16
|
display: inline-block;
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<aside class="c-slat c-slat--grey c-slat--padded">
|
4
4
|
<div class="u-wrap u-flow">
|
5
5
|
<h3 class="c-h c-h--upper">Related events</h3>
|
6
|
-
<div class="o-grid o-grid--of-three">
|
6
|
+
<div class="o-grid o-grid--of-three o-grid--swipeable">
|
7
7
|
{{ card({
|
8
8
|
theme: {
|
9
9
|
layout: 'single',
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<aside class="mp c-slat c-slat--grey c-slat--padded">
|
4
4
|
<div class="u-wrap u-flow--xl">
|
5
5
|
<h2 class="c-h c-h--step-3">Related resources</h2>
|
6
|
-
<div class="o-grid o-grid--of-three">
|
6
|
+
<div class="o-grid o-grid--of-three o-grid--swipeable">
|
7
7
|
{{ card({
|
8
8
|
theme: {
|
9
9
|
layout: 'single',
|
package/src/_includes/layout.njk
CHANGED
@@ -14,10 +14,31 @@
|
|
14
14
|
<meta property="og:image:alt" content="{{ config.name }}" />
|
15
15
|
<meta name="twitter:image" content="{{ config.openGraphImage }}" />
|
16
16
|
<link rel="preconnect" href="https://fonts.gstatic.com">
|
17
|
-
<script>
|
18
|
-
document.documentElement
|
19
|
-
|
20
|
-
|
17
|
+
<script>
|
18
|
+
if(document.documentElement){
|
19
|
+
document.documentElement.classList.add('has-js');
|
20
|
+
document.documentElement.classList.remove('no-js');
|
21
|
+
}
|
22
|
+
// Calculate the height of the sidebar so it doesn't cause double scrollbars
|
23
|
+
function debounce(func, wait, immediate) {
|
24
|
+
var timeout;
|
25
|
+
return function() {
|
26
|
+
var context = this, args = arguments;
|
27
|
+
var later = function() {
|
28
|
+
timeout = null;
|
29
|
+
if (!immediate) func.apply(context, args);
|
30
|
+
};
|
31
|
+
var callNow = immediate && !timeout;
|
32
|
+
clearTimeout(timeout);
|
33
|
+
timeout = setTimeout(later, wait);
|
34
|
+
if (callNow) func.apply(context, args);
|
35
|
+
};
|
36
|
+
};
|
37
|
+
var resizeSidebar = debounce(function() {
|
38
|
+
var headerHeight = document.querySelector('.c-library__header').offsetHeight + 'px';
|
39
|
+
document.documentElement.style.setProperty('--headerHeight', headerHeight)
|
40
|
+
}, 250);
|
41
|
+
</script>
|
21
42
|
<link rel="icon" type="image/png" sizes="32x32" href="/static/img/favicon-32x32.png">
|
22
43
|
<link rel="stylesheet" href="/build/scss/main.css" />
|
23
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>
|
@@ -30,12 +51,15 @@
|
|
30
51
|
<script src="/build/js/app.js"></script>
|
31
52
|
<script>
|
32
53
|
(function() {
|
54
|
+
// Prevent empty links from jumping to the top of page when clicked
|
33
55
|
var links = document.querySelectorAll('a[href=""],a[href="#"]');
|
34
56
|
for(var i = 0; links.length > i; i++) {
|
35
57
|
links[i].addEventListener('click', function(event) {
|
36
58
|
event.preventDefault();
|
37
59
|
})
|
38
60
|
}
|
61
|
+
window.addEventListener('resize', resizeSidebar);
|
62
|
+
resizeSidebar();
|
39
63
|
})();
|
40
64
|
</script>
|
41
65
|
</body>
|
package/src/assets/js/app.js
CHANGED
@@ -5,6 +5,7 @@ import Gallery from './imports/gallery';
|
|
5
5
|
import HeroPattern from './imports/hero-pattern';
|
6
6
|
import ResponsiveTable from './imports/responsive-table';
|
7
7
|
import ScrollSpy from './imports/scroll-spy';
|
8
|
+
import ScrollbarWidth from './imports/scrollbar-width';
|
8
9
|
import Tabs from './imports/tabs';
|
9
10
|
|
10
11
|
(() => {
|
@@ -23,4 +24,5 @@ import Tabs from './imports/tabs';
|
|
23
24
|
Tabs();
|
24
25
|
ScrollSpy();
|
25
26
|
ResponsiveTable();
|
27
|
+
ScrollbarWidth();
|
26
28
|
})();
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { debounce } from './utilities';
|
2
|
+
|
3
|
+
function ScrollbarWidth() {
|
4
|
+
setScrollbarWidth();
|
5
|
+
window.addEventListener('resize', debounce(setScrollbarWidth, 250));
|
6
|
+
}
|
7
|
+
|
8
|
+
function setScrollbarWidth() {
|
9
|
+
document.documentElement.style.setProperty(
|
10
|
+
'--scrollbarWidth',
|
11
|
+
window.innerWidth - document.body.clientWidth + 'px'
|
12
|
+
);
|
13
|
+
}
|
14
|
+
|
15
|
+
export default ScrollbarWidth;
|
@@ -15,6 +15,16 @@ export function userPrefersReducedMotion() {
|
|
15
15
|
return prefersReducedMotion;
|
16
16
|
}
|
17
17
|
|
18
|
+
export const debounce = (func, limit) => {
|
19
|
+
let wait = false;
|
20
|
+
return () => {
|
21
|
+
if (wait) return;
|
22
|
+
func();
|
23
|
+
wait = true;
|
24
|
+
setTimeout(() => wait = false, limit);
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
18
28
|
export const lerp = (x, y, a) => x * (1 - a) + y * a;
|
19
29
|
export const clamp = (a, min = 0, max = 1) => Math.min(max, Math.max(min, a));
|
20
30
|
export const invlerp = (x, y, a) => clamp((a - x) / (y - x));
|
@@ -10,8 +10,13 @@
|
|
10
10
|
width: 100%;
|
11
11
|
|
12
12
|
img {
|
13
|
-
margin: 0 auto;
|
14
13
|
display: block;
|
14
|
+
margin: 0 auto;
|
15
|
+
|
16
|
+
@supports (object-fit:contain) {
|
17
|
+
max-height: 500px;
|
18
|
+
object-fit: contain;
|
19
|
+
}
|
15
20
|
}
|
16
21
|
|
17
22
|
&:not(.active) {
|
@@ -24,29 +29,22 @@
|
|
24
29
|
@include padding-bottom('s');
|
25
30
|
display: flex;
|
26
31
|
flex-direction: row;
|
27
|
-
flex-wrap:
|
28
|
-
|
29
|
-
|
30
|
-
scroll-snap-type: x mandatory;
|
31
|
-
overflow-x: auto;
|
32
|
+
flex-wrap: wrap;
|
33
|
+
gap: 2%;
|
34
|
+
gap: max(8px, 2%);
|
32
35
|
|
33
36
|
& > * {
|
34
37
|
background: color('grey', 'step-3');
|
35
|
-
|
36
|
-
max-height
|
37
|
-
min-width
|
38
|
-
|
39
|
-
width: auto;
|
40
|
-
scroll-snap-align: start;
|
41
|
-
|
42
|
-
& + * {
|
43
|
-
margin-left: var(--space-xs-s);
|
44
|
-
}
|
38
|
+
@include space('min-height', 'l');
|
39
|
+
@include space('max-height', '2xl');
|
40
|
+
@include space('min-width', 'l');
|
41
|
+
max-width: 10.75%;
|
45
42
|
|
46
43
|
img {
|
47
|
-
|
48
|
-
opacity: 0.
|
44
|
+
height: 100%;
|
45
|
+
opacity: 0.8;
|
49
46
|
object-fit: cover;
|
47
|
+
width: 100%;
|
50
48
|
}
|
51
49
|
|
52
50
|
&.active img {
|
@@ -71,7 +71,7 @@
|
|
71
71
|
@media only screen and (min-width: 600px) {
|
72
72
|
&--components &__body > * {
|
73
73
|
overflow-y: scroll;
|
74
|
-
height: calc(100vh -
|
74
|
+
height: calc( 100vh - var(--headerHeight) - 1px );
|
75
75
|
}
|
76
76
|
}
|
77
77
|
|
@@ -212,7 +212,11 @@
|
|
212
212
|
}
|
213
213
|
|
214
214
|
&__main {
|
215
|
-
overflow-y:
|
215
|
+
overflow-y: auto;
|
216
|
+
|
217
|
+
@media only screen and (min-width: 600px) {
|
218
|
+
overflow-y: scroll;
|
219
|
+
}
|
216
220
|
}
|
217
221
|
|
218
222
|
&__frame {
|
@@ -3,9 +3,11 @@
|
|
3
3
|
|
4
4
|
@mixin breakout($pad: 0) {
|
5
5
|
left: 50%;
|
6
|
+
left: calc( 50% + var(--scrollbarWidth)/2.0001 );
|
6
7
|
position: relative;
|
7
8
|
transform: translateX(-50vw);
|
8
9
|
width: 100vw;
|
10
|
+
width: calc( 100vw - var(--scrollbarWidth) );
|
9
11
|
padding-left: safe-space($pad);
|
10
12
|
padding-right: safe-space($pad);
|
11
13
|
}
|
@@ -109,10 +109,12 @@
|
|
109
109
|
@include gap("s-l");
|
110
110
|
}
|
111
111
|
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
112
|
+
@supports (object-fit: cover) {
|
113
|
+
.u-2\/1 {
|
114
|
+
aspect-ratio: 2 / 1;
|
115
|
+
object-fit: cover;
|
116
|
+
object-position: 75% 50%;
|
117
|
+
}
|
116
118
|
}
|
117
119
|
|
118
120
|
@media (min-width: 640px) {
|
@@ -63,17 +63,60 @@ More typography utility classes are documented on the [typography page](/compone
|
|
63
63
|
```
|
64
64
|
|
65
65
|
```html
|
66
|
-
<
|
66
|
+
<p class="u-sticky">This will "stick" to the top of the screen while scrolling</p>
|
67
67
|
```
|
68
68
|
|
69
69
|
```html
|
70
|
-
<div class="u-sticky--gutter">Sticky positioning with
|
70
|
+
<div class="u-sticky--gutter">Sticky positioning, with a gap above</div>
|
71
71
|
```
|
72
72
|
|
73
73
|
```html
|
74
74
|
<div class="u-split">
|
75
|
-
<
|
76
|
-
<a
|
75
|
+
<p>Split: aligned left</p>
|
76
|
+
<a class="u-link">Aligned right</a>
|
77
77
|
</div>
|
78
78
|
The two child items will be aligned in a horizontal row
|
79
|
+
```
|
80
|
+
<div class="u-split u-pad-s u-border">
|
81
|
+
<p>Split: aligned left</p>
|
82
|
+
<a class="u-link">Aligned right</a>
|
83
|
+
</div>
|
84
|
+
|
85
|
+
## Padding and margins
|
86
|
+
|
87
|
+
More padding and margin utility classes are documented on the [space page](/components/space).
|
88
|
+
|
89
|
+
#### Syntax:
|
90
|
+
`u`-`(pad or margin)`-`(optional direction)`-`(size)`-`(optional flex size)`
|
91
|
+
|
92
|
+
Sizes | Directions
|
93
|
+
------|-----------
|
94
|
+
3xs | top
|
95
|
+
2xs | bottom
|
96
|
+
xs | left
|
97
|
+
s | right
|
98
|
+
m | y
|
99
|
+
l | x
|
100
|
+
xl |
|
101
|
+
2xl |
|
102
|
+
3xl |
|
103
|
+
4xl |
|
104
|
+
|
105
|
+
N.B. Not all permutations are available in the existing CSS, as that would amount to over 4800 extra lines of code. Currently we've only implemented a handful - but we can add more as needed.
|
106
|
+
|
107
|
+
```html
|
108
|
+
<div class="u-pad-s">Small padding on all sides</div>
|
109
|
+
```
|
110
|
+
|
111
|
+
```html
|
112
|
+
<div class="u-margin-y-xl">Extra large margin on top and bottom</div>
|
113
|
+
```
|
114
|
+
|
115
|
+
```html
|
116
|
+
<div class="u-margin-left-m">Medium margin on left side only</div>
|
117
|
+
```
|
118
|
+
|
119
|
+
```html
|
120
|
+
<div class="u-pad-x-s-xl">Flexible (small to XL) padding on left and right</div>
|
121
|
+
Grows from small padding on small screens, to xl padding on large screens
|
79
122
|
```
|
@@ -6,25 +6,61 @@ layout: patterns-page
|
|
6
6
|
{% from "components/card/macro.njk" import card %}
|
7
7
|
|
8
8
|
<div class="o-grid o-grid--of-three o-grid--swipeable">
|
9
|
-
{
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
9
|
+
{{ card({
|
10
|
+
theme: {
|
11
|
+
layout: 'single',
|
12
|
+
size: 'medium',
|
13
|
+
name: 'alt'
|
14
|
+
},
|
15
|
+
image: {
|
16
|
+
src: '/static/img/blog-page-image-1.jpg',
|
17
|
+
alt: ''
|
18
|
+
},
|
19
|
+
header: {
|
20
|
+
title: 'Mixing it with the Mastersizer!'
|
21
|
+
},
|
22
|
+
body: {
|
23
|
+
content: '<p>At a major leading manufacturer of mixing equipment, the Mastersizer particle size analyzer is one of the analytical instruments used by customers during process simulations.</p>'
|
24
|
+
},
|
25
|
+
link: '/prototype/blog-post',
|
26
|
+
tag: 'News'
|
27
|
+
}) }}
|
28
|
+
{{ card({
|
29
|
+
theme: {
|
30
|
+
layout: 'single',
|
31
|
+
size: 'medium',
|
32
|
+
name: 'alt'
|
33
|
+
},
|
34
|
+
image: {
|
35
|
+
src: '/static/img/blog-page-image-1.jpg',
|
36
|
+
alt: ''
|
37
|
+
},
|
38
|
+
header: {
|
39
|
+
title: 'GPC/SEC standards: making them last'
|
40
|
+
},
|
41
|
+
body: {
|
42
|
+
content: '<p>Earlier this year I highlighted the different types of GPC/SEC standards available and where to find them on our eStore. In this post, I’m going to share some tips and tricks about preparing your standards and making them last. But first, what standard should you be using? In my previous post, I discussed how the […]</p>'
|
43
|
+
},
|
44
|
+
link: '/prototype/blog-post',
|
45
|
+
tag: 'News'
|
46
|
+
}) }}
|
47
|
+
{{ card({
|
48
|
+
theme: {
|
49
|
+
layout: 'single',
|
50
|
+
size: 'medium',
|
51
|
+
name: 'alt'
|
52
|
+
},
|
53
|
+
image: {
|
54
|
+
src: '/static/img/blog-page-image-1.jpg',
|
55
|
+
alt: ''
|
56
|
+
},
|
57
|
+
header: {
|
58
|
+
title: 'Viral Vector Vaccines: A Borrowed Technology from Gene Therapy Advancements'
|
59
|
+
},
|
60
|
+
body: {
|
61
|
+
content: '<p>Advances in recombinant DNA technology, genomics, and immunology have greatly influenced the vaccine development process. The genetic manipulation of viruses makes them suitable as vectors for gene delivery, providing a novel and unique opportunity for vaccine design. Viruses survive and replicate by invading their host’s cells and hijacking their protein-making machinery. These virus particles contain […]</p>'
|
62
|
+
},
|
63
|
+
link: '/prototype/blog-post',
|
64
|
+
tag: 'News'
|
65
|
+
}) }}
|
30
66
|
</div>
|
package/src/prototype/index.njk
CHANGED