UNPKG

metro4

Version:

The front-end framework for Build responsive, mobile-first projects on the web with the first front-end component library in Metro Style

129 lines (109 loc) 2.79 kB
@import (once) "include/vars"; @import (once) "include/mixins"; .radio { display: inline-flex; flex-flow: row nowrap; justify-content: flex-start; align-items: center; position: relative; margin: 0; user-select: none; cursor: pointer; height: @inputHeight; .hideElement(input); .check, .caption { display: block; line-height: 1; font-size: 14px; margin: 0 4px; position: relative; } .check { border: 2px @inputBorder solid; .square(20, px); border-radius: 50%; flex-shrink: 0; line-height: @inputHeight; &::before { position: absolute; vertical-align: middle; font-size: 0; content: ""; .square(6, px); color: @transparent; background-color: @white; border: 2px solid @white; border-radius: 50%; left: 50%; top: 50%; margin-left: -3px; margin-top: -3px; display: none; transform: rotate(-45deg); } } input[type=radio]:checked ~ .check { border-color: @dark; background-color: @dark; &::before { display: block; } } input[type=radio]:disabled ~ .check { border-color: @disabledBorder; background-color: @disabledBackground; } .check {order: 1;} .caption {order: 2;} &.caption-left { flex-flow: row-reverse nowrap; } &.required, &.invalid, &.valid { border: none!important; } &.invalid { &::after { display: none; } } &:focus, &:active { input[type=checkbox]:not(:disabled) { & ~ .check { .halo(); } } } &.style2 { input[type=radio]:checked ~ .check { border-color: @dark; background-color: @white; } .check { border-color: @darkGray; &::before { background-color: @dark; border: 2px solid @dark; width: 8px; height: 8px; margin-left: -4px; margin-top: -4px; } } input[type=radio]:disabled ~ .check { border-color: @disabledBorder; background-color: @white; &::before { background-color: @disabledBorder; border-color: @disabledBorder; } } } &.transition-on { .check { transition: @transition-base; } input[type=radio]:checked ~ .check { transition: @transition-base; } } }