@foeewni/web-core 2.3.0 → 2.4.1

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.
@@ -143,7 +143,7 @@ $foe-secondary-nav-height: 3rem;
143
143
 
144
144
  #js-foe-secondary-trigger {
145
145
  position: absolute;
146
- right: $grid-gutter-width/2;
146
+ right: calc($grid-gutter-width / 2);
147
147
  line-height: $foe-secondary-nav-height;
148
148
  width: 2rem;
149
149
  z-index: 10;
@@ -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;
@@ -106,7 +106,7 @@ form {
106
106
  }
107
107
 
108
108
  label {
109
- margin-bottom: $spacer/4;
109
+ margin-bottom: calc($spacer / 4);
110
110
  font-weight: bold;
111
111
  font-size: 90%;
112
112
  }
@@ -185,7 +185,7 @@ textarea {
185
185
  width: 1.5em;
186
186
  height: 1.5em;
187
187
  padding: .5em;
188
- margin-right: $spacer/2;
188
+ margin-right: calc($spacer / 2);
189
189
  vertical-align: bottom;
190
190
  color: transparent;
191
191
  transition: .2s;
@@ -3,7 +3,7 @@
3
3
  #foe-go-top {
4
4
  color: $foe-accent;
5
5
  font-size: 3rem;
6
- padding: $spacer/4;
6
+ padding: calc($spacer / 4);
7
7
  position: fixed;
8
8
  bottom: $spacer;
9
9
  right: $spacer;
@@ -2,8 +2,6 @@ import { jarallax, jarallaxElement, jarallaxVideo } from 'jarallax';
2
2
  import objectFitImages from 'object-fit-images';
3
3
  import Screen from '../../utils/js/screen.service';
4
4
 
5
- import scss from '../../utils/scss/exporter.scss';
6
-
7
5
  import './style.scss';
8
6
 
9
7
 
@@ -11,7 +9,8 @@ import './style.scss';
11
9
  const MOBILE_REGEX = /iPad|iPhone|iPod|Android/;
12
10
 
13
11
  const isMobile = () => {
14
- const mobileSize = parseInt(scss['breakpoint-md'], 10);
12
+ const breakpoints = Screen.getBreakpoints();
13
+ const mobileSize = parseInt(breakpoints['breakpoint-md'], 10);
15
14
 
16
15
  if (MOBILE_REGEX.test(navigator.userAgent) || window.innerWidth < mobileSize) {
17
16
  return true;
@@ -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
 
@@ -3,7 +3,7 @@
3
3
  // Generic classes for the horizontal rule
4
4
  @for $size from 1 to 4 {
5
5
  .hr-#{$size} {
6
- border-top-width: (1rem/10) * $size;
6
+ border-top-width: calc(1rem / 10) * $size;
7
7
  }
8
8
  }
9
9
 
@@ -15,8 +15,8 @@ figure {
15
15
  font-size: 80%;
16
16
  text-align: right;
17
17
  color: lighten($foe-text, 15);
18
- padding-top: $spacer/3;
19
- padding-bottom: $spacer/3;
18
+ padding-top: calc($spacer / 3);
19
+ padding-bottom: calc($spacer / 3);
20
20
  }
21
21
  }
22
22
 
@@ -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
  }
@@ -118,6 +118,7 @@
118
118
 
119
119
  .navbar-toggler {
120
120
  position: relative;
121
+ display: inline-block;
121
122
 
122
123
  .icon-bar {
123
124
  opacity: 0;
@@ -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) {
@@ -1,6 +1,6 @@
1
1
  .navbar-toggler {
2
2
  margin-left: 0;
3
- display: block;
3
+ display: inline-block;
4
4
  padding: 10px;
5
5
  // Resetting the border and applying a negative margin so it looks like our switcher is sitting correctly on the grid
6
6
  // For future devs: don't use padding-right: 0; as it takes away a small chunk of the tap area on mobiles.
@@ -3,7 +3,6 @@ import './menustack';
3
3
  // import 'bootstrap/js/src/collapse';
4
4
  import Popper from 'popper.js';
5
5
  import Screen from '../../utils/js/screen.service';
6
- import scss from '../../utils/scss/exporter.scss';
7
6
 
8
7
  import './style.scss';
9
8
 
@@ -60,8 +59,9 @@ import './style.scss';
60
59
  }
61
60
 
62
61
  function menuMultilevelSetup() {
62
+ const breakpoints = Screen.getBreakpoints();
63
63
  const allBreakpoints = [];
64
- Object.keys(scss).forEach((key) => {
64
+ Object.keys(breakpoints).forEach((key) => {
65
65
  if (key.indexOf('breakpoint') === 0) {
66
66
  const size = key.replace('breakpoint-', '');
67
67
  allBreakpoints.push(size);
@@ -29,7 +29,7 @@ Elements with the `js-stickystack`can be further modified by adding the classes
29
29
  *
30
30
  */
31
31
 
32
- import scss from '../../utils/scss/exporter.scss';
32
+ import Screen from '../../utils/js/screen.service';
33
33
 
34
34
  (() => {
35
35
  // Kill script if we are below IE11 or Apple devices
@@ -39,8 +39,10 @@ import scss from '../../utils/scss/exporter.scss';
39
39
  return;
40
40
  }
41
41
 
42
+ const breakpoints = Screen.getBreakpoints();
43
+
42
44
  const StickyStack = {
43
- mobileBreak: parseInt(scss['breakpoint-md'], 10),
45
+ mobileBreak: parseInt(breakpoints['breakpoint-md'], 10),
44
46
  list: [],
45
47
  number: 0,
46
48
  stackTop: 0,
@@ -3,7 +3,7 @@
3
3
  @for $i from 1 through 4 {
4
4
  .display-#{$i} {
5
5
  @include media-breakpoint-down(md) {
6
- font-size: (32/14) * 1rem !important;
6
+ font-size: calc(32 / 14) * 1rem !important;
7
7
  line-height: 1.05;
8
8
  }
9
9
  }
@@ -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
 
@@ -23,7 +23,7 @@
23
23
 
24
24
  {{#each customVariables.criticalStyles}}
25
25
  <link href="{{this}}" media="screen" rel="stylesheet" type="text/css">
26
- {{/each}}
26
+ {{/each}}
27
27
 
28
28
  {{#each customVariables.styles}}
29
29
  <link rel="preload" href="{{this}}" as="style" media="screen" onload="this.onload = null; this.rel='stylesheet'">
@@ -86,7 +86,7 @@
86
86
  {{/each}}
87
87
  <li>
88
88
  <a class="nav-item" href="/report.html">Bundle size report</a>
89
- </li>
89
+ </li>
90
90
  </ul>
91
91
  </nav>
92
92
 
@@ -52,18 +52,26 @@ export default {
52
52
  return !(bottom < scroll || top - viewHeight >= scroll);
53
53
  },
54
54
 
55
- getCurrentBreakpoint: function getCurrentBreakpoint() {
55
+ getBreakpoints: function getBreakpoints() {
56
56
  // For additional instructions see:
57
57
  // ./src/utils/scss/exporter.scss
58
58
  const breakpoints = [];
59
- Object.keys(scss).forEach((key) => {
59
+ // When used as dependency it exports scss.default
60
+ const exportedScss = scss.default || scss;
61
+ Object.keys(exportedScss).forEach((key) => {
60
62
  if (key.indexOf('breakpoint') === 0) {
61
63
  const size = key.replace('breakpoint-', '');
62
- const width = parseInt(scss[key], 10);
64
+ const width = parseInt(exportedScss[key], 10);
63
65
  breakpoints.push({ size, width });
64
66
  }
65
67
  });
66
68
 
69
+ return breakpoints;
70
+ },
71
+
72
+ getCurrentBreakpoint: function getCurrentBreakpoint() {
73
+ const breakpoints = this.getBreakpoints();
74
+
67
75
  let breakpointIndex = 0;
68
76
  while (breakpointIndex < (breakpoints.length - 1) && window.innerWidth >= breakpoints[breakpointIndex + 1].width) {
69
77
  breakpointIndex += 1;
@@ -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 / ($value * 0 + 1);
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.