@foeewni/web-core 2.2.12 → 2.4.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/dist/css/foe.critical.min.css +9 -19
- package/dist/css/foe.extras.min.css +2 -4
- package/dist/css/foe.main.min.css +10 -22
- package/dist/js/foe.critical.min.js +1 -1
- package/dist/js/foe.extras.min.js +1 -1
- package/dist/js/foe.fonts.min.js +1 -1
- package/dist/js/foe.main.min.js +1 -1
- package/package.json +14 -14
- package/src/components/campaign-navigation/style.scss +1 -1
- package/src/components/form/buttons.scss +0 -15
- package/src/components/form/forms.scss +1 -1
- package/src/components/form/inputs.scss +1 -1
- package/src/components/go-top/style.scss +1 -1
- package/src/components/hero-panel/style.scss +4 -4
- package/src/components/layout/horizontal-rule.scss +1 -1
- package/src/components/layout/images.scss +2 -2
- package/src/components/navigation/_header.scss +2 -2
- package/src/components/navigation/_mega-menu.scss +7 -7
- package/src/components/navigation/_search.scss +4 -4
- package/src/components/tools/data-defer-src.js +7 -3
- package/src/components/tools/rubik-tracking.js +1 -2
- package/src/components/typography/display.scss +1 -1
- package/src/components/typography/metadata.scss +1 -1
- package/src/fonts.js +2 -0
- package/src/utils/scss/helpers/_mixins.scss +5 -3
- package/src/utils/scss/helpers/_variables.scss +17 -17
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@foeewni/web-core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "Friend of the Earth EWNI Core for frontend projects",
|
|
5
5
|
"browser": {
|
|
6
6
|
"foe-core.js": "dist/js/foe.core.min.js",
|
|
@@ -28,15 +28,15 @@
|
|
|
28
28
|
"@deimosindustries/markdown-documentation-generator": "^3.2.4",
|
|
29
29
|
"@fortawesome/fontawesome-free": "^5.13.0",
|
|
30
30
|
"@fortawesome/fontawesome-svg-core": "^1.2.28",
|
|
31
|
-
"@fortawesome/free-brands-svg-icons": "^5.13.
|
|
31
|
+
"@fortawesome/free-brands-svg-icons": "^5.13.1",
|
|
32
32
|
"@fortawesome/free-solid-svg-icons": "^5.13.0",
|
|
33
|
-
"bootstrap": "4.6.
|
|
33
|
+
"bootstrap": "^4.6.2",
|
|
34
34
|
"jarallax": "^1.11.1",
|
|
35
35
|
"local-storage": "^2.0.0",
|
|
36
36
|
"mini-css-extract-plugin": "^1.5.0",
|
|
37
|
-
"node-sass": "^4.14.1",
|
|
38
37
|
"object-fit-images": "^3.2.4",
|
|
39
|
-
"popper.js": "^1.16.1"
|
|
38
|
+
"popper.js": "^1.16.1",
|
|
39
|
+
"sass": "^1.56.1"
|
|
40
40
|
},
|
|
41
41
|
"repository": {
|
|
42
42
|
"type": "git",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"copy-webpack-plugin": "^8.1.1",
|
|
59
59
|
"core-js": "^3.10",
|
|
60
60
|
"css-hot-loader": "^1.4.4",
|
|
61
|
-
"css-loader": "^
|
|
61
|
+
"css-loader": "^6.7.2",
|
|
62
62
|
"eslint": "^5.16.0",
|
|
63
63
|
"eslint-config-airbnb-base": "^13.2.0",
|
|
64
64
|
"eslint-plugin-import": "^2.18.2",
|
|
@@ -66,19 +66,19 @@
|
|
|
66
66
|
"html-webpack-plugin": "^5.3.1",
|
|
67
67
|
"inquirer": "^6.0.0",
|
|
68
68
|
"jquery": "^3.5.0",
|
|
69
|
-
"sass-
|
|
70
|
-
"sass-loader": "^10.1.1",
|
|
69
|
+
"sass-loader": "^13.2.0",
|
|
71
70
|
"style-loader": "^2.0.0",
|
|
72
71
|
"stylelint": "^13.0.0",
|
|
73
72
|
"stylelint-config-standard": "^21.0.0",
|
|
74
73
|
"stylelint-webpack-plugin": "^2.1.1",
|
|
75
74
|
"terser-webpack-plugin": "^5.1.1",
|
|
76
|
-
"
|
|
77
|
-
"webpack
|
|
78
|
-
"webpack-
|
|
79
|
-
"webpack-
|
|
80
|
-
"webpack-
|
|
81
|
-
"webpack-
|
|
75
|
+
"url": "^0.11.0",
|
|
76
|
+
"webpack": "^5.75.0",
|
|
77
|
+
"webpack-bundle-analyzer": "^4.7.0",
|
|
78
|
+
"webpack-cli": "^5.0.1",
|
|
79
|
+
"webpack-dev-server": "^4.11.1",
|
|
80
|
+
"webpack-livereload-plugin": "^3.0.2",
|
|
81
|
+
"webpack-shell-plugin-next": "^2.3.1"
|
|
82
82
|
},
|
|
83
83
|
"peerDependencies": {}
|
|
84
84
|
}
|
|
@@ -48,21 +48,6 @@ Form `type=submit`s, `button`s are by default uncolorized, please use one of the
|
|
|
48
48
|
@import '~bootstrap/scss/buttons';
|
|
49
49
|
@import '~bootstrap/scss/button-group';
|
|
50
50
|
|
|
51
|
-
input[type=submit],
|
|
52
|
-
input[type=button],
|
|
53
|
-
button {
|
|
54
|
-
&:not(.btn) {
|
|
55
|
-
@extend .btn;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
input[type=reset] {
|
|
60
|
-
&:not(.btn) {
|
|
61
|
-
@extend .btn;
|
|
62
|
-
@extend .btn-danger;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
51
|
@include media-breakpoint-down(sm) {
|
|
67
52
|
.btn {
|
|
68
53
|
font-size: .8rem;
|
|
@@ -152,7 +152,7 @@ The parallax effect needs the file `foe.components.js` to be appended in the pag
|
|
|
152
152
|
|
|
153
153
|
.foe-hero-panel {
|
|
154
154
|
position: relative;
|
|
155
|
-
min-height: (320/16) * 1rem; // Height for mobile
|
|
155
|
+
min-height: calc(320 / 16) * 1rem; // Height for mobile
|
|
156
156
|
width: 100%;
|
|
157
157
|
margin: 0;
|
|
158
158
|
top: 0;
|
|
@@ -167,7 +167,7 @@ The parallax effect needs the file `foe.components.js` to be appended in the pag
|
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
@include media-breakpoint-up(md) {
|
|
170
|
-
height: 100/16*9vw; // 16:9 ratio for non-mobile
|
|
170
|
+
height: calc(100 / 16 * 9vw); // 16:9 ratio for non-mobile
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
|
|
@@ -217,7 +217,7 @@ The parallax effect needs the file `foe.components.js` to be appended in the pag
|
|
|
217
217
|
|
|
218
218
|
.foe-hero-panel-buffer {
|
|
219
219
|
min-height: $spacer*16; // Height for mobile
|
|
220
|
-
height: 100/16*9vw; // 16:9 ratio for the rest
|
|
220
|
+
height: calc(100 / 16 * 9vw); // 16:9 ratio for the rest
|
|
221
221
|
max-height: 90vh; // We limit it so it doesn't get absurdly huge
|
|
222
222
|
width: 100%;
|
|
223
223
|
top: 0;
|
|
@@ -273,7 +273,7 @@ The parallax effect needs the file `foe.components.js` to be appended in the pag
|
|
|
273
273
|
z-index: 3;
|
|
274
274
|
|
|
275
275
|
h1 {
|
|
276
|
-
margin-bottom: $spacer/4;
|
|
276
|
+
margin-bottom: calc($spacer / 4);
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
279
|
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
@include media-breakpoint-down(md) {
|
|
66
|
-
padding-left: $grid-gutter-width / 2 !important;
|
|
67
|
-
padding-right: $grid-gutter-width / 2 !important;
|
|
66
|
+
padding-left: calc($grid-gutter-width / 2) !important;
|
|
67
|
+
padding-right: calc($grid-gutter-width / 2) !important;
|
|
68
68
|
overflow: hidden;
|
|
69
69
|
}
|
|
70
70
|
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
> ul {
|
|
37
|
-
padding-right: $grid-gutter-width / 2;
|
|
38
|
-
padding-left: $grid-gutter-width / 2;
|
|
37
|
+
padding-right: calc($grid-gutter-width / 2);
|
|
38
|
+
padding-left: calc($grid-gutter-width / 2);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
> .container > .row {
|
|
@@ -52,13 +52,13 @@
|
|
|
52
52
|
|
|
53
53
|
> li {
|
|
54
54
|
> span {
|
|
55
|
-
line-height: $foe-submenu-tile-height / 4;
|
|
55
|
+
line-height: calc($foe-submenu-tile-height / 4);
|
|
56
56
|
font-weight: 500;
|
|
57
57
|
color: $foe-gray;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
> a {
|
|
61
|
-
line-height: $foe-submenu-tile-height / 4;
|
|
61
|
+
line-height: calc($foe-submenu-tile-height / 4);
|
|
62
62
|
font-weight: 500;
|
|
63
63
|
padding-left: 0;
|
|
64
64
|
padding-right: 36px;
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
@for $i from 1 through 12 {
|
|
82
82
|
&.col-md-#{$i} {
|
|
83
83
|
ul.sub-megamenu-first {
|
|
84
|
-
column-count: ceil($i / 2);
|
|
84
|
+
column-count: ceil(calc($i / 2));
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
}
|
|
@@ -171,11 +171,11 @@
|
|
|
171
171
|
|
|
172
172
|
ul.sub-megamenu-first {
|
|
173
173
|
padding: 0;
|
|
174
|
-
margin: 0 ($grid-gutter-width / -2);
|
|
174
|
+
margin: 0 calc($grid-gutter-width / -2);
|
|
175
175
|
list-style: none;
|
|
176
176
|
|
|
177
177
|
> li {
|
|
178
|
-
padding: 0 ($grid-gutter-width / 2);
|
|
178
|
+
padding: 0 calc($grid-gutter-width / 2);
|
|
179
179
|
margin: 0;
|
|
180
180
|
}
|
|
181
181
|
}
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
line-height: $foe-nav-height-small;
|
|
18
18
|
color: $foe-offwhite !important;
|
|
19
19
|
transition: line-height $foe-transition-duration-base $foe-transition-easing;
|
|
20
|
-
width: $spacer*3;
|
|
21
|
-
padding-left: $grid-gutter-width / 2;
|
|
22
|
-
padding-right: $grid-gutter-width / 2;
|
|
20
|
+
width: calc($spacer * 3);
|
|
21
|
+
padding-left: calc($grid-gutter-width / 2);
|
|
22
|
+
padding-right: calc($grid-gutter-width / 2);
|
|
23
23
|
display: block;
|
|
24
24
|
|
|
25
25
|
.fa-times {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
@include media-breakpoint-up(sm) {
|
|
34
|
-
width: $spacer*4;
|
|
34
|
+
width: calc($spacer * 4);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
@include media-breakpoint-up(md) {
|
|
@@ -35,9 +35,7 @@ Usage:
|
|
|
35
35
|
import './data-defer-src.scss';
|
|
36
36
|
|
|
37
37
|
(() => {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
elements.forEach((el) => {
|
|
38
|
+
window.deferSrc = (el) => {
|
|
41
39
|
let isVisible = false;
|
|
42
40
|
const source = el.dataset.deferSrc;
|
|
43
41
|
|
|
@@ -72,5 +70,11 @@ import './data-defer-src.scss';
|
|
|
72
70
|
});
|
|
73
71
|
|
|
74
72
|
observer.observe(el);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const elements = document.querySelectorAll('[data-defer-src]');
|
|
76
|
+
|
|
77
|
+
elements.forEach((el) => {
|
|
78
|
+
window.deferSrc(el);
|
|
75
79
|
});
|
|
76
80
|
})();
|
|
@@ -207,7 +207,6 @@ import * as store from 'local-storage';
|
|
|
207
207
|
store.set('foe_attribution', null);
|
|
208
208
|
return null;
|
|
209
209
|
}
|
|
210
|
-
|
|
211
210
|
Object.assign(attributionSession, {
|
|
212
211
|
expiry: Date.now() + ANALYTICS_SESSION_LENGTH,
|
|
213
212
|
});
|
|
@@ -257,7 +256,7 @@ import * as store from 'local-storage';
|
|
|
257
256
|
if (attribution[key]
|
|
258
257
|
&& attribution[key].length
|
|
259
258
|
&& typeof attribution[key] === 'string') {
|
|
260
|
-
|
|
259
|
+
attributionInput.val(attribution[key]);
|
|
261
260
|
}
|
|
262
261
|
});
|
|
263
262
|
}
|
|
@@ -74,7 +74,7 @@ Custom Friends of the Earth styling for common text elements.
|
|
|
74
74
|
font-weight: normal !important;
|
|
75
75
|
text-transform: uppercase;
|
|
76
76
|
transition-property: opacity, color, box-shadow;
|
|
77
|
-
transition-duration: $foe-transition-duration-base/2;
|
|
77
|
+
transition-duration: calc($foe-transition-duration-base / 2);
|
|
78
78
|
transition-timing-function: $foe-transition-easing;
|
|
79
79
|
text-decoration: none;
|
|
80
80
|
|
package/src/fonts.js
CHANGED
|
@@ -52,6 +52,7 @@ import { faWhatsapp } from '@fortawesome/free-brands-svg-icons/faWhatsapp';
|
|
|
52
52
|
import { faFacebookMessenger } from '@fortawesome/free-brands-svg-icons/faFacebookMessenger';
|
|
53
53
|
import { faTelegram } from '@fortawesome/free-brands-svg-icons/faTelegram';
|
|
54
54
|
import { faTelegramPlane } from '@fortawesome/free-brands-svg-icons/faTelegramPlane';
|
|
55
|
+
import { faTiktok } from '@fortawesome/free-brands-svg-icons/faTiktok';
|
|
55
56
|
import { faChevronDown } from '@fortawesome/free-solid-svg-icons/faChevronDown';
|
|
56
57
|
import { faChevronUp } from '@fortawesome/free-solid-svg-icons/faChevronUp';
|
|
57
58
|
import { faAngleDown } from '@fortawesome/free-solid-svg-icons/faAngleDown';
|
|
@@ -98,6 +99,7 @@ library.add(
|
|
|
98
99
|
faFacebookMessenger,
|
|
99
100
|
faTelegram,
|
|
100
101
|
faTelegramPlane,
|
|
102
|
+
faTiktok,
|
|
101
103
|
faChevronDown,
|
|
102
104
|
faChevronUp,
|
|
103
105
|
faAngleDown,
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@use 'sass:math';
|
|
2
|
+
|
|
1
3
|
//
|
|
2
4
|
// General functions and mixins
|
|
3
5
|
//
|
|
@@ -50,8 +52,8 @@
|
|
|
50
52
|
// Example: an element has a height of 30px, it's parent is 100px, so write out `.margin-vertical-align(100px, 30px);` to calculate the appropriate top margin.
|
|
51
53
|
|
|
52
54
|
@mixin margin-vertical-align($parent-height, $element-height) {
|
|
53
|
-
margin-top: (($parent-height - $element-height) / 2);
|
|
54
|
-
margin-bottom: (($parent-height - $element-height) / 2);
|
|
55
|
+
margin-top: calc(($parent-height - $element-height) / 2);
|
|
56
|
+
margin-bottom: calc(($parent-height - $element-height) / 2);
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
|
|
@@ -98,7 +100,7 @@
|
|
|
98
100
|
}
|
|
99
101
|
|
|
100
102
|
@function strip-units($value) {
|
|
101
|
-
@return $value
|
|
103
|
+
@return math.div($value, ($value * 0 + 1));
|
|
102
104
|
}
|
|
103
105
|
|
|
104
106
|
// From https://stackoverflow.com/a/25478589
|
|
@@ -431,12 +431,12 @@ $font-weight-heavy: 700;
|
|
|
431
431
|
$font-weight-base: $font-weight-normal;
|
|
432
432
|
$line-height-base: 1.5;
|
|
433
433
|
|
|
434
|
-
$h1-font-size: (56/16) * $font-size-base;
|
|
435
|
-
$h2-font-size: (44/16) * $font-size-base;
|
|
436
|
-
$h3-font-size: (34/16) * $font-size-base;
|
|
437
|
-
$h4-font-size: (26/16) * $font-size-base;
|
|
438
|
-
$h5-font-size: (20/16) * $font-size-base;
|
|
439
|
-
$h6-font-size: (16/16) * $font-size-base;
|
|
434
|
+
$h1-font-size: calc(56 / 16) * $font-size-base;
|
|
435
|
+
$h2-font-size: calc(44 / 16) * $font-size-base;
|
|
436
|
+
$h3-font-size: calc(34 / 16) * $font-size-base;
|
|
437
|
+
$h4-font-size: calc(26 / 16) * $font-size-base;
|
|
438
|
+
$h5-font-size: calc(20 / 16) * $font-size-base;
|
|
439
|
+
$h6-font-size: calc(16 / 16) * $font-size-base;
|
|
440
440
|
|
|
441
441
|
$headings-map: (
|
|
442
442
|
h1: $h1-font-size,
|
|
@@ -447,14 +447,14 @@ $headings-map: (
|
|
|
447
447
|
h6: $h6-font-size,
|
|
448
448
|
);
|
|
449
449
|
|
|
450
|
-
$headings-margin-bottom: ($spacer / 2);
|
|
450
|
+
$headings-margin-bottom: calc($spacer / 2);
|
|
451
451
|
$headings-font-family: inherit;
|
|
452
452
|
$headings-font-weight: 600;
|
|
453
453
|
$headings-line-height: 1.2;
|
|
454
454
|
$headings-color: $foe-primary;
|
|
455
455
|
|
|
456
|
-
$display1-size: (60/16) * $font-size-base;
|
|
457
|
-
$display2-size: (60/16) * $font-size-base;
|
|
456
|
+
$display1-size: calc(60 / 16) * $font-size-base;
|
|
457
|
+
$display2-size: calc(60 / 16) * $font-size-base;
|
|
458
458
|
$display3-size: 4.5rem;
|
|
459
459
|
$display4-size: 3.5rem;
|
|
460
460
|
|
|
@@ -815,11 +815,11 @@ $nav-pills-link-active-color: $component-active-color;
|
|
|
815
815
|
$nav-pills-link-active-bg: $component-active-bg;
|
|
816
816
|
|
|
817
817
|
$nav-divider-color: $gray-200;
|
|
818
|
-
$nav-divider-margin-y: ($spacer / 2);
|
|
818
|
+
$nav-divider-margin-y: calc($spacer / 2);
|
|
819
819
|
|
|
820
820
|
// Navbar
|
|
821
821
|
|
|
822
|
-
$navbar-padding-y: ($spacer / 2);
|
|
822
|
+
$navbar-padding-y: calc($spacer / 2);
|
|
823
823
|
$navbar-padding-x: $spacer;
|
|
824
824
|
|
|
825
825
|
$navbar-nav-link-padding-x: .5rem;
|
|
@@ -828,7 +828,7 @@ $navbar-brand-font-size: $font-size-lg;
|
|
|
828
828
|
// Compute the navbar-brand padding-y so the navbar-brand will have the same height as navbar-text and nav-link
|
|
829
829
|
$nav-link-height: ($font-size-base * $line-height-base + $nav-link-padding-y * 2);
|
|
830
830
|
$navbar-brand-height: $navbar-brand-font-size * $line-height-base;
|
|
831
|
-
$navbar-brand-padding-y: ($nav-link-height - $navbar-brand-height) / 2;
|
|
831
|
+
$navbar-brand-padding-y: calc(($nav-link-height - $navbar-brand-height) / 2);
|
|
832
832
|
|
|
833
833
|
$navbar-toggler-padding-y: .25rem;
|
|
834
834
|
$navbar-toggler-padding-x: .75rem;
|
|
@@ -899,7 +899,7 @@ $card-bg: $white;
|
|
|
899
899
|
|
|
900
900
|
$card-img-overlay-padding: 1.25rem;
|
|
901
901
|
|
|
902
|
-
$card-group-margin: ($grid-gutter-width / 2);
|
|
902
|
+
$card-group-margin: calc($grid-gutter-width / 2);
|
|
903
903
|
$card-deck-margin: $card-group-margin;
|
|
904
904
|
|
|
905
905
|
$card-columns-count: 3;
|
|
@@ -1139,10 +1139,10 @@ $foe-nav-transition-duration: 250ms;
|
|
|
1139
1139
|
|
|
1140
1140
|
|
|
1141
1141
|
// Logo
|
|
1142
|
-
$foe-nav-logo-height-small: $foe-nav-height-small*2/3; // Adjustment for tiny screens, not quite official whitespace...
|
|
1143
|
-
$foe-nav-logo-height-medium: $foe-nav-height-medium*3/5;
|
|
1144
|
-
$foe-nav-logo-height-large: $foe-nav-height-large*3/5;
|
|
1145
|
-
$foe-nav-logo-height-large-scrolled: $foe-nav-height-large-scrolled*3/5; // Hence can be the same size of navbar when scrolled
|
|
1142
|
+
$foe-nav-logo-height-small: calc($foe-nav-height-small * 2 / 3); // Adjustment for tiny screens, not quite official whitespace...
|
|
1143
|
+
$foe-nav-logo-height-medium: calc($foe-nav-height-medium * 3 / 5);
|
|
1144
|
+
$foe-nav-logo-height-large: calc($foe-nav-height-large * 3 / 5);
|
|
1145
|
+
$foe-nav-logo-height-large-scrolled: calc($foe-nav-height-large-scrolled * 3 / 5); // Hence can be the same size of navbar when scrolled
|
|
1146
1146
|
|
|
1147
1147
|
// Manually add in all header variants based on bootstrap-named breakpoints.
|
|
1148
1148
|
// Likely prone to change in the Bootstrap 5+ refactor.
|