This repository is currently being migrated. It's locked while the migration is in progress.
-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathva-radio-option.scss
More file actions
118 lines (102 loc) · 3.49 KB
/
va-radio-option.scss
File metadata and controls
118 lines (102 loc) · 3.49 KB
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
111
112
113
114
115
116
117
118
/*
__ __ _____ _ _ _____ _ _ _____
\ \ / /\ | __ \| \ | |_ _| \ | |/ ____|
\ \ /\ / / \ | |__) | \| | | | | \| | | __
\ \/ \/ / /\ \ | _ /| . ` | | | | . ` | | |_ |
\ /\ / ____ \| | \ \| |\ |_| |_| |\ | |__| |
\/ \/_/ \_\_| \_\_| \_|_____|_| \_|\_____|
This web component does not make use of the Shadow DOM,
so prefix all style rules with va-radio-option and make sure to test at
http://localhost:3001/burials-and-memorials/pre-need-integration/preparer and
http://localhost:3001/ds-playground/
*/
@forward 'settings';
@use 'uswds-core/src/styles/mixins/helpers/checkbox-and-radio-colors';
@use 'usa-radio/src/styles/usa-radio';
va-radio-option {
display: block;
margin-top: 12px;
}
va-radio-option .usa-radio {
background: transparent;
display: flex;
margin: 0.75rem 0;
max-width: 480px;
cursor: pointer;
// Temporarily adding vars manually until Storybook is setup to make use of CSS-Library
--vads-button-color-background-primary-on-light: #005ea2;
--vads-input-background-color-on-light: #ffffff;
--vads-input-border-color-on-light: #565c65;
--vads-input-prefix-color-fill-on-light: #757575;
--vads-input-prefix-color-text-on-light: #757575;
--vads-input-suffix-color-text-on-light: #757575;
--vads-input-tile-background-active-on-light: rgba(0, 94, 162, 0.1);
--vads-input-tile-border-active-on-light: #005ea2;
--vads-input-tile-border-on-light: rgba(27, 27, 27, 0.03);
--vads-input-tile-border-override: #c9c9c9; // Matches USWDS
}
va-radio-option .va-radio-option__container--tile {
border-radius: 0.25rem;
background-color: var(--vads-input-background-color-on-light);;
border: 2px solid var(--vads-input-tile-border-override);
color: var(--vads-color-base);
padding: 0.75rem 1rem .75rem .5rem;
margin: 0.5rem 0;
}
va-radio-option .va-radio-option__container--tile--checked {
background-color: var(--vads-input-tile-background-active-on-light);
border-color: var(--vads-input-tile-border-active-on-light);
}
va-radio-option input[type="radio"].va-radio-option__input {
height: 1.25rem !important; // Important is needed to overcome legacy styling
width: 1.25rem;
min-width: 1.25rem;
border: none;
box-shadow: 0 0 0 2px var(--vads-color-base);
border-radius: 50%;
appearance: none;
margin: 0.064rem 0 0 4px;
opacity: unset;
position: static;
cursor: pointer;
}
va-radio-option input[type="radio"].va-radio-option__input:checked {
background: var(--vads-button-color-background-primary-on-light);
box-shadow: 0 0 0 2px var(--vads-button-color-background-primary-on-light), inset 0 0 0 2px var(--vads-input-background-color-on-light);
}
va-radio-option input[type="radio"].va-radio-option__input:checked:focus {
outline-offset: 4px;
}
va-radio-option .usa-radio__label {
display: flex;
flex-direction: column;
margin: 0 !important; // Important is needed to overcome legacy styling
width: 100%;
padding-left: 0.6rem;
box-sizing: border-box;
}
// Formation overrides
va-radio-option input[type="radio"] + label {
margin-bottom: 0;
}
va-radio-option input[type="radio"] + label:before {
background: unset;
display: unset;
text-indent: unset;
vertical-align: unset;
content: none;
border-radius: 0;
box-shadow: none;
height: 0;
line-height: 0;
margin-left: 0;
margin-right: 0;
width: 0;
}
va-radio-option input[type="radio"]:checked + label:before {
outline: none;
box-shadow: none;
}
va-radio-option input[type="radio"]:focus + label::before {
outline: none;
}