|
| 1 | +$card_width: $font-body * 3.75; // roughly 60px wide |
| 2 | +@mixin payment-details-col-start( $reset: false ) { |
| 3 | + // Handles the logo column spacing |
| 4 | + @if $reset == false { |
| 5 | + margin-inline-start: calc( #{$card-width} + #{$font-body} ); |
| 6 | + } @else { |
| 7 | + margin-inline-start: 0; |
| 8 | + } |
| 9 | +} |
| 10 | + |
1 | 11 | .payment-method-list__payment-methods {
|
2 | 12 | margin-top: 12px;
|
3 |
| -} |
4 | 13 |
|
5 |
| -.payment-method-list__payment-methods > div { |
6 |
| - width: 100%; |
| 14 | + > div { |
| 15 | + width: 100%; |
| 16 | + } |
7 | 17 | }
|
8 | 18 |
|
9 | 19 | .payment-method-list__loader {
|
|
20 | 30 | }
|
21 | 31 |
|
22 | 32 | .payment-method {
|
23 |
| - margin-bottom: 0; |
24 | 33 | display: grid;
|
25 | 34 | grid-template-areas:
|
26 |
| - "payment-method-details" |
27 |
| - "payment-method-billing-information" |
28 |
| - "payment-method-backup" |
29 |
| - "payment-method-delete"; |
| 35 | + 'payment-method-details' |
| 36 | + 'payment-method-billing-information' |
| 37 | + 'payment-method-backup' |
| 38 | + 'payment-method-delete'; |
30 | 39 | grid-template-columns: 1fr;
|
31 | 40 | align-items: center;
|
32 |
| - justify-content: space-between; |
33 |
| - flex-wrap: wrap; |
34 | 41 | width: 100%;
|
| 42 | + gap: 0.75rem 1rem; |
35 | 43 |
|
36 |
| - @include breakpoint-deprecated( ">480px" ) { |
| 44 | + @include breakpoint-deprecated( '>480px' ) { |
37 | 45 | grid-template-areas:
|
38 |
| - "payment-method-details payment-method-backup" |
39 |
| - "payment-method-billing-information payment-method-delete"; |
| 46 | + 'payment-method-details payment-method-backup' |
| 47 | + 'payment-method-billing-information payment-method-delete'; |
40 | 48 | grid-template-columns: 2fr 1fr;
|
41 | 49 | }
|
42 |
| -} |
43 | 50 |
|
44 |
| -.payment-method-details { |
45 |
| - display: flex; |
46 |
| - align-items: center; |
47 |
| - grid-area: payment-method-details; |
48 |
| -} |
49 |
| - |
50 |
| -.payment-method-details__image { |
51 |
| - width: 60px; |
52 |
| - height: 38px; |
53 |
| - margin-right: 16px; |
54 |
| -} |
| 51 | + // Payment Method Details (Row 1) |
| 52 | + &-details { |
| 53 | + display: flex; |
| 54 | + align-items: center; |
| 55 | + grid-area: payment-method-details; |
| 56 | + gap: $font-body; |
| 57 | + width: 100%; |
| 58 | + |
| 59 | + &__image { |
| 60 | + width: 60px; |
| 61 | + height: 38px; |
| 62 | + flex-shrink: 0; |
| 63 | + } |
55 | 64 |
|
56 |
| -.payment-method-details__details { |
57 |
| - flex-grow: 1; |
58 |
| - margin-right: 16px; |
59 |
| -} |
| 65 | + &__details { |
| 66 | + display: flex; |
| 67 | + flex-wrap: wrap; |
| 68 | + flex-grow: 1; |
| 69 | + gap: 0.25rem 0.5rem; |
| 70 | + align-items: baseline; |
| 71 | + min-width: 0; // Prevents overflow issues |
| 72 | + } |
60 | 73 |
|
61 |
| -.payment-method-details__number { |
62 |
| - color: var(--color-neutral-80); |
63 |
| - display: block; |
64 |
| - margin-right: 12px; |
| 74 | + &__name, |
| 75 | + &__vpa { |
| 76 | + color: var( --color-neutral-50 ); |
| 77 | + display: flex; |
| 78 | + flex-wrap: wrap; |
| 79 | + align-items: center; |
| 80 | + flex-basis: 100%; // Ensures full-width name/VPA line |
| 81 | + font-size: $font-body; |
| 82 | + gap: 0.5rem; |
| 83 | + |
| 84 | + .components-badge { |
| 85 | + flex-shrink: 0; |
| 86 | + } |
| 87 | + } |
65 | 88 |
|
66 |
| - @include breakpoint-deprecated( ">960px" ) { |
67 |
| - display: inline; |
| 89 | + &__number, |
| 90 | + &__expiration-date { |
| 91 | + color: var( --color-neutral-80 ); |
| 92 | + white-space: nowrap; |
| 93 | + font-size: $font-body-small; |
| 94 | + display: inline-flex; |
| 95 | + min-width: 0; |
| 96 | + } |
68 | 97 | }
|
69 |
| -} |
70 | 98 |
|
71 |
| -.payment-method-details__expiration-date { |
72 |
| - margin-right: 12px; |
73 |
| - display: block; |
| 99 | + // Billing Info (Row 2) |
| 100 | + &-tax-info { |
| 101 | + @include payment-details-col-start; |
| 102 | + font-size: $font-body-small; |
| 103 | + grid-area: payment-method-billing-information; |
74 | 104 |
|
75 |
| - @include breakpoint-deprecated( ">960px" ) { |
76 |
| - display: inline; |
| 105 | + @include breakpoint-deprecated( '>480px' ) { |
| 106 | + width: auto; |
| 107 | + } |
77 | 108 | }
|
78 |
| -} |
79 | 109 |
|
80 |
| -.payment-method-details__expiration-notice { |
81 |
| - font-size: 0.875rem; |
82 |
| - display: block; |
| 110 | + // Backup Toggle & Delete Button (Share common styles) |
| 111 | + &-backup-toggle, |
| 112 | + &-delete { |
| 113 | + @include payment-details-col-start; |
83 | 114 |
|
84 |
| - @include breakpoint-deprecated( ">960px" ) { |
85 |
| - display: inline-block; |
86 |
| - } |
| 115 | + @include breakpoint-deprecated( '>480px' ) { |
| 116 | + @include payment-details-col-start( true ); |
| 117 | + justify-self: flex-end; |
87 | 118 |
|
88 |
| - .gridicon { |
89 |
| - vertical-align: text-bottom; |
90 |
| - margin-right: 4px; |
| 119 | + &__button { |
| 120 | + text-align: end; |
| 121 | + } |
| 122 | + } |
91 | 123 | }
|
92 | 124 |
|
93 |
| - &.is-expired { |
94 |
| - color: var(--color-error); |
95 |
| - } |
96 |
| -} |
| 125 | + &-backup-toggle { |
| 126 | + grid-area: payment-method-backup; |
97 | 127 |
|
98 |
| -.payment-method-details__name, |
99 |
| -.payment-method-details__vpa { |
100 |
| - color: var(--color-neutral-50); |
101 |
| - display: block; |
102 |
| - font-size: 0.875rem; |
103 |
| -} |
| 128 | + // Ensure checkbox, label, and icon align properly |
| 129 | + .components-flex { |
| 130 | + display: flex; |
| 131 | + align-items: center; |
| 132 | + column-gap: 0.5rem; |
| 133 | + min-width: 0; // Ensures text wraps naturally if needed |
| 134 | + } |
104 | 135 |
|
105 |
| -.payment-method .payment-method-tax-info { |
106 |
| - font-size: 0.875rem; |
107 |
| - grid-area: payment-method-billing-information; |
108 |
| - margin-left: 76px; |
| 136 | + // Ensure the text takes up available space |
| 137 | + .components-checkbox-control__label { |
| 138 | + display: flex; |
| 139 | + align-items: center; |
| 140 | + flex-grow: 1; |
| 141 | + white-space: normal; |
| 142 | + column-gap: 0.25rem; |
| 143 | + } |
109 | 144 |
|
110 |
| - @include breakpoint-deprecated( ">480px" ) { |
111 |
| - width: auto; |
| 145 | + // Prevent checkbox and icon from shrinking |
| 146 | + .components-base-control__field, |
| 147 | + .components-checkbox-control__input-container, |
| 148 | + .inline-support-link { |
| 149 | + margin: 0; |
| 150 | + flex-shrink: 0; |
| 151 | + } |
112 | 152 | }
|
113 |
| -} |
114 | 153 |
|
115 |
| -.payment-method-delete { |
116 |
| - grid-area: payment-method-delete; |
117 |
| - margin-top: 12px; |
118 |
| - text-align: right; |
| 154 | + &-delete { |
| 155 | + grid-area: payment-method-delete; |
119 | 156 |
|
120 |
| - @include breakpoint-deprecated( ">480px" ) { |
121 |
| - margin-top: 0; |
122 |
| - justify-self: flex-end; |
| 157 | + &__button { |
| 158 | + text-decoration: underline; |
| 159 | + padding: 0; |
| 160 | + } |
123 | 161 | }
|
124 | 162 | }
|
125 | 163 |
|
126 |
| -.payment-method-delete__button { |
127 |
| - text-decoration: underline; |
128 |
| - padding: 0; |
129 |
| - text-align: right; |
130 |
| -} |
131 |
| - |
132 | 164 | .payment-method-delete-dialog {
|
133 | 165 | &.dialog {
|
134 | 166 | max-width: 660px;
|
|
138 | 170 | font-size: $font-body-small;
|
139 | 171 |
|
140 | 172 | &.payment-method-delete-dialog__affected-subscription-domain {
|
141 |
| - color: var(--color-text-subtle); |
| 173 | + color: var( --color-text-subtle ); |
142 | 174 | font-size: $font-body-extra-small;
|
143 | 175 | }
|
144 | 176 |
|
145 | 177 | &.payment-method-delete-dialog__affected-subscription-date span {
|
146 |
| - color: var(--color-error); |
| 178 | + color: var( --color-error ); |
147 | 179 | font-size: $font-body-extra-small;
|
148 | 180 | text-align: center;
|
149 | 181 | }
|
150 | 182 | }
|
151 | 183 | }
|
152 | 184 |
|
153 | 185 | .payment-method-delete-dialog__affected-subscriptions-wrapper {
|
154 |
| - border-top: 1px solid var(--color-border-subtle); |
| 186 | + border-top: 1px solid var( --color-border-subtle ); |
155 | 187 | padding-top: 12px;
|
156 | 188 | }
|
157 | 189 |
|
158 |
| - .payment-method-delete-dialog__affected-subscriptions-title-wrapper { |
159 |
| - display: flex; |
160 |
| - gap: 12px; |
161 |
| - flex-wrap: wrap; |
162 |
| - justify-content: space-between; |
163 |
| - margin-bottom: 8px; |
164 |
| - |
165 |
| - .card-heading { |
166 |
| - margin: 0; |
167 |
| - } |
168 |
| - } |
169 |
| - |
170 |
| - .payment-method-delete-dialog__affected-subscription { |
171 |
| - background: var(--color-neutral-0); |
172 |
| - border-radius: 4px; |
173 |
| - display: flex; |
174 |
| - gap: 12px; |
175 |
| - justify-content: space-between; |
176 |
| - padding: 12px; |
177 |
| - margin-top: 14px; |
178 |
| - } |
179 |
| - |
180 | 190 | .payment-method-delete-dialog__warning {
|
181 | 191 | display: flex;
|
182 | 192 | margin-top: 12px;
|
183 | 193 | gap: 12px;
|
184 | 194 |
|
185 | 195 | .gridicon {
|
186 |
| - fill: var(--color-warning); |
| 196 | + fill: var( --color-warning ); |
187 | 197 | }
|
188 | 198 |
|
189 | 199 | p {
|
190 |
| - color: var(--color-warning); |
| 200 | + color: var( --color-warning ); |
191 | 201 | font-size: $font-body-small;
|
192 | 202 | }
|
193 | 203 | }
|
194 |
| - |
195 |
| - .card-heading { |
196 |
| - margin-top: 0; |
197 |
| - } |
198 |
| -} |
199 |
| - |
200 |
| -.payment-method-backup-toggle { |
201 |
| - grid-area: payment-method-backup; |
202 |
| - margin-inline-start: 76px; |
203 |
| - margin-top: 16px; |
204 |
| - width: 100%; |
205 |
| - |
206 |
| - @include breakpoint-deprecated( ">480px" ) { |
207 |
| - margin-left: 0; |
208 |
| - margin-top: 0; |
209 |
| - width: auto; |
210 |
| - justify-self: flex-end; |
211 |
| - } |
212 | 204 | }
|
213 | 205 |
|
214 | 206 | .payment-method__wrapper {
|
215 | 207 | margin-bottom: 0;
|
216 |
| -} |
217 | 208 |
|
218 |
| -/* Jetpack cloud overwrites */ |
219 |
| - |
220 |
| -.payment-method__wrapper--jetpack-cloud { |
221 |
| - .components-checkbox-control__input[type="checkbox"]:checked { |
222 |
| - background-color: var(--studio-jetpack-green-50); |
| 209 | + &--jetpack-cloud { |
| 210 | + .components-checkbox-control__input[type='checkbox']:checked { |
| 211 | + background-color: var( --studio-jetpack-green-50 ); |
| 212 | + } |
223 | 213 | }
|
224 | 214 | }
|
0 commit comments