/
_currency-input.scss
110 lines (92 loc) · 2.27 KB
/
_currency-input.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
@import "../../../../govuk-frontend/dist/govuk/settings/all";
@import "../../../../govuk-frontend/dist/govuk/tools/all";
@import "../../../../govuk-frontend/dist/govuk/helpers/all";
@import "../../../../govuk-frontend/dist/govuk/vendor/sass-mq";
.hmrc-currency-input__wrapper {
position: relative;
}
.hmrc-currency-input__pence,
.hmrc-currency-input__unit--pence,
.hmrc-currency-input__unit {
position: absolute;
top: 2px;
bottom: 2px;
left: 2px;
width: 1.5rem;
border-right: 2px solid;
background: govuk-colour("light-grey");
text-align: center;
@include govuk-font($size: 19, $weight: bold);
}
.hmrc-currency-input__unit {
pointer-events: none;
}
.govuk-form-group--error .hmrc-currency-input__unit {
top: 4px;
bottom: 4px;
left: 4px;
}
.hmrc-currency-input__unit--pence,
.hmrc-currency-input__pence {
right: 2px;
left: auto;
width: 3rem;
border-left: 2px solid;
border-right-width: 0;
line-height: 1.8;
}
.hmrc-currency-input__unit--pence {
width: 1.5rem;
}
.govuk-form-group--error .hmrc-currency-input__pence,
.govuk-form-group--error .hmrc-currency-input__unit--pence {
top: 4px;
right: 4px;
bottom: 4px;
}
.hmrc-currency-input__decimal {
@include govuk-font($size: 36, $weight: bold);
}
.hmrc-currency-input__pence::after,
.hmrc-currency-input__unit::after,
.hmrc-currency-input__unit--pence::after {
content: "";
display: inline-block;
height: 100%;
vertical-align: middle;
}
.hmrc-currency-input__unit ~ .govuk-input {
padding-left: 2rem;
}
.hmrc-currency-input__pence ~ .govuk-input {
padding-right: 3.5rem;
}
.hmrc-currency-input__unit--pence ~ .govuk-input {
padding-right: 2rem;
}
.hmrc-currency-input__group {
display: inline-block;
margin-bottom: 0;
}
// WCAG 2.1 focus update
// duplicating as non-supporting browsers choke on focus-within and throw the whole rule
.hmrc-currency-input__wrapper--has-focus .hmrc-currency-input__unit {
top: 4px;
bottom: 4px;
left: 4px;
}
.hmrc-currency-input__wrapper:focus-within .hmrc-currency-input__unit {
top: 4px;
bottom: 4px;
left: 4px;
}
.hmrc-currency-input__wrapper--has-focus .hmrc-currency-input__pence {
top: 4px;
right: 4px;
bottom: 4px;
}
.hmrc-currency-input__wrapper:focus-within .hmrc-currency-input__pence {
top: 4px;
right: 4px;
bottom: 4px;
}