1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-09-28 03:58:59 +02:00

custom radio & checkbox styles

This commit is contained in:
Matthias Kretschmann 2020-09-10 16:48:57 +02:00
parent b635fcbc7a
commit 55137af876
Signed by: m
GPG Key ID: 606EEEF3C479A91F
2 changed files with 63 additions and 1 deletions

View File

@ -86,6 +86,68 @@
padding-left: 0.5rem;
}
.radio,
.checkbox {
composes: input;
position: relative;
padding: 0;
width: 18px;
height: 18px;
min-height: 0;
display: inline-block;
vertical-align: middle;
}
.radio::after,
.checkbox::after {
content: '';
display: block;
left: 0;
top: 0;
position: absolute;
opacity: 0;
transition: transform 0.3s ease-out, opacity 0.2s;
}
.radio:checked,
.checkbox:checked {
border-color: var(--brand-pink);
background: var(--brand-pink);
}
.radio:focus,
.checkbox:focus {
box-shadow: 0 0 0 var(--brand-pink);
}
.radio:checked::after,
.checkbox:checked::after {
opacity: 1;
}
.radio {
border-radius: 50%;
}
.radio::after {
width: 16px;
height: 16px;
border-radius: 50%;
background: var(--brand-white);
transform: scale(0.7);
}
.checkbox::after {
width: 6px;
height: 9px;
border: 2px solid var(--brand-white);
border-top: 0;
border-left: 0;
left: 5px;
top: 2px;
transform: rotate(40deg);
}
.prefixGroup,
.postfixGroup {
display: inline-flex;

View File

@ -53,7 +53,7 @@ export default function InputElement({
options.map((option: string, index: number) => (
<div className={styles.radioWrap} key={index}>
<input
className={styles.radio}
className={styles[type]}
id={slugify(option)}
type={type}
name={name}