|
| 1 | +@use 'sass:math'; |
1 | 2 | @use '/src/assets/styles/variables.scss' as *; |
2 | 3 | @use '@cfpb/cfpb-design-system/src/elements/abstracts' as *; |
3 | 4 | @use '@cfpb/cfpb-design-system/src/utilities' as *; |
4 | 5 | @use '@cfpb/cfpb-design-system/src/components/cfpb-typography/mixins' as *; |
5 | | -@use 'sass:math'; |
6 | 6 |
|
7 | 7 | // https://github.com/cfpb/consumerfinance.gov/blob/main/cfgov/unprocessed/css/organisms/footer.scss |
8 | 8 |
|
|
21 | 21 | - cfgov-organisms |
22 | 22 | */ |
23 | 23 |
|
| 24 | +@mixin u-upper-hover-line() { |
| 25 | + position: absolute; |
| 26 | + top: -1px; |
| 27 | + content: ''; |
| 28 | + display: block; |
| 29 | + height: 1px; |
| 30 | + width: 100%; |
| 31 | + border-top: 1px solid currentcolor; |
| 32 | +} |
| 33 | + |
24 | 34 | .o-footer { |
25 | 35 | // Adding an extra 5px to the top to account for the absolute positioned |
26 | 36 | // social media icons. |
27 | | - padding-top: math.div(50px, $base-font-size-px) + em; |
| 37 | + padding-top: math.div($grid-gutter-width * 1.5, $base-font-size-px) + rem; |
28 | 38 |
|
29 | 39 | // There is a 10px margin-bottom on the last .o-footer__list li's, plus the |
30 | 40 | // 50px bottom padding = 60px of total padding at the bottom of the footer. |
31 | | - padding-bottom: math.div(50px, $base-font-size-px) + em; |
| 41 | + padding-bottom: math.div($grid-gutter-width * 2, $base-font-size-px) + rem; |
32 | 42 | border-top: 5px solid var(--green); |
33 | 43 | background: var(--gray-5); |
34 | 44 |
|
| 45 | + // Mobile only. |
| 46 | + @include respond-to-max($bp-xs-max) { |
| 47 | + // Tighten top spacing on mobile. |
| 48 | + padding-top: math.div($grid-gutter-width, $base-font-size-px) + rem; |
| 49 | + |
| 50 | + .m-list__link { |
| 51 | + display: block; |
| 52 | + box-sizing: border-box; |
| 53 | + padding-top: math.div(10px, $base-font-size-px) + rem; |
| 54 | + padding-bottom: math.div(10px, $base-font-size-px) + rem; |
| 55 | + border-top-width: 1px; |
| 56 | + border-bottom-width: 1px; |
| 57 | + |
| 58 | + .a-link__text { |
| 59 | + border-bottom: none; |
| 60 | + } |
| 61 | + } |
| 62 | + |
| 63 | + // Handle the borders of jump links that are adjacent in a list. |
| 64 | + .o-footer-middle-right .m-list__link:hover::before { |
| 65 | + @include u-upper-hover-line; |
| 66 | + } |
| 67 | + |
| 68 | + li:has(.m-list__link) + li:has(.m-list__link) { |
| 69 | + .m-list__link { |
| 70 | + position: relative; |
| 71 | + border-top: none; |
| 72 | + } |
| 73 | + |
| 74 | + .m-list__link:hover::before { |
| 75 | + @include u-upper-hover-line; |
| 76 | + } |
| 77 | + } |
| 78 | + } |
| 79 | + |
35 | 80 | &__nav-list { |
| 81 | + padding-left: 0; |
| 82 | + list-style-type: none; |
| 83 | + |
36 | 84 | .m-list__link { |
| 85 | + margin-left: 0; |
37 | 86 | font-size: math.div(18px, $base-font-size-px) + em; |
38 | 87 |
|
39 | 88 | @include u-link-colors(var(--black)); |
40 | 89 |
|
| 90 | + // Tablet and above. |
41 | 91 | @include respond-to-min($bp-sm-min) { |
42 | 92 | margin-right: 1em; |
43 | 93 |
|
44 | 94 | @include u-link-hover-border; |
45 | 95 | } |
46 | 96 |
|
| 97 | + // Desktop and above. |
47 | 98 | @include respond-to-min($bp-med-min) { |
48 | 99 | margin-right: math.div($grid-gutter-width, 22px) + em; |
49 | | - font-size: math.div(20px, $base-font-size-px) + em; |
50 | 100 | } |
51 | 101 | } |
52 | 102 |
|
53 | 103 | .m-list__link.m-list__link--disabled { |
54 | 104 | border-bottom: 1px dotted; |
55 | 105 |
|
| 106 | + // Desktop and above. |
56 | 107 | @include respond-to-min($bp-med-min) { |
57 | 108 | @include u-link-no-border; |
58 | 109 | } |
59 | 110 | } |
60 | 111 | } |
61 | 112 |
|
62 | 113 | &__list { |
| 114 | + padding-left: 0; |
| 115 | + list-style-type: none; |
| 116 | + |
63 | 117 | .m-list__link { |
| 118 | + margin-left: 0; |
| 119 | + |
64 | 120 | @include u-link-colors(var(--gray-dark)); |
65 | 121 | } |
66 | 122 | } |
67 | 123 |
|
| 124 | + // Mobile only. |
| 125 | + @include respond-to-max($bp-xs-max) { |
| 126 | + // This is essentially .m-list--links. |
| 127 | + &__nav-list .m-list__item, |
| 128 | + &__list .m-list__item { |
| 129 | + margin-bottom: 0; |
| 130 | + } |
| 131 | + } |
| 132 | + |
68 | 133 | &__pre { |
69 | 134 | position: relative; |
70 | | - margin-bottom: math.div(45px, $base-font-size-px) + em; |
71 | | - |
72 | | - .o-footer__top-button { |
73 | | - display: block; |
74 | | - width: 100%; |
75 | | - text-align: center; |
76 | | - |
77 | | - // There's a standard margin between the top |
78 | | - // of the footer and the links. The button comes between |
79 | | - // that margin in the wireframes. |
80 | | - margin: -2em auto 2em; |
81 | | - } |
| 135 | + margin-bottom: math.div($grid-gutter-width, $base-font-size-px) + em; |
82 | 136 |
|
83 | 137 | .o-footer__nav-list { |
84 | 138 | margin-bottom: 0; |
85 | 139 | } |
86 | 140 |
|
| 141 | + // Tablet and above. |
87 | 142 | @include respond-to-min($bp-sm-min) { |
88 | 143 | padding-bottom: math.div($grid-gutter-width, $base-font-size-px) + em; |
89 | | - margin-bottom: math.div($grid-gutter-width, $base-font-size-px) + em; |
90 | | - |
91 | 144 | border-bottom: 1px solid var(--gray-40); |
92 | 145 |
|
93 | | - .o-footer__top-button { |
94 | | - display: none; |
95 | | - } |
96 | | - |
97 | 146 | .o-footer__nav-list { |
| 147 | + padding-left: 0; |
| 148 | + list-style-type: none; |
| 149 | + |
98 | 150 | .m-list__item { |
| 151 | + margin-left: 0; |
| 152 | + display: inline-block; |
| 153 | + |
| 154 | + // Assuming a natural space of 4px between inline block items |
| 155 | + // then the space between would be 8px (4px natural + 4px added). |
| 156 | + margin-right: math.div(4px, $base-font-size-px) + em; |
99 | 157 | margin-bottom: 0; |
100 | 158 | } |
101 | 159 | } |
|
115 | 173 | margin: 0; |
116 | 174 | } |
117 | 175 |
|
118 | | - /* Fix doubled border in mobile view */ |
| 176 | + // Mobile only. |
119 | 177 | @include respond-to-max($bp-xs-max) { |
| 178 | + // Fix doubled border in mobile view. |
120 | 179 | .o-footer__col:nth-child(n + 2) { |
121 | 180 | .o-footer__list { |
122 | 181 | .m-list__item .m-list__link { |
|
126 | 185 | } |
127 | 186 | } |
128 | 187 |
|
| 188 | + // Tablet and above. |
129 | 189 | @include respond-to-min($bp-sm-min) { |
| 190 | + |
130 | 191 | @include u-grid-column(8); |
131 | 192 | border-right: 1px solid var(--gray-40); |
132 | 193 | border-left: 0; |
|
138 | 199 | padding-right: math.div( |
139 | 200 | math.div($grid-gutter-width, 2), |
140 | 201 | $base-font-size-px |
141 | | - ) + em; |
| 202 | + ) + |
| 203 | + em; |
142 | 204 | } |
143 | 205 | } |
144 | 206 |
|
|
151 | 213 | } |
152 | 214 |
|
153 | 215 | &__middle-right { |
154 | | - /* Fix doubled border in mobile view */ |
| 216 | + // Mobile only. |
155 | 217 | @include respond-to-max($bp-xs-max) { |
| 218 | + // Fix missing top line hover. |
| 219 | + position: relative; |
| 220 | + |
| 221 | + // Fix doubled border in mobile view. |
156 | 222 | .o-footer__list { |
157 | 223 | .m-list__item .m-list__link { |
158 | 224 | border-top-width: 0; |
159 | 225 | } |
160 | 226 | } |
161 | 227 | } |
162 | 228 |
|
| 229 | + // Tablet and above. |
163 | 230 | @include respond-to-min($bp-sm-min) { |
164 | 231 | @include u-grid-column(4); |
165 | 232 |
|
|
178 | 245 | } |
179 | 246 |
|
180 | 247 | &__post { |
181 | | - margin-top: math.div($grid-gutter-width, $base-font-size-px) + em; |
| 248 | + margin-top: math.div($grid-gutter-width * 1.5, $base-font-size-px) + em; |
182 | 249 |
|
| 250 | + // Tablet and above. |
183 | 251 | @include respond-to-min($bp-sm-min) { |
184 | 252 | padding-top: math.div($grid-gutter-width, $base-font-size-px) + em; |
185 | 253 | border-top: 1px solid var(--gray-40); |
|
191 | 259 | margin: 0; |
192 | 260 | } |
193 | 261 | } |
194 | | -} |
195 | | - |
196 | | -/* topdoc |
197 | | - name: EOF |
198 | | - eof: true |
199 | | -*/ |
200 | 262 |
|
201 | | -.o-footer .cf-icon-svg--external-link { |
202 | | - margin-left: 3px; |
203 | | -} |
| 263 | + // Layout classes for the ApplicationFooter |
| 264 | + &__content { |
| 265 | + display: grid; |
| 266 | + gap: math.div($grid-gutter-width, $base-font-size-px) + em; |
204 | 267 |
|
205 | | -@media (max-width: $bp-sm-min - 1) { |
206 | | - .o-footer { |
207 | | - .m-list__link, |
208 | | - .o-footer-post, |
209 | | - .m-social-media { |
210 | | - padding-left: $space-sm; |
211 | | - } |
| 268 | + @include respond-to-min($bp-sm-min) { |
| 269 | + gap: math.div($grid-gutter-width * 2, $base-font-size-px) + em;; |
| 270 | + grid-template-columns: 2fr 1fr; |
212 | 271 |
|
213 | | - .o-footer__top-button { |
214 | | - width: 95%; |
| 272 | + .o-footer__right-column { |
| 273 | + text-align: right; |
| 274 | + } |
215 | 275 | } |
216 | 276 | } |
217 | 277 | } |
0 commit comments