@moreonion/foundist 2.1.0 → 2.1.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.
- package/package.json +5 -8
- package/src/html/includes/form-items/inline-radios.html +17 -0
- package/src/html/includes/form-items/payment-icons.html +19 -0
- package/src/scss/_util.scss +4 -2
- package/src/scss/components/_card.scss +3 -1
- package/src/scss/components/_letter.scss +3 -1
- package/src/scss/components/_reveal.scss +3 -1
- package/src/scss/components/_settings.scss +5 -3
- package/src/scss/components/_sticky-button.scss +3 -1
- package/src/scss/form/_braintree_apple_pay.scss +2 -0
- package/src/scss/form/_donation-amount-button.scss +2 -4
- package/src/scss/form/_e2t.scss +2 -0
- package/src/scss/form/_fields.scss +15 -0
- package/src/scss/form/_paymethod-select-button.scss +0 -3
- package/src/scss/form/_settings.scss +14 -10
- package/src/scss/layout/_cover.scss +7 -1
- package/src/scss/main.scss +2 -0
- package/src/scss/typography/_settings.scss +11 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moreonion/foundist",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.1",
|
|
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,15 +44,12 @@
|
|
|
44
44
|
"@linthtml/linthtml": "^0.8.0"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@moreonion/foundation-base": "2.1.
|
|
47
|
+
"@moreonion/foundation-base": "2.1.1",
|
|
48
48
|
"http-server": "^13.0.0",
|
|
49
49
|
"posthtml": "^0.16.5",
|
|
50
|
-
"posthtml-expressions": "^1.
|
|
51
|
-
"posthtml-extend": "
|
|
52
|
-
"posthtml-include": "^1.7.
|
|
53
|
-
},
|
|
54
|
-
"resolutions": {
|
|
55
|
-
"sass": "1.37.5"
|
|
50
|
+
"posthtml-expressions": "^1.9.0",
|
|
51
|
+
"posthtml-extend": "0.6.0",
|
|
52
|
+
"posthtml-include": "^1.7.2"
|
|
56
53
|
},
|
|
57
54
|
"lint-staged": {
|
|
58
55
|
"*.scss": [
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<div class="form-item inline extra-spacing">
|
|
2
|
+
<label for="radios-1">What is most important to you?</label>
|
|
3
|
+
<div id="radios" class="form-radios">
|
|
4
|
+
<div class="form-item form-type-radio">
|
|
5
|
+
<input type="radio" id="radios-1" name="radios" value="1" class="form-radio">
|
|
6
|
+
<label class="option" for="radios-1">Whales</label>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="form-item form-type-radio">
|
|
9
|
+
<input type="radio" id="radios-2" name="radios" value="2" class="form-radio">
|
|
10
|
+
<label class="option" for="radios-2">Pandas</label>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="form-item form-type-radio">
|
|
13
|
+
<input type="radio" id="radios-3" name="radios" value="2" class="form-radio">
|
|
14
|
+
<label class="option" for="radios-3">Bees</label>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<div class="form-item">
|
|
2
|
+
<div class="payment-icons">
|
|
3
|
+
<span class="secure-payment-icon"><span class="show-for-sr">Your payment is secure</span></span>
|
|
4
|
+
<span class="apple-pay-icon"><span class="show-for-sr">Apple Pay</span></span>
|
|
5
|
+
<span class="credit-card-icon"><span class="show-for-sr">Credit Card</span></span>
|
|
6
|
+
<span class="direct-debit-icon"><span class="show-for-sr">Direct Debit</span></span>
|
|
7
|
+
<span class="google-pay-icon"><span class="show-for-sr">Google Pay</span></span>
|
|
8
|
+
<span class="mastercard-icon"><span class="show-for-sr">Master Card</span></span>
|
|
9
|
+
<span class="paypal-icon"><span class="show-for-sr">PayPal</span></span>
|
|
10
|
+
<span class="paypal-pp-icon"><span class="show-for-sr">PayPal</span></span>
|
|
11
|
+
<span class="sage-pay-icon"><span class="show-for-sr">SagePay</span></span>
|
|
12
|
+
<span class="sepa-icon"><span class="show-for-sr">SEPA</span></span>
|
|
13
|
+
<span class="stripe-icon"><span class="show-for-sr">Stripe</span></span>
|
|
14
|
+
<span class="visa-icon"><span class="show-for-sr">VISA</span></span>
|
|
15
|
+
<span class="direct-debit-logo"><span class="show-for-sr">Direct Debit</span></span>
|
|
16
|
+
<span class="giftaid-logo"><span class="show-for-sr">Giftaid</span></span>
|
|
17
|
+
<span class="fr-regulator-logo"><span class="show-for-sr">Fundraising Regulator</span></span>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
package/src/scss/_util.scss
CHANGED
|
@@ -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
|
|
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
|
|
70
|
+
($anchor-color-active, color.scale($this-anchor-color, $lightness: 6%))
|
|
69
71
|
);
|
|
70
72
|
}
|
|
71
73
|
}
|
|
@@ -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.
|
|
@@ -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
|
|
10
|
+
$letter-shadow-color: color.scale(
|
|
9
11
|
get-background-color($letter-background),
|
|
10
12
|
$lightness: -60%,
|
|
11
13
|
$alpha: -60%
|
|
@@ -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,7 +43,7 @@
|
|
|
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
|
|
46
|
+
font-size: map.get($closebutton-size, medium);
|
|
45
47
|
top: $global-margin * 0.125;
|
|
46
48
|
#{$global-right}: $global-margin * 0.125;
|
|
47
49
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// Component settings
|
|
2
2
|
// - - - - - - - - - - - - - - -
|
|
3
3
|
|
|
4
|
+
@use "sass:color";
|
|
5
|
+
|
|
4
6
|
// Card
|
|
5
7
|
$card-border: none;
|
|
6
8
|
$card-padding: rem-calc($base-line-height * 0.75) 6% !default;
|
|
@@ -23,7 +25,7 @@ $recent-supporter-color: color-pick-contrast(
|
|
|
23
25
|
($dark-gray, $light-gray)
|
|
24
26
|
) !default;
|
|
25
27
|
$recent-supporter-border-color: if(
|
|
26
|
-
lightness(get-background-color($body-background)) < 50,
|
|
28
|
+
color.lightness(get-background-color($body-background)) < 50,
|
|
27
29
|
$dark-gray,
|
|
28
30
|
$light-gray
|
|
29
31
|
) !default;
|
|
@@ -61,7 +63,7 @@ $closebutton-color: color-pick-contrast(
|
|
|
61
63
|
$closebutton-background-color,
|
|
62
64
|
($light-gray, $dark-gray)
|
|
63
65
|
) !default;
|
|
64
|
-
$closebutton-background-color-hover: scale
|
|
66
|
+
$closebutton-background-color-hover: color.scale(
|
|
65
67
|
$closebutton-background-color,
|
|
66
68
|
$lightness: 6%
|
|
67
69
|
) !default;
|
|
@@ -103,7 +105,7 @@ $dropdown-menu-parent-border-color: $input-border-color !default;
|
|
|
103
105
|
$dropdown-menu-parent-border-color-active: if(
|
|
104
106
|
$dropdown-menu-parent-border-color == $input-border-color,
|
|
105
107
|
$input-border-color-focus,
|
|
106
|
-
scale
|
|
108
|
+
color.scale($dropdown-menu-parent-border-color, $lightness: -10%)
|
|
107
109
|
) !default;
|
|
108
110
|
$dropdown-menu-parent-border-width: $input-border-width !default;
|
|
109
111
|
$dropdownmenu-border: (
|
|
@@ -3,8 +3,10 @@
|
|
|
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
|
|
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 {
|
|
@@ -12,6 +12,7 @@
|
|
|
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";
|
|
15
16
|
@use "sass:math";
|
|
16
17
|
|
|
17
18
|
// Base colors
|
|
@@ -22,7 +23,7 @@ $donation-amount-text-color-checked: color-pick-contrast(
|
|
|
22
23
|
) !default;
|
|
23
24
|
|
|
24
25
|
// Colors derived from base colors by default
|
|
25
|
-
$donation-amount-border-color: scale
|
|
26
|
+
$donation-amount-border-color: color.scale(
|
|
26
27
|
$donation-amount-background-color-checked,
|
|
27
28
|
$lightness: 50%,
|
|
28
29
|
$saturation: -50%
|
|
@@ -59,10 +60,7 @@ $donation-amount-max-buttons-per-row: 3 !default;
|
|
|
59
60
|
input[type="radio"]:not([value="select_or_other"]) {
|
|
60
61
|
+ label {
|
|
61
62
|
@include button-base;
|
|
62
|
-
@include button-hollow;
|
|
63
63
|
@include button-expand;
|
|
64
|
-
// button-style() and button-hollow-style() not used because we would
|
|
65
|
-
// override them now anyways
|
|
66
64
|
|
|
67
65
|
border-radius: $donation-amount-border-radius;
|
|
68
66
|
text-align: center;
|
package/src/scss/form/_e2t.scss
CHANGED
|
@@ -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 {
|
|
@@ -49,3 +49,18 @@ input[type="radio"] + label {
|
|
|
49
49
|
input.button.primary {
|
|
50
50
|
margin-top: $form-spacing * 2;
|
|
51
51
|
}
|
|
52
|
+
|
|
53
|
+
// Display radios, checkboxes etc. next to each other.
|
|
54
|
+
.form-item.inline {
|
|
55
|
+
&,
|
|
56
|
+
.form-radios,
|
|
57
|
+
.form-checkboxes {
|
|
58
|
+
display: flex;
|
|
59
|
+
flex-wrap: wrap;
|
|
60
|
+
column-gap: $global-margin;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
> label {
|
|
64
|
+
flex-basis: 100%;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -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;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
// Form settings
|
|
2
2
|
// - - - - - - - - - - - - - - -
|
|
3
3
|
|
|
4
|
+
@use "sass:color";
|
|
5
|
+
@use "sass:map";
|
|
6
|
+
@use "sass:math";
|
|
7
|
+
|
|
4
8
|
// General
|
|
5
9
|
$form-padding: rem-calc($base-line-height) 6% rem-calc($base-line-height * 0.5) !default;
|
|
6
10
|
$form-spacing: rem-calc($base-line-height * 0.25) !default;
|
|
@@ -31,14 +35,14 @@ $button-border: $button-border-width solid transparent !default;
|
|
|
31
35
|
$button-padding: rem-calc($base-line-height * 0.625) - $button-border-width + $button-text-offset
|
|
32
36
|
1em rem-calc($base-line-height * 0.625) - $button-border-width - $button-text-offset !default;
|
|
33
37
|
$button-radius: 0.25rem !default;
|
|
34
|
-
$button-background: map
|
|
38
|
+
$button-background: map.get($button-palette, primary) !default;
|
|
35
39
|
$button-background-hover-lightness: 10% !default;
|
|
36
|
-
$button-background-hover: scale
|
|
40
|
+
$button-background-hover: color.scale(
|
|
37
41
|
$button-background,
|
|
38
42
|
$lightness: $button-background-hover-lightness
|
|
39
43
|
) !default;
|
|
40
|
-
$button-primary-shadow-color: scale
|
|
41
|
-
map
|
|
44
|
+
$button-primary-shadow-color: color.scale(
|
|
45
|
+
map.get($button-palette, primary),
|
|
42
46
|
$lightness: -15%,
|
|
43
47
|
$saturation: 20%
|
|
44
48
|
) !default;
|
|
@@ -61,10 +65,10 @@ $form-label-line-height: if(
|
|
|
61
65
|
$input-border-width: rem-calc(2) !default;
|
|
62
66
|
$input-border-color: if(
|
|
63
67
|
$input-background == $form-background,
|
|
64
|
-
scale
|
|
65
|
-
scale
|
|
68
|
+
color.scale($form-background, $lightness: -10%),
|
|
69
|
+
color.scale(get-background-color($form-background), $lightness: -5%)
|
|
66
70
|
) !default;
|
|
67
|
-
$input-border-color-focus: scale
|
|
71
|
+
$input-border-color-focus: color.scale($input-border-color, $lightness: -10%) !default;
|
|
68
72
|
$input-border: $input-border-width solid $input-border-color !default;
|
|
69
73
|
$input-border-focus: $input-border-width solid $input-border-color-focus !default;
|
|
70
74
|
$input-prefix-border: none !default;
|
|
@@ -76,7 +80,7 @@ $input-shadow-focus: inset 0 ($input-border-width * 0.5) $input-border-width $in
|
|
|
76
80
|
// Inputs
|
|
77
81
|
$input-background-focus: $input-background !default;
|
|
78
82
|
$input-font-size: 1rem !default;
|
|
79
|
-
$input-line-height: max(
|
|
83
|
+
$input-line-height: math.max(
|
|
80
84
|
grid-lineheight($input-font-size),
|
|
81
85
|
unitless-calc($base-line-height)
|
|
82
86
|
) !default;
|
|
@@ -163,9 +167,9 @@ $form-steps-font-color-alt: $body-font-color !default;
|
|
|
163
167
|
$form-steps-background-color: $medium-gray !default;
|
|
164
168
|
$form-steps-next-background-color: $light-gray !default;
|
|
165
169
|
// the previous step should be $dark-gray
|
|
166
|
-
// keeping it as a scale
|
|
170
|
+
// keeping it as a color.scale() relation, because of it should still be derived
|
|
167
171
|
// from the background color
|
|
168
|
-
$form-steps-previous-background-color: scale
|
|
172
|
+
$form-steps-previous-background-color: color.scale(
|
|
169
173
|
$form-steps-background-color,
|
|
170
174
|
$lightness: -46.5%
|
|
171
175
|
) !default;
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
// * cover-1col: The main content is displayed in a single column.
|
|
5
5
|
// * cover-2col: The main content is split into visual sections over 1-2 columns.
|
|
6
6
|
|
|
7
|
+
@use "sass:map";
|
|
8
|
+
|
|
7
9
|
$cover-background: $fallback-background !default;
|
|
8
10
|
$cover-content-box-shadow: none !default;
|
|
9
11
|
/// A value to subtract from the screen height to place the bottom edge of #top.
|
|
@@ -59,7 +61,7 @@ $cover-2col-offset: $global-margin * 5;
|
|
|
59
61
|
}
|
|
60
62
|
|
|
61
63
|
// Make .narrow smaller a little earlier, halfway between large and xlarge.
|
|
62
|
-
@include breakpoint((map
|
|
64
|
+
@include breakpoint((map.get($breakpoints, large) + map.get($breakpoints, xlarge)) * 0.5) {
|
|
63
65
|
~ section .grid-container.narrow {
|
|
64
66
|
> * {
|
|
65
67
|
grid-column: 3 / -3;
|
|
@@ -230,7 +232,11 @@ $cover-2col-offset: $global-margin * 5;
|
|
|
230
232
|
#background ~ #main > .grid-container {
|
|
231
233
|
// Make the first grid row almost as large as the screen
|
|
232
234
|
// (we don’t know how large the #header is, whether there are messages,…).
|
|
235
|
+
// ATM stylelint does not recognise pure CSS functions:
|
|
236
|
+
// https://github.com/stylelint-scss/stylelint-scss/issues/486
|
|
237
|
+
// stylelint-disable scss/no-global-function-names
|
|
233
238
|
grid-template-rows: min(calc(100vh - #{$cover-2col-offset}), 125vw) 1fr;
|
|
239
|
+
// stylelint-enable scss/no-global-function-names
|
|
234
240
|
// Show the top section at the bottom of this row.
|
|
235
241
|
#top {
|
|
236
242
|
margin-top: auto;
|
package/src/scss/main.scss
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
// - - - - - - - - - - - - - - -
|
|
3
3
|
// Expects $base-font-size and $global-font-size have already been set
|
|
4
4
|
|
|
5
|
+
@use "sass:color";
|
|
6
|
+
@use "sass:meta";
|
|
7
|
+
|
|
5
8
|
// Fonts
|
|
6
9
|
// see https://fontsarena.com/blog/operating-systems-default-sans-serif-fonts/
|
|
7
10
|
$body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Oxygen,
|
|
@@ -13,9 +16,13 @@ $global-weight-bold: bold !default;
|
|
|
13
16
|
$body-font-color: $black !default;
|
|
14
17
|
$body-font-color-alt: $white !default;
|
|
15
18
|
$title-color: get-color(primary) !default;
|
|
16
|
-
$header-color-even: if(
|
|
19
|
+
$header-color-even: if(
|
|
20
|
+
meta.variable-exists("header-color"),
|
|
21
|
+
$header-color,
|
|
22
|
+
$body-font-color
|
|
23
|
+
) !default;
|
|
17
24
|
$header-color-odd: if(
|
|
18
|
-
variable-exists("header-color"),
|
|
25
|
+
meta.variable-exists("header-color"),
|
|
19
26
|
$header-color,
|
|
20
27
|
get-color(secondary)
|
|
21
28
|
) !default;
|
|
@@ -70,8 +77,8 @@ $header-styles: (
|
|
|
70
77
|
) !default;
|
|
71
78
|
|
|
72
79
|
// Links
|
|
73
|
-
$anchor-color-hover: scale
|
|
74
|
-
$anchor-color-active: scale
|
|
80
|
+
$anchor-color-hover: color.scale($anchor-color, $lightness: -14%) !default;
|
|
81
|
+
$anchor-color-active: color.scale($anchor-color, $lightness: 6%) !default;
|
|
75
82
|
$anchor-text-decoration: underline !default;
|
|
76
83
|
$anchor-text-decoration-hover: underline !default;
|
|
77
84
|
|