mixin.less 883 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. @import '../settings/vars.less';
  2. .size(@width, @height: @width) {
  3. width: @width;
  4. height: @height;
  5. }
  6. .pseudo(@content: '') {
  7. content: @content;
  8. display: block;
  9. position: absolute;
  10. }
  11. .alignCenter(@left: 50%, @top: 50%, @translateX: -50%, @translateY: -50%){
  12. position: absolute;
  13. top: @top;
  14. left: @left;
  15. transform: translate(@translateX, @translateY);
  16. }
  17. .background-img(@title-img, @type-img, @position: center center, @b-size: cover, @repeat: no-repeat) {
  18. position: absolute;
  19. z-index: -10;
  20. top: 0;
  21. left: 0;
  22. right: 0;
  23. bottom: 0;
  24. background: url('@{path-img}/@{title-img}.@{type-img}') @position;
  25. background-size: @b-size;
  26. background-repeat: @repeat;
  27. }
  28. .background-color(@color) {
  29. position: absolute;
  30. z-index: -10;
  31. top: 0;
  32. left: 0;
  33. right: 0;
  34. bottom: 0;
  35. background-color: @color;
  36. }