code-copy.css 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. .code-block-container {
  2. position: relative;
  3. margin: 1em 0;
  4. background: #1e1e1e;
  5. }
  6. .code-header {
  7. position: absolute;
  8. top: 0.5rem;
  9. right: 0.5rem !important;
  10. z-index: 20;
  11. }
  12. .copy-button {
  13. background: #2d2d2d !important;
  14. border: 1px solid #404040 !important;
  15. cursor: pointer;
  16. padding: 0.4rem 0.8rem;
  17. display: flex;
  18. align-items: center;
  19. gap: 0.5rem;
  20. color: #ffffff !important;
  21. border-radius: 4px;
  22. transition: all 0.2s ease;
  23. font-size: 0.85em;
  24. line-height: 1;
  25. min-height: 32px;
  26. }
  27. .copy-button:hover {
  28. background-color: #404040 !important;
  29. border-color: #505050 !important;
  30. }
  31. .copy-button svg {
  32. width: 14px;
  33. height: 14px;
  34. stroke: currentColor;
  35. }
  36. .copy-button .button-text {
  37. color: #ffffff !important;
  38. }
  39. .copy-button .tooltip {
  40. visibility: hidden;
  41. position: absolute;
  42. top: -2.5rem;
  43. left: 50%;
  44. transform: translateX(-50%);
  45. background: #000000;
  46. color: #ffffff;
  47. padding: 0.4rem 0.8rem;
  48. border-radius: 4px;
  49. font-size: 0.75rem;
  50. white-space: nowrap;
  51. opacity: 0;
  52. transition: opacity 0.2s ease, visibility 0.2s ease;
  53. pointer-events: none;
  54. z-index: 30;
  55. }
  56. .copy-button.copied .tooltip {
  57. visibility: visible;
  58. opacity: 1;
  59. }
  60. .copy-button.copied {
  61. background-color: #1a4721 !important;
  62. border-color: #2ea043 !important;
  63. color: #3fb950 !important;
  64. }
  65. .code-content {
  66. position: relative;
  67. overflow-x: auto;
  68. padding: 1rem;
  69. }
  70. .copy-button .tooltip::after {
  71. content: '';
  72. position: absolute;
  73. top: 100%;
  74. left: 50%;
  75. transform: translateX(-50%);
  76. border-width: 5px;
  77. border-style: solid;
  78. border-color: #000000 transparent transparent transparent;
  79. }