@moreonion/foundist 2.1.2 → 2.1.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moreonion/foundist",
3
- "version": "2.1.2",
3
+ "version": "2.1.3",
4
4
  "description": "Foundation based default theme for Impact Stack landing pages.",
5
5
  "author": "More Onion <kontakt@more-onion.at>",
6
6
  "license": "MIT",
@@ -44,13 +44,16 @@
44
44
  "@linthtml/linthtml": "^0.8.0"
45
45
  },
46
46
  "dependencies": {
47
- "@moreonion/foundation-base": "2.1.2",
48
- "http-server": "^14.0.0",
47
+ "@moreonion/foundation-base": "2.1.3",
48
+ "http-server": "^14.1.0",
49
49
  "posthtml": "^0.16.5",
50
50
  "posthtml-expressions": "^1.9.0",
51
51
  "posthtml-extend": "0.6.0",
52
52
  "posthtml-include": "^1.7.2"
53
53
  },
54
+ "resolutions": {
55
+ "@parcel/transformer-css": "2.1.1"
56
+ },
54
57
  "lint-staged": {
55
58
  "*.scss": [
56
59
  "stylelint",
@@ -2,6 +2,7 @@
2
2
  <form method="post" accept-charset="UTF-8" novalidate="novalidate">
3
3
  <include src="form-items/donation-interval.html"></include>
4
4
  <include src="form-items/donation-amount.html"></include>
5
+ <include src="form-items/giftaid.html"></include>
5
6
  <br>
6
7
  <include src="form-items/paymethod-selector.html"></include>
7
8
 
@@ -0,0 +1,16 @@
1
+ <fieldset class="form-wrapper fieldset giftaid">
2
+ <div class="fieldset-wrapper">
3
+ <div class="form-item">
4
+ <p><strong>Increase your donation by 25%</strong> without additional cost to you by ticking the box below</p>
5
+ </div>
6
+ <div class="form-item extra-spacing">
7
+ <div class="form-item form-type-checkbox">
8
+ <input type="checkbox" id="giftaid-checkbox" name="giftaid-checkbox" value="1" class="form-checkbox">
9
+ <label class="option" for="giftaid-checkbox"><span>I am a UK tax payer and I want you to claim Gift Aid on my donation*</span></label>
10
+ </div>
11
+ </div>
12
+ <div class="form-item">
13
+ <p class="small muted">* This is the small print that you may want to add to your giftaid field but it’s really optional.</p>
14
+ </div>
15
+ </div>
16
+ </fieldset>
@@ -37,8 +37,10 @@ Foundation.plugin(SelectTwo, 'SelectTwo')
37
37
  Foundation.plugin(StickyButton, 'StickyButton')
38
38
  Foundation.plugin(ToggleElement, 'ToggleElement')
39
39
 
40
- // Let foundation initialize the initial markup
41
- // This needs to be done for dynamically loaded markup too (e.g. AJAX markup)
40
+ /**
41
+ * Let foundation initialize the initial markup.
42
+ * This needs to be done for dynamically loaded markup too (e.g. AJAX markup)
43
+ */
42
44
  export function initFoundation () {
43
45
  initEventBridge($)
44
46
  if (typeof Drupal !== 'undefined') {
@@ -56,8 +58,12 @@ export function initFoundation () {
56
58
  }
57
59
  }
58
60
 
59
- // Activate AdaptiveSticky on forms in the sidebar.
60
- export function stickyForm () {
61
+ /**
62
+ * Activate AdaptiveSticky on forms in the sidebar.
63
+ * @param {object} options - Overrides to the AdaptiveSticky plugin settings.
64
+ * @returns {AdaptiveSticky|undefined} The initialized AdaptiveSticky plugin
65
+ */
66
+ export function stickyForm (options = {}) {
61
67
  const $form = $('#sidebar form, #sidebar .share-buttons')
62
68
  if (!$form.length) {
63
69
  return
@@ -69,12 +75,17 @@ export function stickyForm () {
69
75
  return new Foundation.AdaptiveSticky($sidebar.children('.sticky'), {
70
76
  target: '#form-outer form, #form-outer .share-buttons ul',
71
77
  offset: $('#form-outer').css('padding-top'),
72
- mediaQuery: 'large'
78
+ mediaQuery: 'large',
79
+ ...options
73
80
  })
74
81
  }
75
82
 
76
- // Activate StickyButton on CTA markup snippet.
77
- export function stickyButton () {
83
+ /**
84
+ * Activate StickyButton on CTA markup snippet.
85
+ * @param {object} options - Overrides to the StickyButton plugin settings.
86
+ * @returns {StickyButton[]|undefined} Array of initialized StickyButton plugins
87
+ */
88
+ export function stickyButton (options = {}) {
78
89
  let $cta = $('.sticky-cta')
79
90
  if (!$cta.length) {
80
91
  return
@@ -97,13 +108,18 @@ export function stickyButton () {
97
108
  return $cta.map((i, el) => {
98
109
  return new Foundation.StickyButton($(el), {
99
110
  blocker: target,
100
- topOverlap: 0.3
111
+ topOverlap: 0.3,
112
+ ...options
101
113
  })
102
114
  })
103
115
  }
104
116
 
105
- // Activate cookiebar on cookiebar id.
106
- export function cookiebar () {
117
+ /**
118
+ * Activate cookiebar on cookiebar id.
119
+ * @param {object} options - Overrides to the Cookiebar plugin settings.
120
+ * @returns {Cookiebar|undefined} The initialized Cookiebar plugin
121
+ */
122
+ export function cookiebar (options = {}) {
107
123
  const $cookiebar = $('#cookiebar')
108
124
  if (!$cookiebar.length) {
109
125
  return
@@ -111,5 +127,5 @@ export function cookiebar () {
111
127
  // Put cookiebar in right position.
112
128
  $cookiebar.detach().appendTo('body')
113
129
  // Initialize plugin
114
- return new Foundation.CookieBar($cookiebar)
130
+ return new Foundation.CookieBar($cookiebar, options)
115
131
  }
@@ -4,7 +4,7 @@
4
4
  @use "sass:color";
5
5
 
6
6
  // Card
7
- $card-border: none;
7
+ $card-border: none !default;
8
8
  $card-padding: rem-calc($base-line-height * 0.75) 6% !default;
9
9
  $card-margin-bottom: rem-calc($base-line-height * 1.5) !default;
10
10
 
@@ -24,6 +24,7 @@ $recent-supporter-color: color-pick-contrast(
24
24
  get-background-color($body-background),
25
25
  ($dark-gray, $light-gray)
26
26
  ) !default;
27
+ $recent-supporter-time-color: $muted-font-color !default;
27
28
  $recent-supporter-border-color: if(
28
29
  color.lightness(get-background-color($body-background)) < 50,
29
30
  $dark-gray,
@@ -170,5 +171,8 @@ $cookiebar-color: color-pick-contrast(
170
171
  get-background-color($cookiebar-background),
171
172
  ($body-font-color, $body-font-color-alt)
172
173
  ) !default;
173
- $cookiebar-padding: rem-calc($base-line-height) 0 0;
174
+ $cookiebar-padding: rem-calc($base-line-height) 0 0 !default;
174
175
  $cookiebar-flex-breakpoint: medium !default;
176
+
177
+ // Pagination
178
+ $pagination-item-color-disabled: $muted-font-color !default;
@@ -50,6 +50,25 @@ input.button.primary {
50
50
  margin-top: $form-spacing * 2;
51
51
  }
52
52
 
53
+ // Margins for giftaid fields.
54
+ .giftaid {
55
+ margin-top: $form-spacing * 2;
56
+ margin-bottom: $form-spacing * 2;
57
+
58
+ .extra-spacing {
59
+ margin-top: 0;
60
+ margin-bottom: 0;
61
+ }
62
+
63
+ .form-item > div:first-child,
64
+ .form-item > label.show-for-sr + div,
65
+ .form-item > label.element-invisible + div {
66
+ input[type="checkbox"] + label {
67
+ margin-top: 0;
68
+ }
69
+ }
70
+ }
71
+
53
72
  // Display radios, checkboxes etc. next to each other.
54
73
  .form-item.inline {
55
74
  &,
@@ -89,7 +89,7 @@ $input-height: rem-calc(2 * $base-line-height) !default;
89
89
  $input-padding: (
90
90
  rem-calc(($input-height - $input-line-height * $input-font-size) * 0.5) - $input-border-width
91
91
  ) 1rem !default;
92
- $input-placeholder-color: $medium-gray !default;
92
+ $input-placeholder-color: $muted-font-color !default;
93
93
  $input-prefix-color: $form-label-color !default;
94
94
  $input-prefix-padding: 1em !default;
95
95
 
@@ -110,7 +110,7 @@ $radio-label-font-weight: $global-weight-normal !default;
110
110
  // Files
111
111
  $file-upload-font-size: $small-font-size !default;
112
112
  $file-upload-padding: $form-spacing * 2 !default;
113
- $file-upload-help-color: $medium-gray !default;
113
+ $file-upload-help-color: $muted-font-color !default;
114
114
 
115
115
  // Help texts
116
116
  $helptext-color: $form-label-color !default;
@@ -177,5 +177,6 @@ $form-steps-previous-background-color: color.scale(
177
177
  // AJAX loading throbber
178
178
  $loader-color: get-color(primary) !default;
179
179
 
180
- // Payment icons
180
+ // Donation forms
181
181
  $payment-icon-color: $form-label-color !default;
182
+ $giftaid-checkbox-size: rem-calc($base-line-height * 1.5) !default;
@@ -52,7 +52,8 @@ $cover-2col-offset: $global-margin * 5;
52
52
  right: 0;
53
53
  bottom: 0;
54
54
  left: 0;
55
- height: auto;
55
+ // Required to keep a constant height in mobile browsers with (dis)appearing menus
56
+ height: 100vh;
56
57
  }
57
58
 
58
59
  // Remove title padding
@@ -89,6 +89,7 @@
89
89
  @include mo-share-button;
90
90
  @include mo-drupal-ajax-loading;
91
91
  @include mo-payment-icons;
92
+ @include mo-giftaid;
92
93
  @include mo-cookiebar;
93
94
 
94
95
  @import "form/forms";
@@ -15,6 +15,7 @@ $global-weight-bold: bold !default;
15
15
  // Colors
16
16
  $body-font-color: $black !default;
17
17
  $body-font-color-alt: $white !default;
18
+ $muted-font-color: $medium-gray !default;
18
19
  $title-color: get-color(primary) !default;
19
20
  $header-color-even: if(
20
21
  meta.variable-exists("header-color"),
@@ -27,6 +28,7 @@ $header-color-odd: if(
27
28
  get-color(secondary)
28
29
  ) !default;
29
30
  $header-color-alt: $body-font-color-alt !default;
31
+ $header-small-font-color: $muted-font-color !default;
30
32
  $anchor-color: get-color(primary) !default;
31
33
  $blockquote-color: get-color(primary) !default;
32
34