carousel.less 1.46 KB
Newer Older
1
2
3
4
// CAROUSEL
// --------

.carousel {
5
6
7
  position: relative;
  line-height: 1;
}
8

9
10
11
.carousel-inner {
  overflow: hidden;
  width: 100%;
12
  position: relative;
13
}
14

15
.carousel {
16
17
18
19
20
21
22

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

23
24
25
  .active, 
  .next, 
  .prev { display: block; }
26

27
28
29
  .active {
    left: 0;
  }
30

31
32
  .next, 
  .prev {
33
34
35
36
37
    position: absolute;
    top: 0;
    width: 100%;
  }

38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
  .next {
    left: 100%;
  }
  .prev {
    left: -100%;
  }
  .next.left, 
  .prev.right {
    left: 0;
  }

  .active.left {
    left: -100%;
  }
  .active.right {
    left: 100%;
  }
55

56
}
57

58
59
60
61
62
63
64
65
66
67
68
69
70
// 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
71
  color: @white;
72
  text-align: center;
73
  background: @grayDarker;
Jon Stevens's avatar
Jon Stevens committed
74
  border: 3px solid @white;
75
76
77
  .border-radius(23px);
  .opacity(50);
  .transition(all .2s linear);
78
79
80
81
82
83
84
85
86

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

  // Hover state
  &:hover {
87
    color: @white;
88
    text-decoration: none;
89
    .opacity(90);
90
91
92
93
94
95
96
97
98
99
100
101
  }
}

// Caption for text below images
// -----------------------------

.carousel-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 15px 5px;
102
  background: @grayDark;
103
104
105
106
  background: rgba(0,0,0,.75);
}
.carousel-caption h4,
.carousel-caption p {
107
  color: @white;
108
}