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

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

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

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

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

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

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

66
}
67

68
69
70
71
72
// Left/right controls for nav
// ---------------------------

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

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

Mark Otto's avatar
Mark Otto committed
86
87
88
89
90
  // Set gradients for backgrounds
  &.left {
    #gradient > .horizontal(rgba(0,0,0,.75), rgba(0,0,0,.001));
    background-color: transparent;
  }
91
92
  &.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
100
  // Hover/focus state
  &:hover,
  &:focus {
101
    color: #fff;
102
    text-decoration: none;
103
    .opacity(90);
104
  }
Mark Otto's avatar
Mark Otto committed
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121

  // 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;
  }
122
}
Mark Otto's avatar
Mark Otto committed
123

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

150

151
152
153
154
155
156
157
158
// Caption for text below images
// -----------------------------

.carousel-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
Mark Otto's avatar
Mark Otto committed
159
160
161
162
  z-index: 10;
  padding: 40px;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
  max-width: 60%;
nextgenthemes's avatar
nextgenthemes committed
163
164
165
166
167
168
169
170
171
172
173
174

  h3,
  p {
    color: #fff;
    line-height: @line-height-base;
  }
  h3 {
    margin: 0 0 5px;
  }
  p {
    margin-bottom: 0;
  }
175
}