|
11 | 11 | //// |
12 | 12 |
|
13 | 13 | @include nhsuk-exports("nhsuk/components/password-input") { |
14 | | - .nhsuk-password-input__wrapper { |
15 | | - // This element inherits styles from .nhsuk-input__wrapper, including: |
16 | | - // - being display: block with contents in a stacked column below the mobile |
17 | | - // breakpoint |
18 | | - // - being display: flex above the mobile breakpoint |
19 | | - |
20 | | - @include nhsuk-media-query($from: mobile) { |
21 | | - flex-direction: row; |
22 | | - |
23 | | - // The default of `stretch` makes the toggle button appear taller than the |
24 | | - // input, due to using box-shadow, which we don't particularly want in |
25 | | - // this situation |
26 | | - align-items: flex-start; |
27 | | - } |
28 | | - } |
29 | | - |
30 | 14 | .nhsuk-password-input__input { |
31 | 15 | // IE 11 and Microsoft Edge comes with its own password reveal function. We |
32 | 16 | // want to hide it, so that there aren't two controls presented to the user |
|
36 | 20 | &::-ms-reveal { |
37 | 21 | display: none; |
38 | 22 | } |
| 23 | + |
| 24 | + @include nhsuk-media-query($until: tablet) { |
| 25 | + // Set max-width to override potential width override class on the input |
| 26 | + max-width: 100%; |
| 27 | + } |
39 | 28 | } |
40 | 29 |
|
41 | 30 | .nhsuk-password-input__toggle { |
42 | | - // Add top margin so the button doesn't obscure the input's focus style |
43 | | - margin-top: nhsuk-spacing(1); |
44 | | - |
45 | | - // Remove default margin-bottom from button |
46 | | - margin-bottom: 0; |
47 | | - |
48 | 31 | // Hide the button by default, JS removes this attribute |
49 | 32 | &[hidden] { |
50 | 33 | display: none; |
51 | 34 | } |
52 | 35 |
|
53 | | - @include nhsuk-media-query($from: mobile) { |
| 36 | + @include nhsuk-media-query($from: tablet) { |
54 | 37 | flex-basis: 5em; |
55 | 38 | flex-shrink: 0; |
56 | | - |
57 | | - // Buttons are normally 100% wide on mobile, but we don't want that here |
58 | | - width: auto; |
59 | | - |
60 | | - // Move the spacing from top to the left |
61 | | - margin-top: 0; |
62 | | - margin-left: nhsuk-spacing(1); |
63 | 39 | } |
64 | 40 | } |
65 | 41 | } |
0 commit comments