Skip to content

Commit ae6ac90

Browse files
committed
Use flexbox in wizard
1 parent 0292343 commit ae6ac90

4 files changed

Lines changed: 29 additions & 23 deletions

File tree

app/assets/stylesheets/common/layouts.css.scss

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ Full license explanation at https://github.com/houdiniproject/houdini/blob/main/
101101
.fieldsLayout--three {
102102
@include fieldsLayout;
103103
& > .field { width: 33.333%; }
104-
& > .field:nth-of-type(3n -2) { padding: 0 10px 0 0; }
105-
& > .field:nth-of-type(3n -1) { padding: 0 5px; }
106-
& > .field:nth-of-type(3n) { padding:0 0 0 10px; }
104+
// & > .field:nth-of-type(3n -2) { padding: 0 10px 0 0; }
105+
// & > .field:nth-of-type(3n -1) { padding: 0 5px; }
106+
// & > .field:nth-of-type(3n) { padding:0 0 0 10px; }
107107
}
108108

109109
.fieldsLayout--four {
@@ -127,14 +127,14 @@ Full license explanation at https://github.com/houdiniproject/houdini/blob/main/
127127
}
128128

129129
@mixin fieldsetLayout {
130-
clear: both;
131-
overflow: auto;
132-
fieldset {
133-
display: inline-block;
134-
float: left;
135-
margin-left: 0;
136-
margin-right: 0;
137-
}
130+
// clear: both;
131+
// overflow: auto;
132+
// fieldset {
133+
// display: inline-block;
134+
// float: left;
135+
// margin-left: 0;
136+
// margin-right: 0;
137+
// }
138138
}
139139

140140

@@ -167,9 +167,15 @@ Full license explanation at https://github.com/houdiniproject/houdini/blob/main/
167167

168168
.fieldsetLayout--three--evenPadding {
169169
@include fieldsetLayout;
170-
fieldset {
171-
width: 33.33% !important;
172-
padding: 0 5px;
170+
display: flex;
171+
align-content: stretch;
172+
row-gap: 10px;
173+
column-gap: 10px;
174+
flex-wrap: wrap;
175+
justify-items: stretch;
176+
177+
> * {
178+
flex: 1 1 25%;
173179
}
174180
}
175181

app/javascript/legacy/nonprofits/donate/amount-step.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ function composeTranslation(full, bold) {
142142
// All the buttons and the custom input for the amounts to select
143143
function amountFields(state) {
144144
if(state.params$().single_amount) return ''
145-
return h('div.u-inline.fieldsetLayout--three--evenPadding', [
146-
h('span',
147-
R.map(
145+
return h('div.fieldsetLayout--three--evenPadding', [
146+
147+
...R.map(
148148
amt => h('fieldset', [
149149
h('button.button.u-width--full.white.amount', {
150150
class: {'is-selected': state.buttonAmountSelected$() && state.donation$().amount === amt*100}
@@ -159,7 +159,7 @@ function amountFields(state) {
159159
])
160160
])
161161
, state.params$().custom_amounts || [] )
162-
)
162+
163163
, h('fieldset.' + prependCurrencyClassname(), [
164164
h('input.amount.other', {
165165
props: {name: 'amount', step: 'any', type: 'number', min: 1, placeholder: I18n.t('nonprofits.donate.amount.custom')}

app/javascript/legacy/recurring_donations/edit/amount-step.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ function chooseNewDonationAmount() {
6969
// All the buttons and the custom input for the amounts to select
7070
function amountFields(state) {
7171
if(state.params$().single_amount) return ''
72-
return h('div.u-inline.fieldsetLayout--three--evenPadding', [
73-
h('span',
74-
R.map(
72+
return h('div.fieldsetLayout--three--evenPadding', [
73+
74+
...R.map(
7575
amt => h('fieldset', [
7676
h('button.button.u-width--full.white.amount', {
7777
class: {'is-selected': state.buttonAmountSelected$() && state.donation$().amount === amt*100}
@@ -86,7 +86,7 @@ function amountFields(state) {
8686
])
8787
])
8888
, state.params$().custom_amounts || [] )
89-
)
89+
9090
, h('fieldset.prepend--dollar', [
9191
h('input.amount', {
9292
props: {name: 'amount', step: 'any', type: 'number', min: 1, placeholder: 'Custom'}

app/views/nonprofits/donate/_amount.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<small>Select an amount for your <strong>monthly</strong> contribution</small>
3737
</p>
3838

39-
<div class='u-inline fieldsetLayout--three--evenPadding'>
39+
<div class='fieldsetLayout--three--evenPadding'>
4040
<fieldset>
4141
<!--= repeat donate_wiz.amounts -->
4242
<button class='button u-width--full white amount'>

0 commit comments

Comments
 (0)