_ui.figure.scss 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. @charset "utf-8";
  2. /*
  3. * @file: 图片列表基础UI组件
  4. * @update: 2015-06-05 16:45:29
  5. */
  6. /*
  7. * 默认图片列表
  8. * @base
  9. */
  10. $img-width: 228px; // 图片宽度
  11. $img-height: 128px; // 图片高度
  12. $item-margin-right: 10px; // item右方外边距
  13. $item-margin-bottom: 10px; // item下方外边距
  14. $mask-height: 24px; // 遮罩层高度
  15. $mask-line-height: 24px; // 遮罩层行高
  16. .ui-figure {
  17. margin-right: -$item-margin-right;
  18. font-size: 0; // 所有浏览器
  19. *word-spacing: -1px; // IE6/7
  20. }
  21. @media (-webkit-min-device-pixel-ratio:0) {
  22. .ui-figure {
  23. letter-spacing: -5px; // Safari 5- 等不支持 font-size: 0 的浏览器
  24. }
  25. }
  26. .ui-figure__item {
  27. @include inline-block(top, true);
  28. width: $img-width;
  29. margin-right: $item-margin-right;
  30. margin-bottom: $item-margin-bottom;
  31. font-size: 12px;
  32. letter-spacing: normal;
  33. word-spacing: normal;
  34. overflow: hidden;
  35. }
  36. .ui-figure__bd {
  37. position: relative;
  38. display: block;
  39. height: $img-height; // 如不需兼容IE6,可使用100%
  40. }
  41. a.ui-figure__bd {
  42. cursor: pointer;
  43. &:hover {
  44. text-decoration: none;
  45. }
  46. }
  47. .ui-figure__img {
  48. width: $img-width;
  49. height: $img-height;
  50. overflow: hidden;
  51. }
  52. .ui-figure__mask {
  53. position: absolute;
  54. right: 0;
  55. bottom: 0;
  56. width: 100%;
  57. height: $mask-height;
  58. line-height: $mask-line-height;
  59. text-indent: 5px;
  60. color: #fff;
  61. overflow: hidden;
  62. @include transparent(#000, .5, true);
  63. }
  64. .ui-figure__sign {
  65. float: left;
  66. margin-right: 5px;
  67. }
  68. .ui-figure__meta {
  69. display: block;
  70. margin-right: 5px;
  71. overflow: hidden;
  72. *zoom: 1;
  73. text-align: right;
  74. }
  75. .ui-figure__caption {
  76. display: block;
  77. margin-top: 5px;
  78. font-size: 12px;
  79. font-weight: normal;
  80. }
  81. /*
  82. * 以下为带变量参数的公用类,可方便拷贝并新建无冗余的扩展类
  83. */
  84. /*
  85. .ui-figure {
  86. &.ext-name {
  87. margin-right: -$item-margin-right;
  88. .ui-figure__item {
  89. width: $img-width;
  90. margin-right: $item-margin-right;
  91. margin-bottom: $item-margin-bottom;
  92. }
  93. .ui-figure__bd {
  94. height: $img-height; //如不需兼容IE6,可使用100%
  95. }
  96. .ui-figure__img {
  97. width: $img-width;
  98. height: $img-height;
  99. }
  100. .ui-figure__mask {
  101. height: $mask-height;
  102. line-height: $mask-line-height;
  103. text-indent: 5px;
  104. }
  105. }
  106. }
  107. */
  108. /*
  109. * 全屏封面
  110. * @extend: cover
  111. */
  112. .ui-figure {
  113. &.ext-cover {
  114. .ui-figure__bd {
  115. overflow: hidden;
  116. &:hover,
  117. &.is-hover {
  118. .ui-figure__mask {
  119. bottom: 0;
  120. }
  121. }
  122. }
  123. .ui-figure__mask {
  124. bottom: -100%;
  125. height: 100%;
  126. line-height: 1.5;
  127. text-indent: 0;
  128. transition: bottom .2s ease-out 0;
  129. -webkit-backface-visibility: hidden;
  130. -webkit-transform-style: preserve-3d;
  131. }
  132. }
  133. }
  134. /*
  135. * 遮罩自适应
  136. * @extend: autoMask
  137. */
  138. .ui-figure {
  139. &.ext-autoMask {
  140. .ui-figure__mask {
  141. width: auto;
  142. }
  143. }
  144. }
  145. /*
  146. * 无遮罩
  147. * @extend: noMask
  148. */
  149. .ui-figure {
  150. &.ext-noMask {
  151. .ui-figure__mask {
  152. background: none;
  153. filter: none;
  154. }
  155. }
  156. }
  157. /*
  158. * 有边框
  159. * @extend: border
  160. */
  161. $figure-border-color: #ddd;
  162. .ui-figure {
  163. &.ext-border {
  164. .ui-figure__item {
  165. padding: 2px;
  166. border: 1px solid $figure-border-color;
  167. }
  168. .ui-figure__caption {
  169. padding: 0 5px 5px;
  170. }
  171. }
  172. }