diffview.module.css 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. .diff {
  2. display: grid;
  3. grid-template-columns: 1fr 1fr;
  4. border: 1px solid var(--sl-color-divider);
  5. background-color: var(--sl-color-bg-surface);
  6. border-radius: 0.25rem;
  7. }
  8. .column {
  9. display: flex;
  10. flex-direction: column;
  11. overflow-x: visible;
  12. min-width: 0;
  13. align-items: stretch;
  14. &:first-child {
  15. border-right: 1px solid var(--sl-color-divider);
  16. }
  17. & > [data-section="cell"]:first-child {
  18. padding-top: 0.5rem;
  19. }
  20. & > [data-section="cell"]:last-child {
  21. padding-bottom: 0.5rem;
  22. }
  23. }
  24. [data-section="cell"] {
  25. position: relative;
  26. flex: none;
  27. width: 100%;
  28. padding: 0.1875rem 0.5rem 0.1875rem 2.2ch;
  29. margin: 0;
  30. pre {
  31. --shiki-dark-bg: var(--sl-color-bg-surface) !important;
  32. background-color: var(--sl-color-bg-surface) !important;
  33. white-space: pre-wrap;
  34. word-break: break-word;
  35. code > span:empty::before {
  36. content: "\00a0";
  37. white-space: pre;
  38. display: inline-block;
  39. width: 0;
  40. }
  41. }
  42. }
  43. [data-diff-type="removed"] {
  44. background-color: var(--sl-color-red-low);
  45. pre {
  46. --shiki-dark-bg: var(--sl-color-red-low) !important;
  47. background-color: var(--sl-color-red-low) !important;
  48. }
  49. &::before {
  50. content: "-";
  51. position: absolute;
  52. left: 0.5ch;
  53. user-select: none;
  54. color: var(--sl-color-red-high);
  55. }
  56. }
  57. [data-diff-type="added"] {
  58. background-color: var(--sl-color-green-low);
  59. pre {
  60. --shiki-dark-bg: var(--sl-color-green-low) !important;
  61. background-color: var(--sl-color-green-low) !important;
  62. }
  63. &::before {
  64. content: "+";
  65. position: absolute;
  66. left: 0.6ch;
  67. user-select: none;
  68. color: var(--sl-color-green-high);
  69. }
  70. }