@moreonion/foundist 3.5.0 → 3.6.0

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/README.md CHANGED
@@ -22,8 +22,8 @@ the desired result)!
22
22
 
23
23
  The setup should give you a quite modern JS/SCSS-environment:
24
24
  - Vite (with SCSS, browserlist, PostCSS)
25
- - Linting (`stylelint`, `eslint`)
26
- - Prettifying (`prettify`)
25
+ - Linting (`stylelint`, `oxlint`)
26
+ - Prettifying (`prettify`, `oxfmt`)
27
27
  - Pre-commit hooks for `.scss` and `.js` files
28
28
 
29
29
  The entrypoints are at:
@@ -80,5 +80,5 @@ There is a basic settings file provided.
80
80
  You might want to install the following VS Code plugins (or re-enable the build in formatters):
81
81
 
82
82
  - Prettier - Code formatter `esbenp.prettier-vscode` <https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode>
83
- - ESLint `dbaeumer.vscode-eslint` <https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint>
84
83
  - stylelint `shinnn.stylelint` <https://marketplace.visualstudio.com/items?itemName=shinnn.stylelint>
84
+ - OXC `oxc.oxc-vscode` <https://marketplace.visualstudio.com/items?itemName=oxc.oxc-vscode>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moreonion/foundist",
3
- "version": "3.5.0",
3
+ "version": "3.6.0",
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",
@@ -18,36 +18,33 @@
18
18
  "build": "vite build",
19
19
  "preview": "vite preview",
20
20
  "lint:css": "stylelint src/scss && prettier --check 'src/scss/**/*.scss'",
21
- "lint:js": "eslint src",
21
+ "lint:js": "oxlint src/js && oxfmt --check src/js",
22
22
  "lint": "yarn run lint:css && yarn run lint:js",
23
23
  "fix:css": "stylelint --fix src/scss && prettier --write 'src/scss/**/*.scss'",
24
- "fix:js": "eslint --fix src",
24
+ "fix:js": "oxfmt src/js && oxlint --fix src/js",
25
25
  "fix": "yarn run fix:css && yarn run fix:js",
26
26
  "prepare": "husky"
27
27
  },
28
28
  "dependencies": {
29
- "@moreonion/foundation-base": "3.5.0",
29
+ "@moreonion/foundation-base": "3.6.0",
30
30
  "foundation-sites": "6.9.0",
31
- "jquery": "^3.7.0",
32
- "sass-embedded": "^1.89.0",
33
- "select2": "^4.1.0-rc.0"
31
+ "jquery": "^4.0.0",
32
+ "sass-embedded": "^1.100.0",
33
+ "select2": "^4.1.0"
34
34
  },
35
35
  "devDependencies": {
36
- "autoprefixer": "^10.4.20",
37
- "eslint": "8.57.0",
38
- "eslint-config-standard": "^17.1.0",
39
- "eslint-plugin-import": "^2.31.0",
40
- "eslint-plugin-n": "^16.6.0",
41
- "eslint-plugin-promise": "^6.6.0",
36
+ "autoprefixer": "^10.5.0",
42
37
  "husky": "^9.1.0",
43
- "lint-staged": "^16.1.0",
38
+ "lint-staged": "^17.0.0",
39
+ "oxfmt": "^0.57.0",
40
+ "oxlint": "^1.72.0",
44
41
  "postcss": "^8.5.0",
45
- "prettier": "^3.6.0",
46
- "stylelint": "^16.21.0",
42
+ "prettier": "^3.9.0",
43
+ "stylelint": "^17.14.0",
47
44
  "stylelint-config-idiomatic-order": "^10.0.0",
48
- "stylelint-config-recommended-scss": "^15.0.0",
49
- "stylelint-scss": "^6.12.0",
50
- "vite": "^7.0.0",
45
+ "stylelint-config-recommended-scss": "^17.0.0",
46
+ "stylelint-scss": "^7.2.0",
47
+ "vite": "^8.0.0",
51
48
  "vite-plugin-nunjucks": "^0.2.0"
52
49
  },
53
50
  "lint-staged": {
@@ -56,8 +53,9 @@
56
53
  "prettier --check"
57
54
  ],
58
55
  "*.js": [
59
- "eslint"
56
+ "oxlint",
57
+ "oxfmt"
60
58
  ]
61
59
  },
62
- "packageManager": "yarn@4.9.2"
60
+ "packageManager": "yarn@4.16.0"
63
61
  }
@@ -1,16 +1,16 @@
1
1
  <div class="form-steps-wrapper">
2
- <div class="form-steps webform-progressbar" data-form-steps-total="3" data-form-steps-current="2">
3
- <div class="step webform-progressbar-page previous first clickable" data-form-step-number="1">
2
+ <nav class="form-steps" data-form-steps-total="3" data-form-steps-current="2">
3
+ <button class="step previous first clickable" data-form-step-number="1">
4
4
  <span class="step-number">1</span>
5
5
  <span class="step-label">Data</span>
6
- </div>
7
- <div class="step webform-progressbar-page current" data-form-step-number="2">
6
+ </button>
7
+ <button class="step current" data-form-step-number="2">
8
8
  <span class="step-number">2</span>
9
9
  <span class="step-label">Message</span>
10
- </div>
11
- <div class="step webform-progressbar-page last" data-form-step-number="3">
10
+ </button>
11
+ <button class="step last" data-form-step-number="3">
12
12
  <span class="step-number">3</span>
13
13
  <span class="step-label">Another form step</span>
14
- </div>
15
- </div>
14
+ </button>
15
+ </nav>
16
16
  </div>
package/src/js/example.js CHANGED
@@ -1,9 +1,4 @@
1
- import {
2
- initFoundation,
3
- stickyForm,
4
- stickyButton,
5
- cookiebar
6
- } from './foundist'
1
+ import { initFoundation, stickyForm, stickyButton, cookiebar } from './foundist'
7
2
 
8
3
  // Initialize Foundation
9
4
  ;(() => {
@@ -1,19 +1,5 @@
1
1
  /* global Drupal */
2
2
 
3
- // Ensure $ is available: Foundation and select2 need to bind to it
4
- import $ from 'jquery'
5
- import select2 from 'select2'
6
-
7
- /* eslint-disable no-unused-vars */
8
- import {
9
- Accordion,
10
- Foundation,
11
- Reveal,
12
- SmoothScroll,
13
- Toggler
14
- } from 'foundation-sites/js/foundation'
15
- /* eslint-enable no-unused-vars */
16
-
17
3
  import {
18
4
  AdaptiveSticky,
19
5
  CookieBar,
@@ -26,6 +12,18 @@ import {
26
12
  UserAgent,
27
13
  initEventBridge,
28
14
  } from '@moreonion/foundation-base'
15
+ /* eslint-disable no-unused-vars */
16
+ import {
17
+ Accordion,
18
+ Foundation,
19
+ Reveal,
20
+ SmoothScroll,
21
+ Toggler,
22
+ } from 'foundation-sites/js/foundation'
23
+ // Ensure $ is available: Foundation and select2 need to bind to it
24
+ import $ from 'jquery'
25
+ /* eslint-enable no-unused-vars */
26
+ import select2 from 'select2'
29
27
 
30
28
  // Add the select2 to jQuery
31
29
  // Needed for SelectTwo plugin
@@ -49,11 +47,11 @@ Foundation.plugin(UserAgent, 'UserAgent')
49
47
  * Let foundation initialize the initial markup.
50
48
  * This needs to be done for dynamically loaded markup too (e.g. AJAX markup)
51
49
  */
52
- export function initFoundation () {
50
+ export function initFoundation() {
53
51
  initEventBridge($)
54
52
  if (typeof Drupal !== 'undefined') {
55
53
  Drupal.behaviors.foundist_initialize = {}
56
- Drupal.behaviors.foundist_initialize.attach = (context, settings) => {
54
+ Drupal.behaviors.foundist_initialize.attach = (context) => {
57
55
  $(context).foundation()
58
56
  // Show overlays with `data-open` initially.
59
57
  const $overlay = $('[data-reveal][data-open]')
@@ -71,10 +69,11 @@ export function initFoundation () {
71
69
 
72
70
  /**
73
71
  * Activate AdaptiveSticky on forms in the sidebar.
72
+ *
74
73
  * @param {object} options - Overrides to the AdaptiveSticky plugin settings.
75
- * @returns {AdaptiveSticky|undefined} The initialized AdaptiveSticky plugin
74
+ * @returns {AdaptiveSticky | undefined} The initialized AdaptiveSticky plugin
76
75
  */
77
- export function stickyForm (options = {}) {
76
+ export function stickyForm(options = {}) {
78
77
  const $form = $('#sidebar #form, #sidebar .share-buttons')
79
78
  if (!$form.length) {
80
79
  return
@@ -87,22 +86,23 @@ export function stickyForm (options = {}) {
87
86
  target: '#form-outer #form, #form-outer .share-buttons ul',
88
87
  offset: $('#form-outer').css('padding-top'),
89
88
  mediaQuery: 'large',
90
- ...options
89
+ ...options,
91
90
  })
92
91
  }
93
92
 
94
93
  /**
95
94
  * Activate StickyButton on CTA markup snippet.
95
+ *
96
96
  * @param {object} options - Overrides to the StickyButton plugin settings.
97
- * @returns {StickyButton[]|undefined} Array of initialized StickyButton plugins
97
+ * @returns {StickyButton[] | undefined} Array of initialized StickyButton plugins
98
98
  */
99
- export function stickyButton (options = {}) {
99
+ export function stickyButton(options = {}) {
100
100
  let $cta = $('.sticky-cta')
101
101
  if (!$cta.length) {
102
102
  return
103
103
  }
104
104
  const defaults = {
105
- topOverlap: 0.3
105
+ topOverlap: 0.3,
106
106
  }
107
107
  // Find blocking element
108
108
  const target = $cta.find('a').attr('href')
@@ -128,17 +128,18 @@ export function stickyButton (options = {}) {
128
128
  return $cta.map((i, el) => {
129
129
  return new Foundation.StickyButton($(el), {
130
130
  ...defaults,
131
- ...options
131
+ ...options,
132
132
  })
133
133
  })
134
134
  }
135
135
 
136
136
  /**
137
137
  * Activate cookiebar on cookiebar id.
138
+ *
138
139
  * @param {object} options - Overrides to the Cookiebar plugin settings.
139
- * @returns {Cookiebar|undefined} The initialized Cookiebar plugin
140
+ * @returns {CookieBar | undefined} The initialized Cookiebar plugin
140
141
  */
141
- export function cookiebar (options = {}) {
142
+ export function cookiebar(options = {}) {
142
143
  const $cookiebar = $('#cookiebar')
143
144
  if (!$cookiebar.length) {
144
145
  return
@@ -12,35 +12,47 @@
12
12
  color: $accordion-item-color;
13
13
  background: $accordion-item-background;
14
14
  text-decoration: none;
15
- // Space for the triangle
16
- padding-left: rem-calc(get-side($accordion-item-padding, left)) + 2 * $accordion-triangle-size;
17
15
 
18
- // Triangle to signal a dropdown
19
- &:before {
20
- width: $accordion-triangle-size;
21
- height: $accordion-triangle-size;
22
- background-size: $accordion-triangle-size;
23
- background-repeat: no-repeat;
24
- content: "";
25
- display: inline-block;
26
- transform: rotate(-90deg);
27
- transition: transform 0.1s ease-in-out;
28
- position: absolute;
29
- left: rem-calc(get-side($accordion-item-padding, left));
30
- // The triangle is vertically centered in the title
31
- top: calc(50% - #{$accordion-triangle-size * 0.5});
32
-
33
- @include background-triangle($accordion-triangle-color);
16
+ &:hover,
17
+ &:focus {
18
+ color: $accordion-item-color-hover;
34
19
  }
35
- .is-active & {
20
+
21
+ @if ($accordion-has-arrow == true) {
22
+ // Space for the triangle
23
+ $padding: rem-calc(get-side($accordion-item-padding, $accordion-arrow-position));
24
+ padding-#{$accordion-arrow-position}: $padding + 2 * $accordion-triangle-size;
25
+
26
+ // Triangle to signal a dropdown
36
27
  &:before {
37
- transform: rotate(0deg);
28
+ width: $accordion-triangle-size;
29
+ height: $accordion-triangle-size;
30
+ background-size: $accordion-triangle-size;
31
+ background-repeat: no-repeat;
32
+ content: "";
33
+ display: inline-block;
34
+ transform: rotate(-90deg);
35
+ transition: transform 0.1s ease-in-out;
36
+ position: absolute;
37
+ #{$accordion-arrow-position}: $padding;
38
+ // The triangle is vertically centered in the title
39
+ top: calc(50% - #{$accordion-triangle-size * 0.5});
40
+
41
+ @include background-triangle($accordion-triangle-color);
42
+ }
43
+ .is-active & {
44
+ &:before {
45
+ transform: rotate(0deg);
46
+ }
38
47
  }
39
48
  }
40
49
 
41
- &:hover,
42
- &:focus {
43
- color: $accordion-item-color-hover;
50
+ @if ($accordion-plusminus == true) {
51
+ // Center plus/minus
52
+ &:before {
53
+ line-height: 1;
54
+ margin-top: -0.5em;
55
+ }
44
56
  }
45
57
  }
46
58
 
@@ -5,14 +5,12 @@
5
5
  @use "sass:meta";
6
6
 
7
7
  $bottom-section-background-odd: if(
8
- meta.variable-exists("bottom-section-background"),
9
- $bottom-section-background,
10
- $form-background
8
+ sass(meta.variable-exists("bottom-section-background")): $bottom-section-background;
9
+ else: $form-background
11
10
  ) !default;
12
11
  $bottom-section-background-even: if(
13
- meta.variable-exists("bottom-section-background"),
14
- $bottom-section-background,
15
- $body-background
12
+ sass(meta.variable-exists("bottom-section-background")): $bottom-section-background;
13
+ else: $body-background
16
14
  ) !default;
17
15
  $bottom-section-background-image-overlay: rgba($black, 0.3);
18
16
 
@@ -26,9 +26,10 @@ $headline-font-size: 2 * $large-font-size !default;
26
26
  /// @type Color
27
27
  $headline-color: color-pick-contrast(
28
28
  if(
29
- $headline-background and $headline-background != none,
30
- get-background-color($headline-background),
31
- get-background-color($fallback-background)
29
+ sass($headline-background and $headline-background != none): get-background-color(
30
+ $headline-background
31
+ );
32
+ else: get-background-color($fallback-background)
32
33
  ),
33
34
  ($title-color, $body-font-color-alt, $body-font-color),
34
35
  6
@@ -8,9 +8,8 @@ $letter-signature-image-margin: 0 0 (0.5 * $global-margin) !default;
8
8
  $letter-counter-font-family: $header-font-family !default;
9
9
  $letter-counter-font-size: $large-font-size !default;
10
10
  $letter-counter-line-height: if(
11
- $letter-counter-font-size == $large-font-size,
12
- $large-lineheight,
13
- grid-lineheight($letter-counter-font-size)
11
+ sass($letter-counter-font-size == $large-font-size): $large-lineheight;
12
+ else: grid-lineheight($letter-counter-font-size)
14
13
  ) !default;
15
14
  $letter-counter-font-weight: $global-weight-bold !default;
16
15
 
@@ -16,22 +16,18 @@ $mobile-menu-align-content: flex-start !default;
16
16
  // Mobile menu items
17
17
  $mobile-menu-item-font-size: $large-font-size !default;
18
18
  $mobile-menu-item-line-height: if(
19
- $mobile-menu-item-font-size == $large-font-size,
20
- $large-lineheight,
21
- grid-lineheight($mobile-menu-item-font-size)
19
+ sass($mobile-menu-item-font-size == $large-font-size): $large-lineheight;
20
+ else: grid-lineheight($mobile-menu-item-font-size)
22
21
  ) !default;
23
22
  $mobile-menu-item-font-weight: $global-weight-bold !default;
24
23
  $mobile-menu-item-color: $menu-item-color !default;
25
24
  $mobile-menu-item-color-hover: if(
26
- $mobile-menu-item-color == $menu-item-color,
27
- $menu-item-color-hover,
28
- $mobile-menu-item-color
25
+ sass($mobile-menu-item-color == $menu-item-color): $menu-item-color-hover;
26
+ else: $mobile-menu-item-color
29
27
  ) !default;
30
28
  $mobile-menu-item-decoration-hover: $menu-item-decoration-hover !default;
31
29
  $mobile-menu-text-color: if(
32
- $mobile-menu-item-color == $menu-item-color,
33
- $menu-text-color,
34
- $mobile-menu-text-color
30
+ sass($mobile-menu-item-color == $menu-item-color): $menu-text-color; else: $mobile-menu-text-color
35
31
  ) !default;
36
32
  $mobile-menu-text-font-weight: $mobile-menu-item-font-weight !default;
37
33
 
@@ -26,9 +26,9 @@ $recent-supporter-color: color-pick-contrast(
26
26
  ) !default;
27
27
  $recent-supporter-time-color: $muted-font-color !default;
28
28
  $recent-supporter-border-color: if(
29
- color.channel(get-background-color($body-background), "lightness", $space: hsl) < 50,
30
- $dark-gray,
31
- $light-gray
29
+ sass(color.channel(get-background-color($body-background), "lightness", $space: hsl) < 50):
30
+ $dark-gray;
31
+ else: $light-gray
32
32
  ) !default;
33
33
  $recent-supporter-border-width: rem-calc(2) !default;
34
34
  $recent-supporter-padding: (rem-calc(0.75 * $base-line-height) - $recent-supporter-border-width)
@@ -76,9 +76,8 @@ $closebutton-border-radius: 50% !default;
76
76
  $menu-item-font-family: inherit !default;
77
77
  $menu-item-font-size: $small-font-size !default;
78
78
  $menu-item-line-height: if(
79
- $menu-item-font-size == $small-font-size,
80
- $small-lineheight,
81
- grid-lineheight($menu-item-font-size)
79
+ sass($menu-item-font-size == $small-font-size): $small-lineheight;
80
+ else: grid-lineheight($menu-item-font-size)
82
81
  ) !default;
83
82
  $menu-item-font-weight: $global-weight-normal !default;
84
83
  $menu-item-color: inherit !default;
@@ -97,18 +96,15 @@ $dropdown-menu-item-color: color-pick-contrast(
97
96
  ($body-font-color, $body-font-color-alt)
98
97
  ) !default;
99
98
  $dropdown-menu-item-color-hover: if(
100
- $dropdownmenu-background,
101
- $dropdown-menu-item-color,
102
- $menu-item-color-hover
99
+ sass($dropdownmenu-background): $dropdown-menu-item-color; else: $menu-item-color-hover
103
100
  ) !default;
104
101
  $dropdown-menu-item-color-active: $dropdown-menu-item-color !default;
105
102
  $dropdown-menu-item-height: $select-height !default;
106
103
  $dropdown-menu-parent-font-weight: $global-weight-bold !default;
107
104
  $dropdown-menu-parent-border-color: $input-border-color !default;
108
105
  $dropdown-menu-parent-border-color-active: if(
109
- $dropdown-menu-parent-border-color == $input-border-color,
110
- $input-border-color-focus,
111
- color.scale($dropdown-menu-parent-border-color, $lightness: -10%)
106
+ sass($dropdown-menu-parent-border-color == $input-border-color): $input-border-color-focus;
107
+ else: color.scale($dropdown-menu-parent-border-color, $lightness: -10%)
112
108
  ) !default;
113
109
  $dropdown-menu-parent-border-width: $input-border-width !default;
114
110
  $dropdownmenu-border: (
@@ -141,13 +137,14 @@ $accordion-item-color-hover: $accordion-item-color !default;
141
137
  $accordion-item-padding: rem-calc($base-line-height) - $accordion-content-border-width !default;
142
138
  $accordion-margin: rem-calc($base-line-height * 0.5) !default;
143
139
  $accordion-plusminus: false !default;
140
+ $accordion-has-arrow: not $accordion-plusminus !default;
141
+ $accordion-arrow-position: left !default;
144
142
  $accordion-radius: rem-calc(5) !default;
145
143
  $accordion-separator: true !default;
146
144
  $accordion-title-font-size: 1rem !default;
147
145
  $accordion-title-line-height: if(
148
- $accordion-title-font-size == 1rem,
149
- unitless-calc($base-line-height),
150
- grid-lineheight($accordion-title-font-size)
146
+ sass($accordion-title-font-size == 1rem): unitless-calc($base-line-height);
147
+ else: grid-lineheight($accordion-title-font-size)
151
148
  ) !default;
152
149
  $accordion-triangle-color: get-color(primary) !default;
153
150
  $accordion-triangle-size: rem-calc($base-font-size) !default;
@@ -10,63 +10,60 @@
10
10
 
11
11
  // Base colors
12
12
  $donation-amount-background-color: if(
13
- $option-button-fill == hollow,
14
- transparent,
15
- $option-button-background
13
+ sass($option-button-fill == hollow): transparent; else: $option-button-background
16
14
  ) !default;
17
15
  $donation-amount-background-color-checked: $option-button-background-checked !default;
18
16
 
19
17
  // Button border colors
20
18
  $donation-amount-border-color: if(
21
- $option-button-fill == hollow,
22
- $donation-amount-background-color-checked,
23
- transparent
19
+ sass($option-button-fill == hollow): $donation-amount-background-color-checked; else: transparent
24
20
  ) !default;
25
21
  $donation-amount-border-color-checked: if(
26
- $donation-amount-background-color-checked == $option-button-background-checked,
27
- $option-button-border-color-checked,
28
- transparent
22
+ sass($donation-amount-background-color-checked == $option-button-background-checked):
23
+ $option-button-border-color-checked;
24
+ else: transparent
29
25
  ) !default;
30
26
  $donation-amount-border-color-hover: color.scale(
31
27
  $donation-amount-border-color,
32
28
  $lightness: $button-hollow-hover-lightness
33
29
  ) !default;
34
30
  $donation-amount-border-color-focus: if(
35
- $donation-amount-border-color-hover == transparent,
36
- color.scale(
37
- $donation-amount-background-color-checked,
38
- $lightness: $button-hollow-hover-lightness
39
- ),
40
- $donation-amount-border-color-hover
31
+ sass($donation-amount-border-color-hover == transparent): color.scale(
32
+ $donation-amount-background-color-checked,
33
+ $lightness: $button-hollow-hover-lightness
34
+ );
35
+ else: $donation-amount-border-color-hover
41
36
  ) !default;
42
37
 
43
38
  // Button text colors
44
39
  $donation-amount-text-color: if(
45
- $donation-amount-background-color == transparent,
46
- $donation-amount-border-color,
47
- if(
48
- $donation-amount-background-color == $option-button-background,
49
- $option-button-color,
50
- color-pick-contrast($donation-amount-background-color, ($button-color, $button-color-alt))
51
- )
40
+ sass($donation-amount-background-color == transparent): $donation-amount-border-color;
41
+ else: if(
42
+ sass($donation-amount-background-color == $option-button-background): $option-button-color;
43
+ else: color-pick-contrast(
44
+ $donation-amount-background-color,
45
+ ($button-color, $button-color-alt)
46
+ )
47
+ )
52
48
  ) !default;
53
49
  $donation-amount-text-color-hover: if(
54
- $donation-amount-background-color == transparent,
55
- $donation-amount-border-color-hover,
56
- $donation-amount-text-color
50
+ sass($donation-amount-background-color == transparent): $donation-amount-border-color-hover;
51
+ else: $donation-amount-text-color
57
52
  ) !default;
58
53
  $donation-amount-text-color-checked: if(
59
- $donation-amount-background-color-checked == $option-button-background-checked,
60
- $option-button-color-checked,
61
- color-pick-contrast($donation-amount-background-color-checked, ($button-color, $button-color-alt))
54
+ sass($donation-amount-background-color-checked == $option-button-background-checked):
55
+ $option-button-color-checked;
56
+ else: color-pick-contrast(
57
+ $donation-amount-background-color-checked,
58
+ ($button-color, $button-color-alt)
59
+ )
62
60
  ) !default;
63
61
 
64
62
  // Button typography
65
63
  $donation-amount-font-size: $large-font-size !default;
66
64
  $donation-amount-text-offset: if(
67
- meta.type-of($button-text-offset) == map,
68
- map.get($button-text-offset, default),
69
- $button-text-offset
65
+ sass(meta.type-of($button-text-offset) == map): map.get($button-text-offset, default);
66
+ else: $button-text-offset
70
67
  ) !default;
71
68
 
72
69
  // Button shape
@@ -57,17 +57,15 @@ $form-label-font-family: inherit !default;
57
57
  $form-label-font-size: $small-font-size !default;
58
58
  $form-label-font-weight: $global-weight-bold !default;
59
59
  $form-label-line-height: if(
60
- $form-label-font-size == $small-font-size,
61
- $small-lineheight,
62
- grid-lineheight($form-label-font-size)
60
+ sass($form-label-font-size == $small-font-size): $small-lineheight;
61
+ else: grid-lineheight($form-label-font-size)
63
62
  ) !default;
64
63
 
65
64
  // Borders
66
65
  $input-border-width: rem-calc(2) !default;
67
66
  $input-border-color: if(
68
- $input-background == $form-background,
69
- color.scale($form-background, $lightness: -10%),
70
- color.scale(get-background-color($form-background), $lightness: -5%)
67
+ sass($input-background == $form-background): color.scale($form-background, $lightness: -10%);
68
+ else: color.scale(get-background-color($form-background), $lightness: -5%)
71
69
  ) !default;
72
70
  $input-border-color-focus: color.scale($input-border-color, $lightness: -10%) !default;
73
71
  $input-border: $input-border-width solid $input-border-color !default;
@@ -117,21 +115,18 @@ $file-upload-help-color: $muted-font-color !default;
117
115
  // Help texts
118
116
  $helptext-color: $form-label-color !default;
119
117
  $helptext-font-size: if(
120
- $form-label-font-size == 1rem,
121
- $small-font-size,
122
- 0.8 * $form-label-font-size
118
+ sass($form-label-font-size == 1rem): $small-font-size; else: 0.8 * $form-label-font-size
123
119
  ) !default;
124
120
  $helptext-line-height: if(
125
- $helptext-font-size == $small-font-size,
126
- $small-lineheight,
127
- grid-lineheight($helptext-font-size)
121
+ sass($helptext-font-size == $small-font-size): $small-lineheight;
122
+ else: grid-lineheight($helptext-font-size)
128
123
  ) !default;
129
124
 
130
125
  // Fieldsets
131
126
  $fieldset-border: none !default;
132
127
  $fieldset-margin: 2 * $form-spacing 0 !default;
133
- $fieldset-padding: if($fieldset-border != none, $form-spacing, 0) !default;
134
- $legend-padding: if($fieldset-border != none, 0 $form-spacing, 0) !default;
128
+ $fieldset-padding: if(sass($fieldset-border != none): $form-spacing; else: 0) !default;
129
+ $legend-padding: if(sass($fieldset-border != none): 0 $form-spacing; else: 0) !default;
135
130
  $legend-margin: 0 0 (2 * $form-spacing)
136
131
  (-1 * get-side($legend-padding, left) - get-side($fieldset-padding, left)) !default;
137
132
  $legend-color: $header-color-odd !default;
@@ -139,17 +134,15 @@ $legend-font-family: $form-label-font-family !default;
139
134
  $legend-font-size: $lead-font-size !default;
140
135
  $legend-font-weight: $header-font-weight !default;
141
136
  $legend-line-height: if(
142
- $legend-font-size == $lead-font-size,
143
- $lead-lineheight,
144
- grid-lineheight($legend-font-size)
137
+ sass($legend-font-size == $lead-font-size): $lead-lineheight;
138
+ else: grid-lineheight($legend-font-size)
145
139
  ) !default;
146
140
 
147
141
  // Errors
148
142
  $input-error-font-size: $small-font-size !default;
149
143
  $input-error-line-height: if(
150
- $input-error-font-size == $small-font-size,
151
- $small-lineheight,
152
- grid-lineheight($input-error-font-size)
144
+ sass($input-error-font-size == $small-font-size): $small-lineheight;
145
+ else: grid-lineheight($input-error-font-size)
153
146
  ) !default;
154
147
  $input-error-background: get-color(alert) !default;
155
148
 
@@ -2,6 +2,11 @@
2
2
  // - - - - - - - - - - - - - - -
3
3
  // Special styles for images, videos, iframes,…
4
4
 
5
+ // Keep aspect ratio when setting a height.
6
+ img {
7
+ width: auto;
8
+ }
9
+
5
10
  // Wrapper to use full available width.
6
11
  .media-stretch {
7
12
  @extend .small-reverse-container-padding;
@@ -17,13 +17,10 @@ $fallback-background: $medium-gray !default;
17
17
 
18
18
  // Borders
19
19
  $form-border: if(
20
- $form-background == $body-background,
21
- rem-calc($base-line-height * 0.5) solid $light-gray,
22
- none
20
+ sass($form-background == $body-background): rem-calc($base-line-height * 0.5) solid $light-gray;
21
+ else: none
23
22
  ) !default;
24
23
  $header-border: if(
25
- $header-background == $body-background,
26
- rem-calc(4) solid $light-gray,
27
- none
24
+ sass($header-background == $body-background): rem-calc(4) solid $light-gray; else: none
28
25
  ) !default;
29
26
  $footer-border: none !default;
@@ -88,6 +88,7 @@
88
88
  @include mo-close-button;
89
89
  @include mo-form-group;
90
90
  @include mo-form-steps;
91
+ @include mo-form-step-animations;
91
92
  @include mo-m2d-message;
92
93
  @include mo-recent-supporters;
93
94
  @include mo-progress-bar;
@@ -26,14 +26,10 @@ $body-font-color-alt: $white !default;
26
26
  $muted-font-color: $medium-gray !default;
27
27
  $title-color: get-color(primary) !default;
28
28
  $header-color-even: if(
29
- meta.variable-exists("header-color"),
30
- $header-color,
31
- $body-font-color
29
+ sass(meta.variable-exists("header-color")): $header-color; else: $body-font-color
32
30
  ) !default;
33
31
  $header-color-odd: if(
34
- meta.variable-exists("header-color"),
35
- $header-color,
36
- get-color(secondary)
32
+ sass(meta.variable-exists("header-color")): $header-color; else: get-color(secondary)
37
33
  ) !default;
38
34
  $header-color-alt: $body-font-color-alt !default;
39
35
  $header-small-font-color: $muted-font-color !default;
@@ -95,21 +91,19 @@ $anchor-text-decoration-hover: underline !default;
95
91
  // Quotes
96
92
  $blockquote-font-size: $lead-font-size !default;
97
93
  $blockquote-line-height: if(
98
- $blockquote-font-size == $lead-font-size,
99
- $lead-lineheight,
100
- grid-lineheight($blockquote-font-size)
94
+ sass($blockquote-font-size == $lead-font-size): $lead-lineheight;
95
+ else: grid-lineheight($blockquote-font-size)
101
96
  ) !default;
102
97
  $blockquote-padding: none !default;
103
98
  $blockquote-border: none !default;
104
99
  $cite-color: $blockquote-color !default;
105
100
  $cite-font-size: $blockquote-font-size !default;
106
101
  $cite-line-height: if(
107
- $cite-font-size == $blockquote-font-size,
108
- $blockquote-line-height,
109
- grid-lineheight($cite-font-size)
102
+ sass($cite-font-size == $blockquote-font-size): $blockquote-line-height;
103
+ else: grid-lineheight($cite-font-size)
110
104
  ) !default;
111
105
  $cite-font-style: normal !default;
112
106
  $cite-pseudo-content: "" !default;
113
107
 
114
108
  // Tags that usually make up text sections
115
- $text-tags: p, h1, h2, h3, h4, h5, h6, dl, ul, ol, blockquote !default;
109
+ $text-tags: "p, h1, h2, h3, h4, h5, h6, dl, ul:not(.accordion), ol, blockquote" !default;