copy-code.styl 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. .highlight-container {
  2. position: relative;
  3. }
  4. .highlight-container:hover .copy-btn, .highlight-container .copy-btn:focus {
  5. opacity: 1;
  6. }
  7. .copy-btn {
  8. color: $black-dim;
  9. cursor: pointer;
  10. line-height: 1.6;
  11. opacity: 0;
  12. padding: 2px 6px;
  13. position: absolute;
  14. the-transition();
  15. if (hexo-config('codeblock.copy_button.style') == 'flat') {
  16. background: white;
  17. border: 0;
  18. font-size: $font-size-smaller;
  19. right: 0;
  20. top: 0;
  21. } else if (hexo-config('codeblock.copy_button.style') == 'mac') {
  22. color: white;
  23. font-size: 14px;
  24. right: 0;
  25. top: 2px;
  26. } else {
  27. background-color: $gainsboro;
  28. background-image: linear-gradient(#fcfcfc, $gainsboro);
  29. border: 1px solid #d5d5d5;
  30. border-radius: 3px;
  31. font-size: $font-size-smaller;
  32. right: 4px;
  33. top: 8px;
  34. }
  35. }
  36. if (hexo-config('codeblock.copy_button.style') == 'mac') {
  37. .highlight-container {
  38. background: #21252b;
  39. border-radius: 5px;
  40. box-shadow: 0 10px 30px 0 rgba(0, 0, 0, .4);
  41. padding-top: 30px;
  42. &::before {
  43. background: #fc625d;
  44. border-radius: 50%;
  45. box-shadow: 20px 0 #fdbc40, 40px 0 #35cd4b;
  46. content: ' ';
  47. height: 12px;
  48. left: 12px;
  49. margin-top: -20px;
  50. position: absolute;
  51. width: 12px;
  52. }
  53. .highlight {
  54. border-radius: 0 0 5px 5px;
  55. .table-container {
  56. border-radius: 0 0 5px 5px;
  57. }
  58. }
  59. }
  60. }