index.module.scss 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. @use "../theme";
  2. .copyButton {
  3. display: inline-flex;
  4. flex-flow: row nowrap;
  5. align-items: center;
  6. justify-content: center;
  7. gap: 0.5em;
  8. background: transparent;
  9. transition-property: background-color, color, border-color, outline-color;
  10. transition-duration: 100ms;
  11. transition-timing-function: linear;
  12. border: 1px solid transparent;
  13. outline-offset: 0;
  14. outline: theme.spacing(1) solid transparent;
  15. -webkit-tap-highlight-color: transparent;
  16. border-radius: theme.border-radius("base");
  17. cursor: pointer;
  18. line-height: 150%;
  19. padding-left: 0.25em;
  20. padding-right: 0.25em;
  21. margin-left: -0.25em;
  22. margin-right: -0.25em;
  23. .iconContainer {
  24. position: relative;
  25. height: 1em;
  26. width: 1em;
  27. .copyIcon {
  28. opacity: 0.5;
  29. transition: opacity 100ms linear;
  30. position: absolute;
  31. inset: 0;
  32. width: 100%;
  33. height: 100%;
  34. }
  35. .checkIcon {
  36. position: absolute;
  37. inset: 0;
  38. width: 100%;
  39. height: 100%;
  40. color: theme.color("states", "success", "normal");
  41. opacity: 0;
  42. transition: opacity 100ms linear;
  43. }
  44. }
  45. &[data-focus-visible] {
  46. border-color: theme.color("focus");
  47. outline-color: theme.color("focus-dim");
  48. }
  49. &[data-hovered] {
  50. background-color: theme.color("button", "outline", "background", "hover");
  51. }
  52. &[data-is-copied] {
  53. background-color: theme.color("states", "info", "background");
  54. .iconContainer {
  55. .copyIcon {
  56. opacity: 0;
  57. }
  58. .checkIcon {
  59. opacity: 1;
  60. }
  61. }
  62. }
  63. }