global.scss 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. @charset "utf-8";
  2. /*主色调*/
  3. $color: #ed4747;
  4. /*文字文本*/
  5. @mixin text($fontsize,$color,$height,$line-height){
  6. font-size: $fontsize;
  7. color:$color;
  8. height:$height;
  9. line-height: $line-height;
  10. }
  11. /*单行省略号*/
  12. @mixin ellipsis($width){
  13. width: $width;
  14. overflow: hidden;
  15. text-overflow: ellipsis;
  16. white-space: nowrap;
  17. word-wrap: normal;
  18. }
  19. /*多行省略号*/
  20. @mixin ellipsisLn($line){
  21. overflow: hidden;
  22. text-overflow: ellipsis;
  23. display: -webkit-box;
  24. -webkit-box-orient: vertical;
  25. -webkit-line-clamp: $line;
  26. }
  27. /*箭头*/
  28. @mixin setArrow($arrowsize,$borderColor,$borderWidth,$direction){
  29. display: inline-block;
  30. height: $arrowsize;
  31. width: $arrowsize;
  32. border-width: $borderWidth $borderWidth 0 0;
  33. border-color: $borderColor;
  34. border-style: solid;
  35. @if $direction == bottom{
  36. transform: rotate(135deg);
  37. }
  38. @else if $direction == top{
  39. transform: rotate(-45deg);
  40. }
  41. @else if $direction == right{
  42. transform: rotate(45deg);
  43. }
  44. @else if $direction == left{
  45. transform: rotate(-135deg);
  46. }
  47. }
  48. /**a标签hoverboder效果**/
  49. @mixin hoverBorder($color){
  50. position: relative;
  51. &:before{
  52. content:'';
  53. display: inline-block;
  54. position: absolute;
  55. width: 100%;
  56. bottom: 0;
  57. left: 0;
  58. border-bottom: 1px solid $color;
  59. transform: translateY(6px);
  60. opacity: 0;
  61. transition: all .5s ease;
  62. }
  63. &:hover{
  64. &:before{
  65. transform: translateY(2px);
  66. opacity: 1;
  67. }
  68. }
  69. }
  70. /**使用vw适配**/
  71. @function px2vw($px){
  72. @return calc(100vw * (#{$px} / 375));
  73. }