form.less 4.54 KB
/***************************************************
* feature  :  表单组件类集合,提供input、textarea等样式;
* update   :  2015/02/03;
* use      :  按需使用;
* extend   :  ;
* example  :  ;
* desc     :  ;
* feedback :  此处填入 issue, 并请附带以下信息[os_version, browser_version, page_path, issue_description]
*          -  demo => [windows 7, IE 8, http://diligrp.com/icon.html, 在不定height下未能垂直居中];
****************************************************/
@import "icon";
.m-input-wrap{
	position: relative;
	.m-input{
		padding-right: 40px;
	}
	.clear-btn{
		position: absolute;
		right: 5px;
		top: 0;
		display: block;
		height: 100%;
		width: 36px;
		cursor: pointer;
		.m-icon{
			position: absolute;
			top: 50%;
			left: 50%;
			margin: -15px 0 0 -15px;
		}
	}
	&.input-search{
		.m-input{
			padding: 4px 5px 4px 35px;
			font-size: 13px;
			&:focus{
				border-color: #e2e2e2;
			}
		}
		.icon-search{
			position: absolute;
			left: 10px;
			top: 50%;
			margin: -8px 0 0 0;
		}
	}
}

.m-input{
	line-height: 22px;
	// line-height: normal;
	min-height: 22px;
	margin: 0;
	padding: 11px 11px 10px;
	font-size: 17px;
	color: #333;
	width: 100%;
	border: 1px solid #e2e2e2;
	text-align: left;
	outline: none;
	box-shadow: none;
	background: #FFF;
	-webkit-box-sizing: border-box;
	-moz-box-sizing: border-box;
	box-sizing: border-box;
	-webkit-border-radius: 3px;
	-moz-border-radius: 3px;
	-ms-border-radius: 3px;
	-o-border-radius: 3px;
	border-radius: 3px;
	vertical-align: middle;
	&:focus{
		border-color: #1c69a3;
	}
}


.m-textarea{
	width: 100%;
	padding: 8px;
	box-sizing: border-box;
	font-size: 15px;
	color: #333;
	margin: 0;
	min-height: 90px;
	border: none;
	outline: none;
	border-radius: 0;
	box-shadow: none;
	resize:none;
	line-height: 1.5;
	-webkit-appearance: none;
}

.m-input-number{
	display: inline-block;
	border: 1px solid #ccc;
	border-radius: 4px;
	background-color: #FFF;
	font-size: 0;
	input{
		line-height: normal;
		float: left;
		height: 22px;
		padding: 5px 5px 6px;
		font-size: 12px;
		color: #666;
		width: 40px;
		text-align: center;
	}
	span{
		float: left;
		position: relative;
		width: 33px;
		height: 33px;
		cursor: pointer;
		&:before, &:after{
			content: '';
			position: absolute;
			width: 15px;
			height: 1px;
			top: 50%;
			left: 50%;
			margin-left: -7px;
			background-color: #999;
			font-size: 0;
			overflow: hidden;
			cursor: pointer;
		}
	}
	.reduce{
		border-right: 1px solid #ccc;
		&:after{
			display: none;
		}
	}
	.add{
		border-left: 1px solid #ccc;
		&:after{
			content: '';
			position: absolute;
			height: 15px;
			width: 1px;
			margin: -7px 0 0;
		}
	}
}

input.m-radio {
	.icon-choose;
    -webkit-appearance: none;
    -moz-appearance: none;
    -o-appearance: none;
    appearance: none;
    display: inline-block;
    border: none;
    cursor: pointer;
    margin: 0px;
    position: relative;
    outline: none;
    vertical-align: middle;
    background-color: transparent;
    &:focus{
	    outline:0;
	    outline: none;
    }
    &:checked {
    	.icon-choose_H;
    }
}


.m-select{
	display: inline-block;
	border: 1px solid #ddd;
	min-width: 170px;
	height: 36px;
	background-color: #FFF;
	position: relative;
  	line-height: 36px;
	font-size: 14px;
	color: #333;

	font-weight: normal;
	padding-left: 10px;
	float: left;
	overflow: hidden;
	position: relative;
	height: 22px !ie;
	border: 1px solid #fff !ie;
	padding-left: 0px !ie;
	
	&:after{
		content: '';
		position: absolute;
		right: 10px;
		top: 50%;
		margin-top: -2px;
		border: 5px solid #ccc;
		border-color: #ccc transparent transparent;
		width: 0;
		height: 0;
		font-size: 0;
		overflow: hidden;
	}
	select{
		width: 110%;
		max-width: 110%;
		min-width: 110%;
		appearance: none;
		-webkit-appearance: none;
		-moz-appearance: window;
		white-space: nowrap;
		text-overflow: ellipsis;
		overflow: hidden;
		font-size: 14px;
		font-weight: 400;
		background: none;
		border: 1px solid #fff;
		vertical-align: middle;
		color: #333;
		outline: none;
		padding: 0;
		line-height: 1.5;
		height: 36px;
		height: 20px\0;
		line-height: 36px;
		width: 100% !ie;
		&:-moz-focusring {
			color: transparent;
			text-shadow: 0 0 0 #000;
		}
	}
}


.m-input-date{
	position: relative;
	display: inline-block;
	vertical-align: middle;
	min-width: 50px;
	.current{
		color:#999;
		text-align: right;
		display: block;
		line-height: 21px;
	}
	input{
		border: 0;
		font-size: 14px;
		background: none;
		outline: none;
		// -webkit-appearance: none;
		position: absolute;
		top: 0;
		left: 0;
		width:100%;
		height: 100%;
		opacity: 0;
	}
}