carousel.less 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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 {
  15. .item {
  16. display: none;
  17. position: relative;
  18. .transition(.6s ease-in-out left);
  19. }
  20. // Account for jankitude on images
  21. .item > img {
  22. display: block;
  23. line-height: 1;
  24. }
  25. .active,
  26. .next,
  27. .prev { display: block; }
  28. .active {
  29. left: 0;
  30. }
  31. .next,
  32. .prev {
  33. position: absolute;
  34. top: 0;
  35. width: 100%;
  36. }
  37. .next {
  38. left: 100%;
  39. }
  40. .prev {
  41. left: -100%;
  42. }
  43. .next.left,
  44. .prev.right {
  45. left: 0;
  46. }
  47. .active.left {
  48. left: -100%;
  49. }
  50. .active.right {
  51. left: 100%;
  52. }
  53. }
  54. // Left/right controls for nav
  55. // ---------------------------
  56. .carousel-control {
  57. position: absolute;
  58. top: 40%;
  59. left: 15px;
  60. width: 40px;
  61. height: 40px;
  62. margin-top: -20px;
  63. font-size: 60px;
  64. font-weight: 100;
  65. line-height: 30px;
  66. color: @white;
  67. text-align: center;
  68. background: @grayDarker;
  69. border: 3px solid @white;
  70. .border-radius(23px);
  71. .opacity(50);
  72. // we can't have this transition here
  73. // because webkit cancels the carousel
  74. // animation if you trip this while
  75. // in the middle of another animation
  76. // ;_;
  77. // .transition(opacity .2s linear);
  78. // Reposition the right one
  79. &.right {
  80. left: auto;
  81. right: 15px;
  82. }
  83. // Hover state
  84. &:hover {
  85. color: @white;
  86. text-decoration: none;
  87. .opacity(90);
  88. }
  89. }
  90. // Caption for text below images
  91. // -----------------------------
  92. .carousel-caption {
  93. position: absolute;
  94. left: 0;
  95. right: 0;
  96. bottom: 0;
  97. padding: 15px;
  98. background: @grayDark;
  99. background: rgba(0,0,0,.75);
  100. }
  101. .carousel-caption h4,
  102. .carousel-caption p {
  103. color: @white;
  104. line-height: @baseLineHeight;
  105. }
  106. .carousel-caption h4 {
  107. margin: 0 0 5px;
  108. }
  109. .carousel-caption p {
  110. margin-bottom: 0;
  111. }