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

5
6

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

12
.carousel-inner {
Mark Otto's avatar
Mark Otto committed
13
  position: relative;
14
15
16
  overflow: hidden;
  width: 100%;
}
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
// Left/right controls for nav
// ---------------------------

.carousel-control {
  position: absolute;
Mark Otto's avatar
Mark Otto committed
72
73
74
  top: 0;
  left: 0;
  bottom: 0;
Mark Otto's avatar
Mark Otto committed
75
  width: 120px;
76
  .opacity(50);
Jacob Thornton's avatar
blah    
Jacob Thornton committed
77
78
79
80
81
82
83

  // 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);
84

Mark Otto's avatar
Mark Otto committed
85
86
87
88
89
  // Set gradients for backgrounds
  &.left {
    #gradient > .horizontal(rgba(0,0,0,.75), rgba(0,0,0,.001));
    background-color: transparent;
  }
90
91
  &.right {
    left: auto;
Mark Otto's avatar
Mark Otto committed
92
93
94
    right: 0;
    #gradient > .horizontal(rgba(0,0,0,.001), rgba(0,0,0,.75));
    background-color: transparent;
95
96
97
98
  }

  // Hover state
  &:hover {
99
    color: #fff;
100
    text-decoration: none;
101
    .opacity(90);
102
  }
Mark Otto's avatar
Mark Otto committed
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119

  // Toggles
  .control {
    position: absolute;
    top: 50%;
    z-index: 5;
    display: block;
    margin-top: -35px;
    margin-left: 30px;
    font-size: 80px;
    font-weight: 100;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,.6);
  }
  &.right .control {
    margin-left: 70px;
  }
120
}
Mark Otto's avatar
Mark Otto committed
121

122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
// 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;
  }
}
147

148

149
150
151
152
153
154
155
156
// Caption for text below images
// -----------------------------

.carousel-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
Mark Otto's avatar
Mark Otto committed
157
158
159
160
  z-index: 10;
  padding: 40px;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
  max-width: 60%;
161
}
Mark Otto's avatar
Mark Otto committed
162
.carousel-caption h3,
163
.carousel-caption p {
164
  color: #fff;
165
  line-height: @line-height-base;
166
}
Mark Otto's avatar
Mark Otto committed
167
.carousel-caption h3 {
168
169
170
171
  margin: 0 0 5px;
}
.carousel-caption p {
  margin-bottom: 0;
172
}