mixin.less 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. @fcolor:#C31A00;
  2. .firbg(){
  3. background: #C31A00;
  4. }
  5. .secbg(){
  6. background: #F3F3F3;
  7. }
  8. .border(){
  9. border: 1px solid rgba(0,0,0,.2);
  10. }
  11. .testbg(){
  12. background: papayawhip;
  13. }
  14. .border-1px-bottom(@color){
  15. position: relative;
  16. &:after{
  17. display: block;
  18. position: absolute;
  19. left: 0;
  20. bottom: 0;
  21. width: 100%;
  22. border-top: 1px solid @color;
  23. content: ' ';
  24. }
  25. @media (-webkit-min-device-pixel-ratio: 1.5),(min-device-pixel-ratio: 1.5){
  26. &:after{
  27. -webkit-transform: scaleY(0.7);
  28. transform: scaleY(0.7);
  29. }
  30. }
  31. @media (-webkit-min-device-pixel-ratio: 2),(min-device-pixel-ratio: 2){
  32. &:after{
  33. -webkit-transform: scaleY(0.5);
  34. transform: scaleY(0.5);
  35. }
  36. }
  37. @media (-webkit-min-device-pixel-ratio: 3),(min-device-pixel-ratio: 3){
  38. &:after{
  39. -webkit-transform: scaleY(0.33);
  40. transform: scaleY(0.33);
  41. }
  42. }
  43. }
  44. .border-1px(@color){
  45. position: relative;
  46. margin-bottom: 20px;
  47. border:none;
  48. &:after{
  49. content: '';
  50. position: absolute;
  51. top: 0;
  52. left: 0;
  53. border: 1px solid @color;
  54. -webkit-box-sizing: border-box;
  55. box-sizing: border-box;
  56. width: 200%;
  57. height: 200%;
  58. -webkit-transform-origin: left top;
  59. transform-origin: left top;
  60. }
  61. @media (-webkit-min-device-pixel-ratio: 1.5),(min-device-pixel-ratio: 1.5){
  62. &:after{
  63. -webkit-transform: scale(0.7);
  64. transform: scale(0.7);
  65. }
  66. }
  67. @media (-webkit-min-device-pixel-ratio: 2),(min-device-pixel-ratio: 2){
  68. &:after{
  69. -webkit-transform: scale(0.5);
  70. transform: scale(0.5);
  71. }
  72. }
  73. @media (-webkit-min-device-pixel-ratio: 3),(min-device-pixel-ratio: 3){
  74. &:after{
  75. -webkit-transform: scale(0.33);
  76. transform: scale(0.33);
  77. }
  78. }
  79. }
  80. .border-none(){
  81. &:after{
  82. display: none;
  83. }
  84. }
  85. .flex-center(){
  86. display: -webkit-box;
  87. display: -moz-box;
  88. display: -mz-flexbox;
  89. display: flex;
  90. flex-wrap: wrap;
  91. align-items: center;
  92. justify-content: space-around;
  93. align-content: center;
  94. }
  95. .flex-center-between(){
  96. display: -webkit-box;
  97. display: -moz-box;
  98. display: -mz-flexbox;
  99. display: flex;
  100. flex-wrap: wrap;
  101. align-items: center;
  102. justify-content: space-between;
  103. align-content: center;
  104. }
  105. .flex-end(){
  106. display: -webkit-box;
  107. display: -moz-box;
  108. display: -mz-flexbox;
  109. display: flex;
  110. flex-wrap: wrap;
  111. align-items: center;
  112. justify-content: flex-end;
  113. align-content: center;
  114. }
  115. .flex-empty(){
  116. height:0;
  117. margin-top: 0;
  118. margin-bottom: 0;
  119. padding-top: 0;
  120. padding-bottom: 0;
  121. border-image:none;
  122. border:none;
  123. &:after{
  124. display: none;
  125. }
  126. }
  127. .flex-empty{
  128. .flex-empty();
  129. }
  130. .text-ellipsis(){
  131. white-space: nowrap;
  132. overflow: hidden;
  133. text-overflow: ellipsis;
  134. }
  135. .text-multi-ellipsis(@row){
  136. display: -webkit-box;
  137. -webkit-box-orient: vertical;
  138. -webkit-line-clamp: @row;
  139. overflow: hidden;
  140. }
  141. .border-img(){
  142. border:1px solid transparent;
  143. -webkit-border-image: url("../images/border-1px.png") .5 .5 .5 .5 stretch;
  144. border-image: url("../images/border-1px.png") .5 .5 .5 .5 stretch;
  145. }
  146. .clear(){
  147. &:after{
  148. content:"";
  149. display:block;
  150. clear:both;
  151. height:0;
  152. overflow:hidden;
  153. visibility:hidden;
  154. }
  155. zoom:1;
  156. }
  157. .lot-shadow(){
  158. box-shadow: 0 0 10px 10px #fff,0 0 15px 15px #DADADA;
  159. border-radius: 50%;
  160. }