lu2
Version:
Simple and flexible UI component library based on native HTML and JavaScript
81 lines (73 loc) • 1.97 kB
CSS
@charset "UTF-8";
/**
*
* @Radio.css
* @author xinxuzhang
* @create 15-06-17
**/
input[type=radio] {
position: absolute;
clip: rect(0, 0, 0, 0);
/* IE8+ */
*left: -999px; }
.ui-radio {
display: inline-block;
width: 20px;
height: 20px;
border: 1px solid rgba(208, 208, 213, 0.99);
/* IE7-IE8 ignore this */
border-radius: 50%;
background-color: #fff;
box-sizing: border-box;
vertical-align: -.5ex;
*vertical-align: 0;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-transition: border-color .2s;
transition: border-color .2s;
overflow: hidden; }
:not(:disabled) + .ui-radio:hover {
border-color: #ababaf; }
.ui-radio::before {
content: '';
display: block;
width: 10px;
height: 10px;
margin: 4px auto 0;
border-radius: 50%;
background-color: #00a5e0;
visibility: hidden; }
:checked + .ui-radio::before {
visibility: visible;
-webkit-animation: bounceIn .2s;
animation: bounceIn .2s; }
:disabled + .ui-radio,
.ui-radio.disabled {
/* 与设计师沟通,这里边框色值提高,否则不怎么好的显示器和背景色混在一起都看不出来 */
border-color: #ababaf;
opacity: .38; }
/* error */
.error.ui-radio {
border-color: #f4615c; }
/*IE7, IE8 使用图片作UI*/
@media \0screen\,screen\9 {
.ui-radio {
background: url(images/Radio/radio.png) no-repeat; }
.ui-radio:hover {
background-position: 0 -20px; }
[checked] + .ui-radio {
background-position: 0 -40px; }
[defaultChecked] + .ui-radio {
background-position: 0 -40px; }
[checked] + .ui-radio:hover,
[checked][disabled] + .ui-radio {
/* disabled态使用高亮边框 */
background-position: 0 -60px; }
[defaultChecked] + .ui-radio:hover,
[defaultChecked][disabled] + .ui-radio {
/* disabled态使用高亮边框 */
background-position: 0 -60px; }
[disabled] + .ui-radio {
background-position: 0 -20px;
filter: alpha(opacity=38); } }