carousel.less 2.42 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
    display: none;
    position: relative;
    .transition(.6s ease-in-out left);

25
26
27
28
29
30
31
    // Account for jankitude on images
    > img,
    > a,
    > img > a {
      display: block;
      line-height: 1;
    }
32
33
  }

34
35
36
  > .active,
  > .next,
  > .prev { display: block; }
37

38
  > .active {
39
40
    left: 0;
  }
41

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

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

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

67
}
68

69
70
71
72
73
74
75
76
77
78
79
80
81
// 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
82
  color: @white;
83
  text-align: center;
84
  background: @grayDarker;
Jon Stevens's avatar
Jon Stevens committed
85
  border: 3px solid @white;
86
87
  .border-radius(23px);
  .opacity(50);
Jacob Thornton's avatar
blah    
Jacob Thornton committed
88
89
90
91
92
93
94

  // 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);
95
96
97
98
99
100
101
102
103

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

  // Hover state
  &:hover {
104
    color: @white;
105
    text-decoration: none;
106
    .opacity(90);
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
133
134
// 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;
  }
}
135

136
137
138
139
140
141
142
143
// Caption for text below images
// -----------------------------

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