mixin.scss 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. @charset "utf-8";
  2. //主题色
  3. $themeColor: #ea552d;
  4. @mixin theme($type,$path:''){
  5. @if $type == "btn_bg" {
  6. background-image: linear-gradient(90deg, #ea552d 0%, #f19837 100%);
  7. } @else if $type == "unselected_img" {
  8. background-image: url($path + "static/icon/ic_gender_unselected.png");
  9. } @else if $type == "check_img" {
  10. background-image: url($path + "static/icon/ic_agreed.png");
  11. } @else if $type == "radio_img" {
  12. background-image: url($path + "static/icon/ic_gender_selected.png");
  13. }
  14. }
  15. // 背景图片地址和大小
  16. @mixin bis($url, $size: cover) {
  17. background-image: url($url);
  18. background-repeat: no-repeat;
  19. background-position: center center;
  20. background-size: $size;
  21. }
  22. // 头像
  23. @mixin ic($width, $height) {
  24. display: flex;
  25. align-items: center;
  26. justify-content: center;
  27. overflow: hidden;
  28. flex-shrink: 0;
  29. width: $width;
  30. height: $height;
  31. }
  32. // 单行省略号
  33. @mixin toe() {
  34. overflow: hidden;
  35. text-overflow: ellipsis;
  36. white-space: nowrap
  37. }
  38. // 多行省略号
  39. @mixin bov($num:2) {
  40. overflow: hidden;
  41. text-overflow: ellipsis;
  42. display: -webkit-box;
  43. -webkit-line-clamp: $num;
  44. -webkit-box-orient: vertical;
  45. }