@moreonion/foundist 2.0.8 → 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.
Files changed (62) hide show
  1. package/README.md +1 -1
  2. package/package.json +7 -8
  3. package/src/html/basic-action-page-cover-1col.html +2 -2
  4. package/src/html/basic-action-page-cover-2col-reversed.html +2 -2
  5. package/src/html/basic-action-page-cover-2col.html +2 -2
  6. package/src/html/basic-action-page-cover-banner.html +2 -2
  7. package/src/html/basic-action-page-reversed.html +1 -1
  8. package/src/html/basic-action-page-with-banner-reversed.html +2 -2
  9. package/src/html/basic-action-page-with-banner.html +2 -2
  10. package/src/html/basic-action-page-with-callouts.html +1 -1
  11. package/src/html/basic-action-page.html +1 -1
  12. package/src/html/donation-action-page.html +1 -1
  13. package/src/html/e2t-action-page.html +1 -1
  14. package/src/html/includes/donate-form.html +3 -0
  15. package/src/html/includes/form-items/giftaid.html +16 -0
  16. package/src/html/includes/form-items/inline-radios.html +17 -0
  17. package/src/html/includes/form-items/payment-icons.html +19 -0
  18. package/src/html/includes/teaser.html +1 -1
  19. package/src/html/templates/action-page-cover-1col.html +2 -2
  20. package/src/html/templates/action-page-cover-2col-reversed.html +2 -2
  21. package/src/html/templates/action-page-cover-2col.html +2 -2
  22. package/src/html/templates/action-page-cover-banner.html +2 -2
  23. package/src/html/templates/action-page-reversed.html +2 -2
  24. package/src/html/templates/action-page-with-banner-reversed.html +2 -2
  25. package/src/html/templates/action-page-with-banner.html +2 -2
  26. package/src/html/templates/action-page.html +2 -2
  27. package/src/html/templates/static-page-cover-1col.html +2 -2
  28. package/src/html/templates/static-page-cover-2col.html +2 -2
  29. package/src/html/templates/static-page-cover-banner.html +2 -2
  30. package/src/html/templates/static-page-with-banner.html +2 -2
  31. package/src/html/templates/static-page.html +2 -2
  32. package/src/html/templates/teaser-page.html +2 -2
  33. package/src/html/thank-you-page-cover-1col.html +1 -1
  34. package/src/html/thank-you-page-cover-2col.html +1 -1
  35. package/src/html/thank-you-page-cover-banner.html +1 -1
  36. package/src/html/thank-you-page-with-banner.html +1 -1
  37. package/src/html/thank-you-page.html +1 -1
  38. package/src/html/typography-static-page.html +1 -1
  39. package/src/js/foundist.js +27 -11
  40. package/src/scss/_settings.scss +4 -1
  41. package/src/scss/_util.scss +4 -2
  42. package/src/scss/components/_accordion.scss +1 -1
  43. package/src/scss/components/_card.scss +3 -1
  44. package/src/scss/components/_cookiebar.scss +1 -1
  45. package/src/scss/components/_letter.scss +3 -1
  46. package/src/scss/components/_menu.scss +28 -28
  47. package/src/scss/components/_progressbar.scss +1 -1
  48. package/src/scss/components/_reveal.scss +5 -3
  49. package/src/scss/components/_settings.scss +18 -12
  50. package/src/scss/components/_share-button.scss +1 -1
  51. package/src/scss/components/_sticky-button.scss +4 -2
  52. package/src/scss/form/_braintree_apple_pay.scss +2 -0
  53. package/src/scss/form/_donation-amount-button.scss +7 -7
  54. package/src/scss/form/_e2t.scss +2 -0
  55. package/src/scss/form/_fields.scss +35 -1
  56. package/src/scss/form/_paymethod-select-button.scss +1 -4
  57. package/src/scss/form/_settings.scss +27 -19
  58. package/src/scss/layout/_cover.scss +11 -4
  59. package/src/scss/layout/_settings.scss +1 -1
  60. package/src/scss/main.scss +4 -0
  61. package/src/scss/typography/_elements.scss +1 -1
  62. package/src/scss/typography/_settings.scss +13 -4
@@ -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
  }
@@ -16,7 +16,10 @@ $breakpoints: (
16
16
  // Global Typography
17
17
  $base-font-size: 18 !default;
18
18
  $base-line-height: 24 !default;
19
- $global-font-size: $base-font-size / 16 * 100% !default;
19
+
20
+ // Set font size and breakpoint variables *before* importing utils!
21
+ // 6.25% = 100% / 16 (assumed browser default value)
22
+ $global-font-size: $base-font-size * 6.25% !default;
20
23
 
21
24
  // Global Colors
22
25
  $foundation-palette: (
@@ -2,6 +2,8 @@
2
2
  // - - - - - - - - - - - -
3
3
  // Functions and mixins for general use
4
4
 
5
+ @use "sass:color";
6
+
5
7
  /// Set text colors according to the background.
6
8
  ///
7
9
  /// If the background value passed to the mixin happens to not be (just) a color,
@@ -59,13 +61,13 @@
59
61
  &:focus {
60
62
  color: color-pick-contrast(
61
63
  $background,
62
- ($anchor-color-hover, scale-color($this-anchor-color, $lightness: -14%))
64
+ ($anchor-color-hover, color.scale($this-anchor-color, $lightness: -14%))
63
65
  );
64
66
  }
65
67
  &:active {
66
68
  color: color-pick-contrast(
67
69
  $background,
68
- ($anchor-color-active, scale-color($this-anchor-color, $lightness: 6%))
70
+ ($anchor-color-active, color.scale($this-anchor-color, $lightness: 6%))
69
71
  );
70
72
  }
71
73
  }
@@ -29,7 +29,7 @@
29
29
  position: absolute;
30
30
  left: rem-calc(get-side($accordion-item-padding, left));
31
31
  // The triangle is vertically centered in the title
32
- top: calc(50% - #{$accordion-triangle-size / 2});
32
+ top: calc(50% - #{$accordion-triangle-size * 0.5});
33
33
  }
34
34
  .is-active & {
35
35
  &:before {
@@ -2,6 +2,8 @@
2
2
  // - - - - - - - - - - - - - - -
3
3
  // Custom overrides for the card component
4
4
 
5
+ @use "sass:math";
6
+
5
7
  .card {
6
8
  position: relative;
7
9
  }
@@ -20,7 +22,7 @@
20
22
 
21
23
  // Meld card-sections into each other.
22
24
  .card-section + .card-section {
23
- padding-top: max(0, $global-padding - get-side($card-padding, bottom));
25
+ padding-top: math.max(0, $global-padding - get-side($card-padding, bottom));
24
26
  }
25
27
 
26
28
  // Move footer to the bottom of the card.
@@ -17,7 +17,7 @@
17
17
 
18
18
  // Some space between buttons.
19
19
  .button + .button {
20
- margin-#{$global-left}: $global-margin / 2;
20
+ margin-#{$global-left}: $global-margin * 0.5;
21
21
  }
22
22
 
23
23
  // Show button(s) next to text.
@@ -2,10 +2,12 @@
2
2
  // - - - - - - - - - - - - - - -
3
3
  // Adds a letter-like background to an element
4
4
 
5
+ @use "sass:color";
6
+
5
7
  $letter-background: $card-background !default;
6
8
  $letter-padding: (2 * $global-padding) (1.25 * $global-padding) !default;
7
9
  $letter-margin: 0 0 $global-margin 0 !default;
8
- $letter-shadow-color: scale-color(
10
+ $letter-shadow-color: color.scale(
9
11
  get-background-color($letter-background),
10
12
  $lightness: -60%,
11
13
  $alpha: -60%
@@ -35,8 +35,8 @@
35
35
  &:not(.simple) .button {
36
36
  margin-left: get-side($menu-items-padding, left);
37
37
  margin-right: get-side($menu-items-padding, right);
38
- margin-top: $form-spacing / 2;
39
- margin-bottom: $form-spacing / 2;
38
+ margin-top: $form-spacing * 0.5;
39
+ margin-bottom: $form-spacing * 0.5;
40
40
  width: 100%;
41
41
  }
42
42
 
@@ -66,10 +66,10 @@ $dropdown-menu-parent-border-radius: $select-radius !default;
66
66
  @include breakpoint(small down) {
67
67
  > li > a {
68
68
  padding: {
69
- top: get-side($dropdownmenu-padding, top) / 2;
70
- right: get-side($dropdownmenu-padding, right) / 2;
71
- bottom: get-side($dropdownmenu-padding, bottom) / 2;
72
- left: get-side($dropdownmenu-padding, left) / 2;
69
+ top: get-side($dropdownmenu-padding, top) * 0.5;
70
+ right: get-side($dropdownmenu-padding, right) * 0.5;
71
+ bottom: get-side($dropdownmenu-padding, bottom) * 0.5;
72
+ left: get-side($dropdownmenu-padding, left) * 0.5;
73
73
  }
74
74
  }
75
75
  }
@@ -89,14 +89,14 @@ $dropdown-menu-parent-border-radius: $select-radius !default;
89
89
  a {
90
90
  font-weight: $global-weight-normal;
91
91
  text-decoration: none;
92
- padding-top: rem-calc($base-line-height / 4);
93
- padding-bottom: rem-calc($base-line-height / 4);
92
+ padding-top: rem-calc($base-line-height * 0.25);
93
+ padding-bottom: rem-calc($base-line-height * 0.25);
94
94
  width: 100%;
95
95
 
96
96
  @include breakpoint(small down) {
97
97
  padding: {
98
- right: get-side($dropdownmenu-padding, right) / 2;
99
- left: get-side($dropdownmenu-padding, left) / 2;
98
+ right: get-side($dropdownmenu-padding, right) * 0.5;
99
+ left: get-side($dropdownmenu-padding, left) * 0.5;
100
100
  }
101
101
  }
102
102
 
@@ -154,7 +154,7 @@ $dropdown-menu-parent-border-radius: $select-radius !default;
154
154
 
155
155
  &:after {
156
156
  background-size: $dropdownmenu-arrow-size * 0.75;
157
- #{$global-right}: get-side($dropdownmenu-padding, $global-right) / 2;
157
+ #{$global-right}: get-side($dropdownmenu-padding, $global-right) * 0.5;
158
158
  }
159
159
  }
160
160
  }
@@ -165,7 +165,7 @@ $dropdown-menu-parent-border-radius: $select-radius !default;
165
165
  #{$global-right}: get-side($dropdownmenu-padding, $global-right);
166
166
 
167
167
  @include breakpoint(small down) {
168
- #{$global-right}: get-side($dropdownmenu-padding, $global-right) / 2;
168
+ #{$global-right}: get-side($dropdownmenu-padding, $global-right) * 0.5;
169
169
  }
170
170
  }
171
171
  }
@@ -184,11 +184,11 @@ $dropdown-menu-parent-border-radius: $select-radius !default;
184
184
  }
185
185
 
186
186
  @include breakpoint(small down) {
187
- padding-#{$global-right}: get-side($dropdownmenu-padding, $global-right) / 2;
187
+ padding-#{$global-right}: get-side($dropdownmenu-padding, $global-right) * 0.5;
188
188
  padding-left: $dropdownmenu-arrow-padding - get-side($dropdownmenu-padding, left);
189
189
 
190
190
  &:after {
191
- left: get-side($dropdownmenu-padding, left) / 2;
191
+ left: get-side($dropdownmenu-padding, left) * 0.5;
192
192
  }
193
193
  }
194
194
  }
@@ -207,11 +207,11 @@ $dropdown-menu-parent-border-radius: $select-radius !default;
207
207
  }
208
208
 
209
209
  @include breakpoint(small down) {
210
- padding-#{$global-right}: get-side($dropdownmenu-padding, $global-right) / 2;
210
+ padding-#{$global-right}: get-side($dropdownmenu-padding, $global-right) * 0.5;
211
211
  padding-right: $dropdownmenu-arrow-padding - get-side($dropdownmenu-padding, right);
212
212
 
213
213
  &:after {
214
- right: get-side($dropdownmenu-padding, right) / 2;
214
+ right: get-side($dropdownmenu-padding, right) * 0.5;
215
215
  }
216
216
  }
217
217
  }
@@ -244,27 +244,27 @@ $dropdown-menu-parent-border-radius: $select-radius !default;
244
244
  }
245
245
  // Add a bit more space between items.
246
246
  &:not(.vertical) {
247
- margin-top: -$form-spacing / 2;
248
- margin-bottom: -$form-spacing / 2;
247
+ margin-top: -$form-spacing * 0.5;
248
+ margin-bottom: -$form-spacing * 0.5;
249
249
  > li {
250
- margin-top: $form-spacing / 2;
251
- margin-bottom: $form-spacing / 2;
250
+ margin-top: $form-spacing * 0.5;
251
+ margin-bottom: $form-spacing * 0.5;
252
252
  }
253
253
  > li.is-dropdown-submenu-parent {
254
- margin-left: $form-spacing / 2;
255
- margin-right: $form-spacing / 2;
254
+ margin-left: $form-spacing * 0.5;
255
+ margin-right: $form-spacing * 0.5;
256
256
  }
257
257
  }
258
258
  &.vertical {
259
- margin-left: -$form-spacing / 2;
260
- margin-right: -$form-spacing / 2;
259
+ margin-left: -$form-spacing * 0.5;
260
+ margin-right: -$form-spacing * 0.5;
261
261
  > li {
262
- margin-left: $form-spacing / 2;
263
- margin-right: $form-spacing / 2;
262
+ margin-left: $form-spacing * 0.5;
263
+ margin-right: $form-spacing * 0.5;
264
264
  }
265
265
  > li.is-dropdown-submenu-parent {
266
- margin-top: $form-spacing / 2;
267
- margin-bottom: $form-spacing / 2;
266
+ margin-top: $form-spacing * 0.5;
267
+ margin-bottom: $form-spacing * 0.5;
268
268
  }
269
269
  }
270
270
  }
@@ -12,7 +12,7 @@
12
12
 
13
13
  // Smaller styles on teasers
14
14
  .teasers .card .progress-wrapper {
15
- margin-bottom: $global-margin / 2;
15
+ margin-bottom: $global-margin * 0.5;
16
16
 
17
17
  .progress {
18
18
  position: relative;
@@ -2,6 +2,8 @@
2
2
  // - - - - - - - - - - - - - - -
3
3
  // Custom overrides for the reveal component.
4
4
 
5
+ @use "sass:map";
6
+
5
7
  .reveal {
6
8
  @extend #form-outer;
7
9
  overflow: visible;
@@ -41,9 +43,9 @@
41
43
  // Make large close button smaller on small screens.
42
44
  .close-button.large {
43
45
  @include breakpoint(small down) {
44
- font-size: map-get($closebutton-size, medium);
45
- top: $global-margin / 8;
46
- #{$global-right}: $global-margin / 8;
46
+ font-size: map.get($closebutton-size, medium);
47
+ top: $global-margin * 0.125;
48
+ #{$global-right}: $global-margin * 0.125;
47
49
  }
48
50
  }
49
51
  }
@@ -1,8 +1,10 @@
1
1
  // Component settings
2
2
  // - - - - - - - - - - - - - - -
3
3
 
4
+ @use "sass:color";
5
+
4
6
  // Card
5
- $card-border: none;
7
+ $card-border: none !default;
6
8
  $card-padding: rem-calc($base-line-height * 0.75) 6% !default;
7
9
  $card-margin-bottom: rem-calc($base-line-height * 1.5) !default;
8
10
 
@@ -11,9 +13,9 @@ $progress-height: rem-calc(1.25 * $base-line-height) !default;
11
13
  $progress-background: $white !default;
12
14
  $progress-border-width: rem-calc(4) !default;
13
15
  $progress-border-color: $progress-background !default;
14
- $progress-margin-bottom: rem-calc($base-line-height / 2) !default;
16
+ $progress-margin-bottom: rem-calc($base-line-height * 0.5) !default;
15
17
  $progress-meter-background: get-color(secondary) !default;
16
- $progress-radius: rem-calc($base-line-height / 4) !default;
18
+ $progress-radius: rem-calc($base-line-height * 0.25) !default;
17
19
  $progress-thermometer-height: rem-calc(7.5 * $base-line-height) !default;
18
20
  $progress-thermometer-bulb-size: rem-calc(1.75 * $base-line-height) !default;
19
21
 
@@ -22,8 +24,9 @@ $recent-supporter-color: color-pick-contrast(
22
24
  get-background-color($body-background),
23
25
  ($dark-gray, $light-gray)
24
26
  ) !default;
27
+ $recent-supporter-time-color: $muted-font-color !default;
25
28
  $recent-supporter-border-color: if(
26
- lightness(get-background-color($body-background)) < 50,
29
+ color.lightness(get-background-color($body-background)) < 50,
27
30
  $dark-gray,
28
31
  $light-gray
29
32
  ) !default;
@@ -37,7 +40,7 @@ $callout-background: $card-background !default;
37
40
  $callout-background-fade: 0% !default;
38
41
  $callout-border: none !default;
39
42
  $callout-sizes: (
40
- small: rem-calc($base-line-height / 2),
43
+ small: rem-calc($base-line-height * 0.5),
41
44
  default: rem-calc($base-line-height),
42
45
  large: rem-calc($base-line-height * 1.5),
43
46
  ) !default;
@@ -52,7 +55,7 @@ $closebutton-size: (
52
55
  large: rem-calc($base-line-height * 1.75),
53
56
  ) !default;
54
57
  $closebutton-offset-horizontal: (
55
- small: rem-calc(-$base-line-height / 2),
58
+ small: rem-calc(-$base-line-height * 0.5),
56
59
  medium: rem-calc(-$base-line-height * 0.75),
57
60
  large: rem-calc(-$base-line-height),
58
61
  ) !default;
@@ -61,7 +64,7 @@ $closebutton-color: color-pick-contrast(
61
64
  $closebutton-background-color,
62
65
  ($light-gray, $dark-gray)
63
66
  ) !default;
64
- $closebutton-background-color-hover: scale-color(
67
+ $closebutton-background-color-hover: color.scale(
65
68
  $closebutton-background-color,
66
69
  $lightness: 6%
67
70
  ) !default;
@@ -103,7 +106,7 @@ $dropdown-menu-parent-border-color: $input-border-color !default;
103
106
  $dropdown-menu-parent-border-color-active: if(
104
107
  $dropdown-menu-parent-border-color == $input-border-color,
105
108
  $input-border-color-focus,
106
- scale-color($dropdown-menu-parent-border-color, $lightness: -10%)
109
+ color.scale($dropdown-menu-parent-border-color, $lightness: -10%)
107
110
  ) !default;
108
111
  $dropdown-menu-parent-border-width: $input-border-width !default;
109
112
  $dropdownmenu-border: (
@@ -111,12 +114,12 @@ $dropdownmenu-border: (
111
114
  ) !default;
112
115
  // stylelint-disable
113
116
  $dropdownmenu-padding: (
114
- ($dropdown-menu-item-height - $menu-item-font-size * $menu-item-line-height) / 2 -
117
+ ($dropdown-menu-item-height - $menu-item-font-size * $menu-item-line-height) * 0.5 -
115
118
  get-side($dropdown-menu-parent-border-width, top)
116
119
  )
117
120
  get-side($input-padding, right)
118
121
  (
119
- ($dropdown-menu-item-height - $menu-item-font-size * $menu-item-line-height) / 2 -
122
+ ($dropdown-menu-item-height - $menu-item-font-size * $menu-item-line-height) * 0.5 -
120
123
  get-side($dropdown-menu-parent-border-width, bottom)
121
124
  )
122
125
  get-side($input-padding, left) !default;
@@ -140,7 +143,7 @@ $accordion-item-background: transparent !default;
140
143
  $accordion-item-color: $body-font-color !default;
141
144
  $accordion-item-color-hover: $accordion-item-color !default;
142
145
  $accordion-item-padding: rem-calc($base-line-height) - $accordion-content-border-width !default;
143
- $accordion-margin: rem-calc($base-line-height / 2) !default;
146
+ $accordion-margin: rem-calc($base-line-height * 0.5) !default;
144
147
  $accordion-plusminus: false !default;
145
148
  $accordion-radius: rem-calc(5) !default;
146
149
  $accordion-separator: true !default;
@@ -168,5 +171,8 @@ $cookiebar-color: color-pick-contrast(
168
171
  get-background-color($cookiebar-background),
169
172
  ($body-font-color, $body-font-color-alt)
170
173
  ) !default;
171
- $cookiebar-padding: rem-calc($base-line-height) 0 0;
174
+ $cookiebar-padding: rem-calc($base-line-height) 0 0 !default;
172
175
  $cookiebar-flex-breakpoint: medium !default;
176
+
177
+ // Pagination
178
+ $pagination-item-color-disabled: $muted-font-color !default;
@@ -9,7 +9,7 @@ $share-button-max-width: 28rem !default;
9
9
  margin-bottom: 0.75 * $global-margin;
10
10
 
11
11
  // More horizontal padding.
12
- @include breakpoint(25rem * $global-font-size / 100) {
12
+ @include breakpoint(25rem * $global-font-size * 0.01) {
13
13
  padding-left: 2em;
14
14
  padding-right: 2em;
15
15
  }
@@ -3,15 +3,17 @@
3
3
  // Button that sticks to the edge of the screen.
4
4
  // Used in combination with the `StickyButton` plugin.
5
5
 
6
+ @use "sass:color";
7
+
6
8
  $sticky-cta-background: $form-background !default;
7
- $sticky-cta-boxshadow: 0 0 rem-calc(3) scale-color($black, $alpha: -75%) !default;
9
+ $sticky-cta-boxshadow: 0 0 rem-calc(3) color.scale($black, $alpha: -75%) !default;
8
10
  $sticky-button-max-width: 28rem !default;
9
11
 
10
12
  .sticky-cta {
11
13
  @include sticky-button;
12
14
  background: $sticky-cta-background;
13
15
  box-shadow: $sticky-cta-boxshadow;
14
- padding: $global-padding / 2;
16
+ padding: $global-padding * 0.5;
15
17
  padding-left: get-side($form-padding, left);
16
18
  padding-right: get-side($form-padding, right);
17
19
 
@@ -1,3 +1,5 @@
1
+ @use "sass:color";
2
+
1
3
  @supports (-webkit-appearance: -apple-pay-button) {
2
4
  .button.apple-pay {
3
5
  -webkit-appearance: -apple-pay-button;
@@ -12,6 +12,9 @@
12
12
  // button, as well as `.form-radios` and `.form-type-textfield` to distinguish
13
13
  // between radio buttons and the "other…" text field.
14
14
 
15
+ @use "sass:color";
16
+ @use "sass:math";
17
+
15
18
  // Base colors
16
19
  $donation-amount-background-color: transparent !default;
17
20
  $donation-amount-background-color-checked: $primary-color !default;
@@ -20,7 +23,7 @@ $donation-amount-text-color-checked: color-pick-contrast(
20
23
  ) !default;
21
24
 
22
25
  // Colors derived from base colors by default
23
- $donation-amount-border-color: scale-color(
26
+ $donation-amount-border-color: color.scale(
24
27
  $donation-amount-background-color-checked,
25
28
  $lightness: 50%,
26
29
  $saturation: -50%
@@ -35,9 +38,9 @@ $donation-amount-border-radius: 0 !default;
35
38
  $donation-amount-border-width: rem-calc(3) !default;
36
39
  $donation-amount-text-offset: $button-text-offset !default;
37
40
  // The padding is calculated like the $button-padding
38
- $donation-amount-button-padding: rem-calc(1.25 * $base-line-height / 2) -
41
+ $donation-amount-button-padding: rem-calc(1.25 * $base-line-height * 0.5) -
39
42
  $donation-amount-border-width + $donation-amount-text-offset 0
40
- rem-calc(1.25 * $base-line-height / 2) - $donation-amount-border-width -
43
+ rem-calc(1.25 * $base-line-height * 0.5) - $donation-amount-border-width -
41
44
  $donation-amount-text-offset !default;
42
45
 
43
46
  // Layout
@@ -57,10 +60,7 @@ $donation-amount-max-buttons-per-row: 3 !default;
57
60
  input[type="radio"]:not([value="select_or_other"]) {
58
61
  + label {
59
62
  @include button-base;
60
- @include button-hollow;
61
63
  @include button-expand;
62
- // button-style() and button-hollow-style() not used because we would
63
- // override them now anyways
64
64
 
65
65
  border-radius: $donation-amount-border-radius;
66
66
  text-align: center;
@@ -123,7 +123,7 @@ $donation-amount-max-buttons-per-row: 3 !default;
123
123
  // Flex children (form items)
124
124
  > .form-item {
125
125
  // Up to x buttons in 1 row.
126
- flex: 1 0 calc(#{100% / $donation-amount-max-buttons-per-row} - #{$form-spacing * 2});
126
+ flex: 1 0 calc(#{math.div(100%, $donation-amount-max-buttons-per-row)} - #{$form-spacing * 2});
127
127
  // Gutter of 2 * $form-spacing (flex margins do not collapse).
128
128
  margin: {
129
129
  left: $form-spacing;
@@ -26,6 +26,8 @@ form .email-to-target-target {
26
26
  top: $form-spacing * 3;
27
27
  bottom: $form-spacing * 3;
28
28
  }
29
+ // Allow long lines to break while preserving new lines.
30
+ white-space: pre-wrap;
29
31
  }
30
32
  // Fixes margins when multiple targets can be selected.
31
33
  .form-type-checkbox + .form-type-textfield {
@@ -3,7 +3,7 @@
3
3
 
4
4
  // Help texts margins
5
5
  .help-text {
6
- margin-top: -$form-spacing / 2;
6
+ margin-top: -$form-spacing * 0.5;
7
7
  margin-bottom: $form-spacing * 1.5;
8
8
 
9
9
  .form-error.is-visible + & {
@@ -49,3 +49,37 @@ input[type="radio"] + label {
49
49
  input.button.primary {
50
50
  margin-top: $form-spacing * 2;
51
51
  }
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
+
72
+ // Display radios, checkboxes etc. next to each other.
73
+ .form-item.inline {
74
+ &,
75
+ .form-radios,
76
+ .form-checkboxes {
77
+ display: flex;
78
+ flex-wrap: wrap;
79
+ column-gap: $global-margin;
80
+ }
81
+
82
+ > label {
83
+ flex-basis: 100%;
84
+ }
85
+ }
@@ -22,10 +22,7 @@ $paymethod-select-border-width: $input-border-width !default;
22
22
  + label {
23
23
  // Button styles
24
24
  @include button-base;
25
- @include button-hollow;
26
25
  @include button-expand;
27
- // button-style() and button-hollow-style() not used because we would
28
- // override them now anyways
29
26
 
30
27
  border-radius: $paymethod-select-border-radius;
31
28
  text-align: left;
@@ -62,7 +59,7 @@ $paymethod-select-border-width: $input-border-width !default;
62
59
 
63
60
  // These buttons are a bit tighter together
64
61
  .form-item & {
65
- margin-top: $form-spacing / 2;
62
+ margin-top: $form-spacing * 0.5;
66
63
  }
67
64
  }
68
65