mixin.styl 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. border-1px($color = #ccc, $radius = 2PX, $style = solid)
  2. position: relative
  3. &::after
  4. content: ""
  5. pointer-events: none
  6. display: block
  7. position: absolute
  8. left: 0
  9. top: 0
  10. transform-origin: 0 0
  11. border: 1PX $style $color
  12. border-radius: $radius
  13. box-sizing border-box
  14. width 100%
  15. height 100%
  16. @media (min-resolution: 2dppx)
  17. width: 200%
  18. height: 200%
  19. border-radius: $radius * 2
  20. transform: scale(.5)
  21. @media (min-resolution: 3dppx)
  22. width: 300%
  23. height: 300%
  24. border-radius: $radius * 3
  25. transform: scale(.333)
  26. border-none()
  27. &::before
  28. display: none
  29. &::after
  30. display: none
  31. flex-fix()
  32. flex: 1
  33. flex-basis: 0.000000001px
  34. width: 1%
  35. touch-active(type = orange)
  36. if (type == orange)
  37. &:active
  38. color: #fcc1a6
  39. background-color: rgba(250, 143, 84, .04)
  40. else
  41. &:active
  42. color: #c6c6c6
  43. background-color: rgba(0, 0, 0, .04)
  44. hide-scrollbar()
  45. &::-webkit-scrollbar
  46. width: 0
  47. height: 0
  48. bg-image($url, $ext = ".png")
  49. background-image: url($url + "@2x" + $ext)
  50. @media (min-resolution: 3dppx)
  51. background-image: url($url + "@3x" + $ext)
  52. functions = constant env
  53. safe-area-fn(fn, position)
  54. s("%s(safe-area-inset-%s)", fn, position)
  55. safe-area-mixin(property, position, important = false)
  56. for fn in functions
  57. {property} safe-area-fn(fn, position) important == true ? !important : unquote("")