iview/src/styles/components/carousel.less

186 lines
3.3 KiB
Text
Raw Normal View History

2017-01-16 02:45:11 -06:00
@carousel-prefix-cls: ~"@{css-prefix}carousel";
@carousel-item-prefix-cls: ~"@{css-prefix}carousel-item";
.@{carousel-prefix-cls} {
2017-01-16 02:59:46 -06:00
position: relative;
display: block;
box-sizing: border-box;
user-select: none;
touch-action: pan-y;
-webkit-tap-highlight-color: transparent;
2017-01-16 04:00:52 -06:00
&-track, &-list {
transform: translate3d(0, 0, 0);
}
&-list {
position: relative;
display: block;
overflow: hidden;
margin: 0;
padding: 0;
}
&-track {
position: relative;
top: 0;
left: 0;
display: block;
2017-01-16 04:12:46 -06:00
overflow: hidden;
2017-01-16 17:37:28 -06:00
z-index: 1;
&.higher {
z-index: 2;
}
2017-01-16 04:00:52 -06:00
}
&-item {
float: left;
height: 100%;
min-height: 1px;
2017-01-16 04:12:46 -06:00
display: block;
2017-01-16 04:00:52 -06:00
}
2017-01-16 17:37:28 -06:00
&-arrow {
2017-01-17 14:29:51 -06:00
border: none;
outline: none;
padding: 0;
margin: 0;
width: 36px;
height: 36px;
border-radius: 50%;
cursor: pointer;
display: none;
2017-01-16 17:37:28 -06:00
position: absolute;
2017-01-17 14:29:51 -06:00
top: 50%;
z-index: 10;
transform: translateY(-50%);
2017-01-18 11:49:34 +08:00
transition: @transition-time;
2017-01-17 14:29:51 -06:00
background-color: rgba(31, 45, 61, .11);
color: #fff;
&:hover {
background-color: rgba(31, 45, 61, 0.5);
}
2017-01-16 17:37:28 -06:00
text-align: center;
2017-01-17 14:29:51 -06:00
font-size: 1em;
font-family: inherit;
line-height: inherit;
2017-01-16 17:37:28 -06:00
& > * {
2017-01-17 14:29:51 -06:00
vertical-align: baseline;
2017-01-16 17:37:28 -06:00
}
2017-01-17 14:29:51 -06:00
&.left {
left: 16px;
2017-01-16 17:37:28 -06:00
}
2017-01-17 14:29:51 -06:00
&.right {
right: 16px;
}
2017-01-16 17:37:28 -06:00
2017-01-17 14:29:51 -06:00
&-always {
display: inherit;
2017-01-16 17:37:28 -06:00
}
2017-01-17 14:29:51 -06:00
&-hover {
display: inherit;
opacity: 0;
2017-01-16 17:37:28 -06:00
}
2017-01-17 14:29:51 -06:00
}
2017-01-16 17:37:28 -06:00
2017-01-17 14:29:51 -06:00
&:hover &-arrow-hover {
opacity: 1;
}
2017-01-16 17:37:28 -06:00
2017-01-17 14:29:51 -06:00
&-dots {
2017-01-17 16:39:07 -06:00
z-index: 10;
2017-01-17 14:29:51 -06:00
@padding: 7px;
2017-01-16 17:37:28 -06:00
2017-01-17 16:39:07 -06:00
display: none;
2017-01-17 14:39:17 -06:00
position: relative;
&-inside {
2017-01-17 16:39:07 -06:00
display: block;
2017-01-17 14:39:17 -06:00
position: absolute;
bottom: 10px - @padding;
}
&-outside {
2017-01-17 16:39:07 -06:00
display: block;
2017-01-17 14:39:17 -06:00
margin-top: 10px - @padding;
}
2017-01-17 14:29:51 -06:00
2017-01-17 14:39:17 -06:00
list-style: none;
2017-01-17 14:29:51 -06:00
text-align: center;
padding: 0;
width: 100%;
height: 3px + @padding * 2;
li {
position: relative;
display: inline-block;
vertical-align: top;
text-align: center;
margin: 0 2px;
padding: @padding 0;
cursor: pointer;
button {
border: 0;
cursor: pointer;
background: #8391a5;
opacity: 0.3;
display: block;
width: 16px;
height: 3px;
border-radius: 1px;
outline: none;
font-size: 0;
color: transparent;
transition: all .5s;
&.radius {
width: 6px;
height: 6px;
border-radius: 50%;
}
2017-01-17 14:29:51 -06:00
}
&:hover > button {
opacity: 0.7;
}
&.@{carousel-prefix-cls}-active > button {
opacity: 1;
width: 24px;
&.radius{
width: 6px;
}
2017-01-17 14:29:51 -06:00
}
2017-01-16 17:37:28 -06:00
}
}
2017-01-16 02:45:11 -06:00
}