gallery.less 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. .enable_image_gallery() when(@enable-image-gallery = true) {
  2. //gallery
  3. .ace-thumbnails {
  4. list-style: none;
  5. margin: 0;
  6. padding: 0;
  7. > li {
  8. float: left;
  9. display: block;
  10. position: relative;
  11. overflow: hidden;
  12. margin: 2px;
  13. border: 2px solid #333;
  14. > :first-child {
  15. display: block;
  16. position: relative;
  17. &:focus {
  18. outline: none;
  19. }
  20. }
  21. .tags {
  22. display: inline-block;
  23. position: absolute;
  24. bottom: 0;
  25. right: 0;
  26. //left: 0;
  27. overflow: visible;
  28. direction: rtl;
  29. //set these so that it's not confused with tags plugin
  30. padding: 0;
  31. margin: 0;
  32. height: auto;
  33. width: auto;
  34. background-color: transparent;
  35. border-width: 0;
  36. vertical-align: inherit;
  37. > .label-holder {
  38. .opacity(0.92);
  39. display: table;
  40. margin: 1px 0 0 0;
  41. direction: ltr;
  42. text-align: left;
  43. &:hover {
  44. .opacity(1);
  45. }
  46. }
  47. }
  48. > .tools {
  49. position: absolute;
  50. top: 0;
  51. bottom: 0;
  52. left: -30px;
  53. width: 24px;
  54. background-color: rgba(0,0,0,0.55);
  55. text-align: center;
  56. vertical-align: middle;
  57. .transition(~"all 0.2s ease");
  58. &.tools-right {
  59. left: auto;
  60. right: -30px;
  61. }
  62. &.tools-bottom {
  63. width: auto;
  64. height: 28px;
  65. left: 0;
  66. right: 0;
  67. top: auto;
  68. bottom: -30px;
  69. }
  70. &.tools-top {
  71. width: auto;
  72. height: 28px;
  73. left: 0;
  74. right: 0;
  75. top: -30px;
  76. bottom: auto;
  77. }
  78. }
  79. &:hover > {
  80. > .tools { left: 0; right: 0; }
  81. > .tools.tools-bottom { top: auto; bottom: 0; }
  82. > .tools.tools-top { bottom: auto; top: 0; }
  83. > .tools.tools-right { left: auto; right: 0; }
  84. }
  85. > .in {
  86. &.tools { left: 0; right: 0; }
  87. &.tools.tools-bottom { top: auto; bottom: 0; }
  88. &.tools.tools-top { bottom: auto; top: 0; }
  89. &.tools.tools-right { left: auto; right: 0; }
  90. }
  91. > .tools > a , > :first-child .inner a {
  92. display: inline-block;
  93. color: #FFF;
  94. font-size: @font-size-gallery-hover-tools;
  95. font-weight: normal;
  96. padding: 0 4px;
  97. &:hover {
  98. text-decoration: none;
  99. color: #C9E2EA;
  100. }
  101. }
  102. .tools.tools-bottom > a , .tools.tools-top > a {
  103. display: inline-block;
  104. }
  105. //the custom text on hover
  106. > :first-child > .text {
  107. position: absolute;
  108. right: 0;
  109. left: 0;
  110. bottom: 0;
  111. top: 0;
  112. text-align: center;
  113. color: #FFF;
  114. background-color:rgba(0,0,0,0.55);
  115. .opacity(0);
  116. .transition(~"all 0.2s ease");
  117. &:before {/* makes the inner text become vertically centered*/
  118. content: '';
  119. display: inline-block;
  120. height: 100%;
  121. vertical-align: middle;
  122. margin-right: 0; /* Adjusts for spacing */
  123. }
  124. > .inner {
  125. padding: 4px 0;
  126. margin: 0;
  127. display: inline-block;
  128. vertical-align: middle;
  129. max-width: 90%;
  130. }
  131. }
  132. &:hover > :first-child > .text{
  133. .opacity(1);
  134. }
  135. }//li
  136. }
  137. //gallery
  138. @media only screen and (max-width: @screen-xs) {
  139. .ace-thumbnails {
  140. text-align: center;
  141. }
  142. .ace-thumbnails > li {
  143. float: none;
  144. display: inline-block;
  145. }
  146. }
  147. }
  148. .enable_image_gallery();