diffview.module.css 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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: auto;
  12. min-width: 0;
  13. align-items: flex-start;
  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: max-content;
  28. padding-left: 1.5ch;
  29. padding: 0.1875rem 0.5rem 0.1875rem 1.5ch;
  30. margin: 0;
  31. pre {
  32. background-color: var(--sl-color-bg-surface) !important;
  33. white-space: pre;
  34. code > span:empty::before {
  35. content: "\00a0";
  36. white-space: pre;
  37. display: inline-block;
  38. width: 0;
  39. }
  40. }
  41. }
  42. [data-diff-type="removed"] {
  43. background-color: var(--sl-color-red-low);
  44. pre {
  45. background-color: var(--sl-color-red-low) !important;
  46. }
  47. &::before {
  48. content: "-";
  49. position: absolute;
  50. left: 0.5ch;
  51. user-select: none;
  52. color: var(--sl-color-red-high);
  53. }
  54. }
  55. [data-diff-type="added"] {
  56. background-color: var(--sl-color-green-low);
  57. pre {
  58. background-color: var(--sl-color-green-low) !important;
  59. }
  60. &::before {
  61. content: "+";
  62. position: absolute;
  63. left: 0.6ch;
  64. user-select: none;
  65. color: var(--sl-color-green-high);
  66. }
  67. }