1
0

carousel.less 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. //
  2. // Carousel
  3. // --------------------------------------------------
  4. .carousel {
  5. position: relative;
  6. margin-bottom: @baseLineHeight;
  7. line-height: 1;
  8. }
  9. .carousel-inner {
  10. overflow: hidden;
  11. width: 100%;
  12. position: relative;
  13. }
  14. .carousel-inner {
  15. > .item {
  16. display: none;
  17. position: relative;
  18. .transition(.6s ease-in-out left);
  19. // Account for jankitude on images
  20. > img,
  21. > a > img {
  22. display: block;
  23. line-height: 1;
  24. }
  25. }
  26. > .active,
  27. > .next,
  28. > .prev { display: block; }
  29. > .active {
  30. left: 0;
  31. }
  32. > .next,
  33. > .prev {
  34. position: absolute;
  35. top: 0;
  36. width: 100%;
  37. }
  38. > .next {
  39. left: 100%;
  40. }
  41. > .prev {
  42. left: -100%;
  43. }
  44. > .next.left,
  45. > .prev.right {
  46. left: 0;
  47. }
  48. > .active.left {
  49. left: -100%;
  50. }
  51. > .active.right {
  52. left: 100%;
  53. }
  54. }
  55. // Left/right controls for nav
  56. // ---------------------------
  57. .carousel-control {
  58. position: absolute;
  59. top: 40%;
  60. left: 15px;
  61. width: 40px;
  62. height: 40px;
  63. margin-top: -20px;
  64. font-size: 60px;
  65. font-weight: 100;
  66. line-height: 30px;
  67. color: @white;
  68. text-align: center;
  69. background: @grayDarker;
  70. border: 3px solid @white;
  71. .border-radius(23px);
  72. .opacity(50);
  73. // we can't have this transition here
  74. // because webkit cancels the carousel
  75. // animation if you trip this while
  76. // in the middle of another animation
  77. // ;_;
  78. // .transition(opacity .2s linear);
  79. // Reposition the right one
  80. &.right {
  81. left: auto;
  82. right: 15px;
  83. }
  84. // Hover/focus state
  85. &:hover,
  86. &:focus {
  87. color: @white;
  88. text-decoration: none;
  89. .opacity(90);
  90. }
  91. }
  92. // Carousel indicator pips
  93. // -----------------------------
  94. .carousel-indicators {
  95. position: absolute;
  96. top: 15px;
  97. right: 15px;
  98. z-index: 5;
  99. margin: 0;
  100. list-style: none;
  101. li {
  102. display: block;
  103. float: left;
  104. width: 10px;
  105. height: 10px;
  106. margin-left: 5px;
  107. text-indent: -999px;
  108. background-color: #ccc;
  109. background-color: rgba(255,255,255,.25);
  110. border-radius: 5px;
  111. }
  112. .active {
  113. background-color: #fff;
  114. }
  115. }
  116. // Caption for text below images
  117. // -----------------------------
  118. .carousel-caption {
  119. position: absolute;
  120. left: 0;
  121. right: 0;
  122. bottom: 0;
  123. padding: 15px;
  124. background: @grayDark;
  125. background: rgba(0,0,0,.75);
  126. }
  127. .carousel-caption h4,
  128. .carousel-caption p {
  129. color: @white;
  130. line-height: @baseLineHeight;
  131. }
  132. .carousel-caption h4 {
  133. margin: 0 0 5px;
  134. }
  135. .carousel-caption p {
  136. margin-bottom: 0;
  137. }