carousel.less 2.39 KB
Newer Older
1
2
3
4
//
// Carousel
// --------------------------------------------------

5
6

.carousel {
7
  position: relative;
8
  margin-bottom: @baseLineHeight;
9
10
  line-height: 1;
}
11

12
13
14
.carousel-inner {
  overflow: hidden;
  width: 100%;
15
  position: relative;
16
}
17

18
.carousel-inner {
19

20
  > .item {
21
22
23
24
25
    display: none;
    position: relative;
    .transition(.6s ease-in-out left);
  }

26
  // Account for jankitude on images
27
  > .item > img {
28
29
30
31
    display: block;
    line-height: 1;
  }

32
33
34
  > .active,
  > .next,
  > .prev { display: block; }
35

36
  > .active {
37
38
    left: 0;
  }
39

40
41
  > .next,
  > .prev {
42
43
44
45
46
    position: absolute;
    top: 0;
    width: 100%;
  }

47
  > .next {
48
49
    left: 100%;
  }
50
  > .prev {
51
52
    left: -100%;
  }
53
54
  > .next.left,
  > .prev.right {
55
56
57
    left: 0;
  }

58
  > .active.left {
59
60
    left: -100%;
  }
61
  > .active.right {
62
63
    left: 100%;
  }
64

65
}
66

67
68
69
70
71
72
73
74
75
76
77
78
79
// Left/right controls for nav
// ---------------------------

.carousel-control {
  position: absolute;
  top: 40%;
  left: 15px;
  width: 40px;
  height: 40px;
  margin-top: -20px;
  font-size: 60px;
  font-weight: 100;
  line-height: 30px;
Jon Stevens's avatar
Jon Stevens committed
80
  color: @white;
81
  text-align: center;
82
  background: @grayDarker;
Jon Stevens's avatar
Jon Stevens committed
83
  border: 3px solid @white;
84
85
  .border-radius(23px);
  .opacity(50);
Jacob Thornton's avatar
blah    
Jacob Thornton committed
86
87
88
89
90
91
92

  // we can't have this transition here
  // because webkit cancels the carousel
  // animation if you trip this while
  // in the middle of another animation
  // ;_;
  // .transition(opacity .2s linear);
93
94
95
96
97
98
99
100
101

  // Reposition the right one
  &.right {
    left: auto;
    right: 15px;
  }

  // Hover state
  &:hover {
102
    color: @white;
103
    text-decoration: none;
104
    .opacity(90);
105
106
107
  }
}

108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
// Carousel indicator pips
// -----------------------------
.carousel-indicators {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 5;
  margin: 0;
  list-style: none;

  li {
    display: block;
    float: left;
    width: 10px;
    height: 10px;
    margin-left: 5px;
    text-indent: -999px;
    background-color: #ccc;
    background-color: rgba(255,255,255,.25);
    border-radius: 5px;
  }
  .active {
    background-color: #fff;
  }
}
133

134
135
136
137
138
139
140
141
// Caption for text below images
// -----------------------------

.carousel-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
142
  padding: 15px;
143
  background: @grayDark;
144
145
146
147
  background: rgba(0,0,0,.75);
}
.carousel-caption h4,
.carousel-caption p {
148
  color: @white;
149
150
151
152
153
154
155
  line-height: @baseLineHeight;
}
.carousel-caption h4 {
  margin: 0 0 5px;
}
.carousel-caption p {
  margin-bottom: 0;
156
}