colorPicker.scss 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. $module: #{$prefix}-colorPicker;
  2. .#{$module} {
  3. .colorChooseArea{
  4. box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
  5. position: relative;
  6. flex-grow: 1;
  7. border-color: transparent;
  8. border-radius: 8px 8px 0 0;
  9. background-image: linear-gradient(to top, #000, rgba(0, 0, 0, 0)),
  10. linear-gradient(to right, #fff, rgba(255, 255, 255, 0));
  11. }
  12. .interactive{
  13. position: absolute;
  14. left: 0;
  15. top: 0;
  16. right: 0;
  17. bottom: 0;
  18. border-radius: inherit;
  19. outline: none;
  20. /* Don't trigger the default scrolling behavior when the event is originating from this element */
  21. touch-action: none;
  22. }
  23. .handle{
  24. border-radius: 99999px;
  25. border: 2px solid var(--semi-color-white);
  26. position: absolute;
  27. box-sizing: border-box;
  28. cursor: grab;
  29. }
  30. @mixin rectBg{
  31. background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><rect x="8" width="8" height="8"/><rect y="8" width="8" height="8"/></svg>');
  32. }
  33. .alphaSlider{
  34. position: relative;
  35. cursor: pointer;
  36. @include rectBg;
  37. .alphaSliderInner{
  38. width: 100%;
  39. height: 100%;
  40. border-radius: 4px;
  41. }
  42. .alphaHandle{
  43. @include rectBg;
  44. border-radius: 99999px;
  45. border: 2px solid var(--semi-color-white);
  46. position: absolute;
  47. box-sizing: border-box;
  48. cursor: grab;
  49. }
  50. }
  51. .colorSlider{
  52. position: relative;
  53. cursor: pointer;
  54. background: linear-gradient(
  55. to right,
  56. #f00 0%,
  57. #ff0 17%,
  58. #0f0 33%,
  59. #0ff 50%,
  60. #00f 67%,
  61. #f0f 83%,
  62. #f00 100%
  63. );
  64. }
  65. .dataPart{
  66. display: flex;
  67. align-items: center;
  68. .colorDemoBlock{
  69. border-radius: 4px;
  70. }
  71. .inputGroup{
  72. margin-left: 4px;
  73. width: 100%;
  74. flex-wrap: nowrap;
  75. .colorPickerInput{
  76. }
  77. .colorPickerInputNumber{
  78. width: 100px;
  79. .inputNumberSuffix{
  80. font-size: 14px;
  81. padding: 0 4px;
  82. }
  83. }
  84. }
  85. .formatSelect{
  86. margin-left: 4px;
  87. width: 80px;
  88. }
  89. }
  90. }