carousel.less 2.17 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
.carousel-inner {
Mark Otto's avatar
Mark Otto committed
13
  position: relative;
14
15
16
  overflow: hidden;
  width: 100%;
}
17

18
.carousel {
19
20
21
22
23
24
25

  .item {
    display: none;
    position: relative;
    .transition(.6s ease-in-out left);
  }

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

Jacob Thornton's avatar
blah    
Jacob Thornton committed
32
33
  .active,
  .next,
34
  .prev { display: block; }
35

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

Jacob Thornton's avatar
blah    
Jacob Thornton committed
40
  .next,
41
  .prev {
42
43
44
45
46
    position: absolute;
    top: 0;
    width: 100%;
  }

47
48
49
50
51
52
  .next {
    left: 100%;
  }
  .prev {
    left: -100%;
  }
Jacob Thornton's avatar
blah    
Jacob Thornton committed
53
  .next.left,
54
55
56
57
58
59
60
61
62
63
  .prev.right {
    left: 0;
  }

  .active.left {
    left: -100%;
  }
  .active.right {
    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
75
  top: 0;
  left: 0;
  bottom: 0;
  width: 100px;
76
  .opacity(50);
Jacob Thornton's avatar
blah    
Jacob Thornton committed
77

Mark Otto's avatar
Mark Otto committed
78
79
80
81
82
  &.left {
    #gradient > .horizontal(rgba(0,0,0,.75), rgba(0,0,0,.001));
    background-color: transparent;
  }

Jacob Thornton's avatar
blah    
Jacob Thornton committed
83
84
85
86
87
88
  // 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);
89
90
91
92

  // Reposition the right one
  &.right {
    left: auto;
Mark Otto's avatar
Mark Otto committed
93
94
95
    right: 0;
    #gradient > .horizontal(rgba(0,0,0,.001), rgba(0,0,0,.75));
    background-color: transparent;
96
97
98
99
  }

  // Hover state
  &:hover {
100
    color: @white;
101
    text-decoration: none;
102
    .opacity(90);
103
104
  }
}
Mark Otto's avatar
Mark Otto committed
105
106
107
108
109
110
111
112
113
114
115
116
.carousel-control .control {
  position: absolute;
  top: 50%;
  z-index: 5;
  display: block;
  margin-top: -35px;
  margin-left: 35px;
  font-size: 80px;
  font-weight: 100;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
}
117

118

119
120
121
122
123
124
125
126
// Caption for text below images
// -----------------------------

.carousel-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
Mark Otto's avatar
Mark Otto committed
127
128
129
130
  z-index: 10;
  padding: 40px;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
  max-width: 60%;
131
}
Mark Otto's avatar
Mark Otto committed
132
.carousel-caption h3,
133
.carousel-caption p {
134
  color: @white;
135
136
  line-height: @baseLineHeight;
}
Mark Otto's avatar
Mark Otto committed
137
.carousel-caption h3 {
138
139
140
141
  margin: 0 0 5px;
}
.carousel-caption p {
  margin-bottom: 0;
142
}