}
}
-// Thanks: https://codepen.io/triss90/pen/XNEdRe/
+// Thanks: https://codepen.io/manabox/pen/raQmpL
@mixin peertube-radio-container {
- input[type=radio] {
- display: none;
-
- + label {
- font-weight: $font-regular;
- cursor: pointer;
+ [type=radio]:checked,
+ [type=radio]:not(:checked) {
+ position: absolute;
+ left: -9999px;
+ }
- &::before {
- @include margin-right(10px);
-
- position: relative;
- top: -2px;
- content: '';
- background: #fff;
- border-radius: 100%;
- border: 1px solid #000;
- display: inline-block;
- width: 15px;
- height: 15px;
- vertical-align: middle;
- cursor: pointer;
- text-align: center;
- }
- }
+ [type=radio]:checked + label,
+ [type=radio]:not(:checked) + label {
+ position: relative;
+ padding-left: 28px;
+ cursor: pointer;
+ line-height: 20px;
+ display: inline-block;
+ }
- &:checked + label::before {
- background-color: #000;
- box-shadow: inset 0 0 0 4px #fff;
- }
+ [type=radio]:checked + label::before,
+ [type=radio]:not(:checked) + label::before {
+ content: '';
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 18px;
+ height: 18px;
+ border: 1px solid #C6C6C6;
+ border-radius: 100%;
+ background: #fff;
+ }
- &:focus + label::before {
- outline: none;
- border-color: #000;
- }
+ [type=radio]:checked + label::after,
+ [type=radio]:not(:checked) + label::after {
+ content: '';
+ width: 10px;
+ height: 10px;
+ background: pvar(--mainColor);
+ position: absolute;
+ top: 4px;
+ left: 4px;
+ border-radius: 100%;
+ transition: all 0.2s ease;
+ }
+ [type=radio]:not(:checked) + label::after {
+ opacity: 0;
+ transform: scale(0);
+ }
+ [type=radio]:checked + label::after {
+ opacity: 1;
+ transform: scale(1);
}
}