mixin.scss 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // mixin
  2. // 清除浮动
  3. @mixin clearfix {
  4. &:after {
  5. content: "";
  6. display: table;
  7. clear: both;
  8. }
  9. }
  10. // 多行隐藏
  11. @mixin textoverflow($clamp:1) {
  12. display: block;
  13. overflow: hidden;
  14. text-overflow: ellipsis;
  15. -o-text-overflow: ellipsis;
  16. display: -webkit-box;
  17. -webkit-line-clamp: $clamp;
  18. /*! autoprefixer: ignore next */
  19. -webkit-box-orient: vertical;
  20. }
  21. //flex box
  22. @mixin flexbox($jc:space-between, $ai:center, $fd:row, $fw:nowrap) {
  23. display: flex;
  24. display: -webkit-flex;
  25. flex: 1;
  26. justify-content: $jc;
  27. -webkit-justify-content: $jc;
  28. align-items: $ai;
  29. -webkit-align-items: $ai;
  30. flex-direction: $fd;
  31. -webkit-flex-direction: $fd;
  32. flex-wrap: $fw;
  33. -webkit-flex-wrap: $fw;
  34. }
  35. @keyframes slidefade {
  36. 0% {
  37. opacity: 0;
  38. transform: translateX(0);
  39. }
  40. 70% {
  41. opacity: 1;
  42. transform: translateX(-30%);
  43. }
  44. 100% {
  45. opacity: 0;
  46. transform: translateX(-30%);
  47. }
  48. }
  49. @keyframes downfade {
  50. 0% {
  51. opacity: 0;
  52. transform: translateY(0);
  53. }
  54. 70% {
  55. opacity: 1;
  56. transform: translateY(20%);
  57. }
  58. 100% {
  59. opacity: 0;
  60. transform: translateY(20%);
  61. }
  62. }