@foeewni/web-core 2.2.4 → 2.2.7

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.
@@ -9,33 +9,34 @@ Form `type=submit`s, `button`s are by default uncolorized, please use one of the
9
9
 
10
10
  ```html_example
11
11
  <div class="row">
12
- <div class="col-md-4">
12
+ <div class="col-md-6">
13
13
  <h4>Primary palette</h4>
14
14
  <button class="btn btn-primary btn-block">.btn-primary</button>
15
15
  <button class="btn btn-secondary btn-block">.btn-secondary</button>
16
16
  <button class="btn btn-offwhite btn-block">.btn-offwhite</button>
17
17
  <button class="btn btn-dark btn-block">.btn-dark</button>
18
18
  <button class="btn btn-extradark btn-block">.btn-extradark</button>
19
+ <button class="btn btn-sunset btn-block">.btn-sunset</button>
20
+ <button class="btn btn-accent btn-block">.btn-accent</button>
21
+ <button class="btn btn-join btn-block">.btn-join</button>
22
+ <button class="btn btn-donate btn-block">.btn-donate</button>
19
23
  <a href="#" class="btn btn-primary btn-block">Link as button</a>
20
24
  </div>
21
25
 
22
- <div class="col-md-4">
26
+ <div class="col-md-6">
23
27
  <h4>Outlined</h4>
24
28
  <button class="btn btn-outline-primary btn-block">.btn-outline-primary</button>
25
29
  <button class="btn btn-outline-secondary btn-block">.btn-outline-secondary</button>
26
30
  <button class="btn btn-outline-offwhite btn-block">.btn-outline-offwhite</button>
27
31
  <button class="btn btn-outline-dark btn-block">.btn-outline-dark</button>
28
32
  <button class="btn btn-outline-extradark btn-block">.btn-outline-extradark</button>
33
+ <button class="btn btn-outline-sunset btn-block">.btn-outline-sunset</button>
34
+ <button class="btn btn-outline-accent btn-block">.btn-outline-accent</button>
35
+ <button class="btn btn-outline-join btn-block">.btn-outline-join</button>
36
+ <button class="btn btn-outline-donate btn-block">.btn-outline-donate</button>
29
37
  <a href="#" class="btn btn-outline-primary btn-block">Link as button</a>
30
38
  </div>
31
39
 
32
- <div class="col-md-4">
33
- <h4>Secondary palette</h4>
34
- <button class="btn btn-accent btn-block">.btn-accent</button>
35
- <button class="btn btn-join btn-block">.btn-join</button>
36
- <button class="btn btn-donate btn-block">.btn-donate</button>
37
- </div>
38
-
39
40
  </div>
40
41
 
41
42
  ```
@@ -52,9 +53,6 @@ input[type=button],
52
53
  button {
53
54
  &:not(.btn) {
54
55
  @extend .btn;
55
-
56
- text-transform: uppercase;
57
- font-weight: bold;
58
56
  }
59
57
  }
60
58
 
@@ -62,17 +60,9 @@ input[type=reset] {
62
60
  &:not(.btn) {
63
61
  @extend .btn;
64
62
  @extend .btn-danger;
65
-
66
- text-transform: uppercase;
67
- font-weight: bold;
68
63
  }
69
64
  }
70
65
 
71
- .btn:not(.btn-sm) {
72
- text-transform: uppercase;
73
- font-weight: bold;
74
- }
75
-
76
66
  @include media-breakpoint-down(sm) {
77
67
  .btn {
78
68
  font-size: .8rem;
@@ -180,10 +180,10 @@ textarea {
180
180
  background-color: transparent;
181
181
  background-position: center;
182
182
  background-repeat: no-repeat;
183
- border: 1px solid $foe-accent;
183
+ border: 2px solid $foe-accent;
184
184
  display: inline-block;
185
- width: 1.45em;
186
- height: 1.45em;
185
+ width: 1.5em;
186
+ height: 1.5em;
187
187
  padding: .5em;
188
188
  margin-right: $spacer/2;
189
189
  vertical-align: bottom;
@@ -15,6 +15,7 @@ Usage:
15
15
 
16
16
  */
17
17
 
18
+ import screenService from '../../utils/js/screen.service';
18
19
 
19
20
  // Enables smooth scrolling between anchors
20
21
  (($) => {
@@ -55,11 +56,17 @@ Usage:
55
56
  $target = $target.length ? $target : $(`[name="${hash.substr(1)}"]`);
56
57
 
57
58
  if ($target.length) {
58
- // Calculate headers
59
- const headerHeight = ($('.foe-header').length) ? $('.foe-header').height() : 0;
60
- const navHeight = ($('.foe-secondary-nav').length) ? $('.foe-secondary-nav').height() : 0;
61
- const paddingFromTop = 20;
62
- let finalScrollPosition = ($target.offset().top - (headerHeight + navHeight) - paddingFromTop);
59
+ // Header when scrolled is always compressed, unless if the page is at the very start
60
+ // if we grab the height at the start of the document, it will be bigger than what
61
+ // it will be when the header is compressed.
62
+
63
+ // Grab the value from our scss variables
64
+ const headerHeight = screenService.getHeaderHeight();
65
+
66
+ // See if the target specifies a scroll padding, useful for elements without an internal padding
67
+ const extraPadding = parseInt($target.attr('data-scroll-to-padding') || 20, 10);
68
+
69
+ let finalScrollPosition = ($target.offset().top - (headerHeight + extraPadding));
63
70
 
64
71
  // Compensate admin bars if user is logged in
65
72
  if ($('body').hasClass('user-logged-in')) {
package/src/fonts.js CHANGED
@@ -20,7 +20,7 @@ Our type system is comprised of two fonts:
20
20
  To use them on your CSS please import the webfonts through Google Fonts
21
21
 
22
22
  ```
23
- <link id="fonts" rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital@0;1&family=Libre+Franklin:ital,wght@0,400;0,700;1,400;1,700&display=swap" />
23
+ <link id="fonts" rel="stylesheet" crossorigin="anonymous" href="https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital@0;1&family=Libre+Franklin:ital,wght@0,400;0,700;1,400;1,700&display=swap" />
24
24
  ```
25
25
 
26
26
  @TODO: Document Fontawesome
@@ -130,6 +130,7 @@ const fonts = window.document.createElement('link');
130
130
  // eslint-disable-next-line max-len
131
131
  const href = 'https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital@0;1&family=Libre+Franklin:ital,wght@0,400;0,700;1,400;1,700&display=swap';
132
132
  fonts.setAttribute('rel', 'stylesheet');
133
+ fonts.setAttribute('crossorigin', 'anonymous');
133
134
  fonts.setAttribute('href', href);
134
135
  document.head.appendChild(fonts);
135
136
 
@@ -69,4 +69,14 @@ export default {
69
69
 
70
70
  return breakpoints[breakpointIndex].size;
71
71
  },
72
+
73
+ getHeaderHeight: function getHeaderHeight() {
74
+ const $ = window.jQuery;
75
+ const breakpoint = this.getCurrentBreakpoint();
76
+
77
+ if ($('.foe-header').length) {
78
+ return parseInt(scss[`foe-header-height-${breakpoint}`], 10);
79
+ }
80
+ return 0;
81
+ },
72
82
  };
@@ -13,4 +13,8 @@
13
13
  @each $screen, $size in $container-max-widths {
14
14
  container-#{$screen}: $size;
15
15
  }
16
+
17
+ @each $screen, $size in $foe-header-heights {
18
+ foe-header-height-#{$screen}: $size;
19
+ }
16
20
  }
@@ -13,6 +13,7 @@ $foe-light: #7ae1bd !default;
13
13
  $foe-secondary: $foe-light !default;
14
14
  $foe-dark: #3b867f !default;
15
15
  $foe-extradark: #232f4a !default;
16
+ $foe-sunset: #ea5c5c !default;
16
17
 
17
18
  $foe-white: #f3f3f7 !default;
18
19
  $foe-gray: #b1b8c0 !default;
@@ -200,6 +201,7 @@ $theme-colors: map-merge(
200
201
  "accent": $foe-accent,
201
202
  "dark": $foe-dark,
202
203
  "extradark": $foe-extradark,
204
+ "sunset": $foe-sunset,
203
205
  "donate": $foe-donate,
204
206
  "join": $foe-join,
205
207
  "offwhite": $foe-offwhite,
@@ -388,9 +390,9 @@ $line-height-sm: 1.5;
388
390
  $border-width: 1px;
389
391
  $border-color: $gray-300;
390
392
 
391
- $border-radius: .1rem;
392
- $border-radius-lg: .1rem;
393
- $border-radius-sm: .1rem;
393
+ $border-radius: .1rem * 3;
394
+ $border-radius-lg: .1rem * 4;
395
+ $border-radius-sm: .1rem * 2;
394
396
 
395
397
  $box-shadow-sm: 0 .125rem .25rem rgba($black, .075);
396
398
  $box-shadow: 0 .5rem 1rem rgba($black, .15);
@@ -423,7 +425,8 @@ $font-size-sm: ($font-size-base * .7);
423
425
 
424
426
  $font-weight-light: 300;
425
427
  $font-weight-normal: 400;
426
- $font-weight-bold: 700;
428
+ $font-weight-bold: 600;
429
+ $font-weight-heavy: 700;
427
430
 
428
431
  $font-weight-base: $font-weight-normal;
429
432
  $line-height-base: 1.5;
@@ -525,7 +528,7 @@ $input-btn-padding-x: .75rem;
525
528
  $input-btn-line-height: $line-height-base;
526
529
 
527
530
  $input-btn-focus-width: .2rem;
528
- $input-btn-focus-color: rgba($component-active-bg, .25);
531
+ $input-btn-focus-color: rgba($component-active-bg, .75);
529
532
  $input-btn-focus-box-shadow: 0 0 0 $input-btn-focus-width $input-btn-focus-color;
530
533
 
531
534
  $input-btn-padding-y-sm: .25rem;
@@ -557,7 +560,7 @@ $btn-line-height-lg: $input-btn-line-height-lg;
557
560
 
558
561
  $btn-border-width: $input-btn-border-width;
559
562
 
560
- $btn-font-weight: $font-weight-normal;
563
+ $btn-font-weight: $font-weight-bold;
561
564
  $btn-box-shadow: inset 0 1px 0 rgba($white, .15), 0 1px 1px rgba($black, .075);
562
565
  $btn-focus-width: $input-btn-focus-width;
563
566
  $btn-focus-box-shadow: $input-btn-focus-box-shadow;
@@ -1141,6 +1144,18 @@ $foe-nav-logo-height-medium: $foe-nav-height-medium*3/5;
1141
1144
  $foe-nav-logo-height-large: $foe-nav-height-large*3/5;
1142
1145
  $foe-nav-logo-height-large-scrolled: $foe-nav-height-large-scrolled*3/5; // Hence can be the same size of navbar when scrolled
1143
1146
 
1147
+ // Manually add in all header variants based on bootstrap-named breakpoints.
1148
+ // Likely prone to change in the Bootstrap 5+ refactor.
1149
+
1150
+ // @TODO / @REFACTOR / @BS5
1151
+ $foe-header-heights: (
1152
+ xs: $foe-nav-height-small,
1153
+ sm: $foe-nav-height-small,
1154
+ md: $foe-nav-height-medium,
1155
+ lg: $foe-nav-height-large-scrolled,
1156
+ xl: $foe-nav-height-large-scrolled,
1157
+ xxl: $foe-nav-height-large-scrolled
1158
+ );
1144
1159
 
1145
1160
  // CTA button
1146
1161
  $foe-nav-cta-height-small: 35px;