ant-design/style/components/select.less

436 lines
8.3 KiB
Plaintext
Raw Normal View History

2015-06-15 17:17:23 +08:00
@selectPrefixCls: ant-select;
2015-06-09 21:16:59 +08:00
2015-07-08 22:07:15 +08:00
@import "../mixins/iconfont";
2015-06-11 19:23:35 +08:00
//mixin
2015-07-08 22:07:15 +08:00
.selection__clear() {
2015-06-11 19:23:35 +08:00
cursor: pointer;
float: right;
font-weight: bold;
}
2015-08-10 15:39:50 +08:00
2015-07-20 21:32:31 +08:00
.selected_icon() {
position: relative;
&:after {
.iconfont-size-under-12px(9px);
display: inline-block;
content: '\e613';
font-family: 'anticon';
font-weight: bold;
position: absolute;
top: 6px;
right: 0;
padding-right: 16px;
color: @primary-color;
}
}
2015-06-11 19:23:35 +08:00
2015-06-09 21:16:59 +08:00
.@{selectPrefixCls} {
box-sizing: border-box;
display: inline-block;
margin: 0;
position: relative;
vertical-align: middle;
color: #666;
2015-06-14 15:52:47 +08:00
font-size: @font-size-base;
2015-06-09 21:16:59 +08:00
ul, li {
margin: 0;
padding: 0;
list-style: none;
}
> ul > li > a {
padding: 0;
background-color: #fff;
}
// arrow
&-arrow {
2015-07-09 17:47:21 +08:00
.iconfont-mixin();
2015-06-09 21:16:59 +08:00
position: absolute;
top: 50%;
right: 8px;
line-height: 1;
margin-top: -5px;
2015-07-22 17:36:14 +08:00
.iconfont-size-under-12px(8px);
2015-07-09 17:47:21 +08:00
* {
display: none;
}
2015-06-15 19:29:32 +08:00
&:before {
content: '\e611';
2015-07-15 15:19:04 +08:00
.ie-rotate(1);
.rotate(90deg);
transition: transform 0.2s ease;
2015-06-09 21:16:59 +08:00
}
}
2015-06-11 19:23:35 +08:00
&-selection {
outline: none;
2015-06-09 21:16:59 +08:00
user-select: none;
-webkit-user-select: none;
2015-06-11 19:23:35 +08:00
box-sizing: border-box;
display: block;
2015-06-09 21:16:59 +08:00
background-color: #fff;
2015-06-11 19:23:35 +08:00
border-radius: 6px;
2015-06-09 21:16:59 +08:00
border: 1px solid #d9d9d9;
2015-06-15 11:01:15 +08:00
.transition(all .3s @ease-in-out);
2015-06-11 19:23:35 +08:00
&:hover {
.hover;
2015-06-11 19:23:35 +08:00
}
&:active {
.active;
2015-06-11 19:23:35 +08:00
}
}
2015-06-15 19:29:32 +08:00
&-disabled {
color: #ccc;
cursor: not-allowed;
pointer-events: none;
}
&-disabled &-selection {
&:hover, &:active {
border-color: #d9d9d9;
}
}
2015-06-11 19:23:35 +08:00
&-selection--single {
height: 28px;
cursor: pointer;
2015-06-09 21:16:59 +08:00
.@{selectPrefixCls}-selection__rendered {
display: block;
overflow: hidden;
text-overflow: ellipsis;
2015-06-11 19:23:35 +08:00
padding-left: 10px;
padding-right: 20px;
2015-06-16 19:59:07 +08:00
line-height: 26px;
2015-06-09 21:16:59 +08:00
}
.@{selectPrefixCls}-selection__clear {
2015-06-11 19:23:35 +08:00
.selection__clear();
2015-06-09 21:16:59 +08:00
}
2015-08-10 16:35:51 +08:00
.@{selectPrefixCls}-selection__placeholder {
color: #ccc;
}
2015-06-09 21:16:59 +08:00
}
2015-08-10 15:39:50 +08:00
&-lg {
.ant-select-selection--single {
2015-08-08 19:11:10 +08:00
height: 32px;
2015-08-10 15:39:50 +08:00
.ant-select-selection__rendered {
2015-08-08 19:11:10 +08:00
line-height: 30px;
font-size: 14px;
}
}
2015-08-10 15:39:50 +08:00
.ant-select-selection--multiple {
2015-08-08 19:11:10 +08:00
min-height: 32px;
2015-08-10 15:39:50 +08:00
.ant-select-selection__rendered {
li {
2015-08-08 19:11:10 +08:00
height: 24px;
2015-08-10 15:39:50 +08:00
.ant-select-selection__choice__content {
2015-08-08 19:11:10 +08:00
font-size: 14px;
line-height: 24px;
}
}
}
}
}
2015-08-10 15:39:50 +08:00
&-sm {
.ant-select-selection--single {
2015-08-08 19:11:10 +08:00
height: 22px;
2015-08-10 15:39:50 +08:00
.ant-select-selection__rendered {
2015-08-08 19:11:10 +08:00
line-height: 20px;
}
}
2015-08-10 15:39:50 +08:00
.ant-select-selection--multiple {
2015-08-08 19:11:10 +08:00
min-height: 22px;
2015-08-10 15:39:50 +08:00
.ant-select-selection__rendered {
li {
2015-08-08 19:11:10 +08:00
height: 14px;
2015-08-10 15:39:50 +08:00
.ant-select-selection__choice__content {
2015-08-08 19:11:10 +08:00
line-height: 14px;
position: relative;
top: -3px;
}
2015-08-10 15:39:50 +08:00
.ant-select-selection__choice__remove {
position: relative;
top: -4px;
}
2015-08-08 19:11:10 +08:00
}
}
}
}
2015-07-14 20:16:05 +08:00
&-disabled &-selection__choice__remove {
color: #ccc;
cursor: default;
&:hover {
color: #ccc;
}
}
.@{selectPrefixCls}-search__field__wrap {
display: inline-block;
position: relative;
}
.@{selectPrefixCls}-search__field__placeholder {
position: absolute;
top: 0;
left: 3px;
color: #aaa;
}
2015-07-14 20:16:05 +08:00
&-search--inline {
float: left;
.@{selectPrefixCls}-search__field {
border: none;
font-size: 100%;
background: transparent;
outline: 0;
}
> i {
float: right;
}
}
2015-06-09 21:16:59 +08:00
&-selection--multiple {
2015-06-15 19:29:32 +08:00
min-height: 28px;
2015-06-09 21:16:59 +08:00
cursor: text;
2015-07-15 19:59:54 +08:00
.@{selectPrefixCls}-search--inline {
width: auto;
.@{selectPrefixCls}-search__field {
width: 0.75em;
}
}
2015-06-09 21:16:59 +08:00
.@{selectPrefixCls}-selection__rendered {
overflow: hidden;
text-overflow: ellipsis;
2015-06-19 17:35:32 +08:00
padding-left: 4px;
2015-06-16 14:54:31 +08:00
padding-bottom: 4px;
2015-06-09 21:16:59 +08:00
}
.@{selectPrefixCls}-selection__clear {
2015-06-11 19:23:35 +08:00
.selection__clear();
2015-06-09 21:16:59 +08:00
margin-top: 5px;
margin-right: 10px;
}
2015-06-15 19:29:32 +08:00
> ul > li {
margin-top: 4px;
height: 20px;
line-height: 20px;
}
2015-06-09 21:16:59 +08:00
.@{selectPrefixCls}-selection__choice {
background-color: #f3f3f3;
border-radius: 4px;
cursor: default;
float: left;
2015-06-15 19:29:32 +08:00
padding: 0 8px;
2015-06-09 21:16:59 +08:00
margin-right: 4px;
}
.@{selectPrefixCls}-selection__choice__remove {
2015-07-08 22:07:15 +08:00
.iconfont-mixin();
2015-06-09 21:16:59 +08:00
color: #919191;
cursor: pointer;
display: inline-block;
font-weight: bold;
.iconfont-size-under-12px(8px);
2015-07-09 18:17:15 +08:00
padding: 0 0 0 4px;
position: relative;
top: -1px;
left: 4px;
2015-06-09 21:16:59 +08:00
&:hover {
color: #333;
}
2015-07-08 22:07:15 +08:00
&:before {
content: "\e61e";
}
2015-06-09 21:16:59 +08:00
}
}
2015-07-22 19:05:59 +08:00
.@{selectPrefixCls}-selection--single + .@{selectPrefixCls}-dropdown {
.@{selectPrefixCls}-dropdown-menu-item-selected {
background-color: tint(@primary-color, 90%);
position: relative;
&:after {
content: '\e613';
font-family: 'anticon';
2015-08-14 18:30:54 +08:00
.iconfont-size-under-12px(8px);
font-weight: bold;
position: absolute;
top: 6px;
right: 16px;
color: @primary-color;
background-color: tint(@primary-color, 90%);
}
2015-07-22 19:05:59 +08:00
}
}
2015-07-20 21:32:31 +08:00
.@{selectPrefixCls}-selection--multiple + .@{selectPrefixCls}-dropdown {
.@{selectPrefixCls}-dropdown-menu-item {
padding: 7px 33px 7px 16px;
}
2015-07-20 21:32:31 +08:00
.@{selectPrefixCls}-dropdown-menu-item-selected {
.selected_icon();
}
}
2015-06-09 21:16:59 +08:00
&-dropdown {
display: none;
background-color: white;
border: 1px solid #d9d9d9;
2015-07-23 14:56:14 +08:00
box-shadow: @overlay-shadow;
2015-06-09 21:16:59 +08:00
border-radius: 4px;
box-sizing: border-box;
z-index: 100;
2015-07-14 20:16:05 +08:00
left: -9999px;
top: -9999px;
2015-06-09 21:16:59 +08:00
position: absolute;
outline: none;
2015-07-14 20:16:05 +08:00
&-menu {
outline: none;
margin-bottom: 0;
padding-left: 0; // Override default ul/ol
list-style: none;
z-index: 9999;
max-height: 250px;
overflow: auto;
> li {
margin: 0;
padding: 0;
}
2015-08-01 17:51:55 +08:00
&-item-group-list {
margin: 0;
padding: 0;
2015-08-03 16:43:23 +08:00
> li.@{selectPrefixCls}-dropdown-menu-item {
padding-left: 24px;
2015-08-01 17:51:55 +08:00
}
}
&-item-group-title {
color: #999;
line-height: 1.5;
2015-08-03 16:43:23 +08:00
padding: 8px 16px;
2015-08-01 17:51:55 +08:00
}
li&-item {
2015-07-14 20:16:05 +08:00
position: relative;
display: block;
padding: 7px 16px;
font-weight: normal;
color: #666666;
white-space: nowrap;
cursor: pointer;
2015-07-22 19:05:59 +08:00
&:hover, &-active {
2015-07-14 20:16:05 +08:00
background-color: tint(@primary-color, 90%) !important;
}
&-disabled {
color: #ccc;
cursor: not-allowed;
pointer-events: none;
&:hover {
color: #ccc;
background-color: #fff;
cursor: not-allowed;
}
}
&-divider {
height: 1px;
margin: 1px 0;
overflow: hidden;
background-color: #e5e5e5;
line-height: 0;
}
}
}
}
&-dropdown-container-open, &-open {
.@{selectPrefixCls}-dropdown {
display: block;
2015-06-09 21:16:59 +08:00
}
}
&-search--dropdown {
display: block;
padding: 4px;
.@{selectPrefixCls}-search__field__placeholder {
left: 4px;
}
.@{selectPrefixCls}-search__field__wrap {
width: 100%;
}
2015-06-09 21:16:59 +08:00
.@{selectPrefixCls}-search__field {
padding: 4px;
width: 100%;
box-sizing: border-box;
border: 1px solid #d9d9d9;
border-radius: 4px;
outline: none;
}
&.@{selectPrefixCls}-search--hide {
display: none;
}
}
&-open {
2015-07-15 15:19:04 +08:00
.@{selectPrefixCls}-arrow:before {
.ie-rotate(3);
2015-07-09 20:01:49 +08:00
.rotate(270deg);
2015-06-09 21:16:59 +08:00
}
.@{selectPrefixCls}-selection {
2015-07-20 22:56:43 +08:00
.active();
2015-06-09 21:16:59 +08:00
}
}
2015-06-19 17:52:50 +08:00
&-combobox {
.@{selectPrefixCls}-arrow {
display: none;
}
.@{selectPrefixCls}-search--inline {
2015-08-18 17:48:24 +08:00
height: 100%;
2015-06-19 17:52:50 +08:00
float: none;
}
.@{selectPrefixCls}-search__field__placeholder {
left: 10px;
}
.@{selectPrefixCls}-search__field__wrap {
width: 100%;
2015-08-18 17:48:24 +08:00
height: 100%;
}
2015-06-19 17:52:50 +08:00
.@{selectPrefixCls}-search__field {
padding: 0 10px;
width: 100%;
2015-08-18 17:48:24 +08:00
height: 100%;
position: relative;
z-index: 1;
2015-06-19 17:52:50 +08:00
}
.@{selectPrefixCls}-selection__rendered {
padding: 0;
2015-08-18 17:48:24 +08:00
height: 100%;
2015-06-19 17:52:50 +08:00
}
}
2015-06-14 15:52:47 +08:00
}