content-markdown.module.css 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. .root {
  2. display: flex;
  3. flex-direction: column;
  4. align-items: flex-start;
  5. gap: 1rem;
  6. [data-slot="expand-button"] {
  7. flex: 0 0 auto;
  8. padding: 2px 0;
  9. font-size: 0.857em;
  10. }
  11. [data-slot="markdown"] {
  12. display: -webkit-box;
  13. -webkit-box-orient: vertical;
  14. -webkit-line-clamp: 3;
  15. line-clamp: 3;
  16. overflow: hidden;
  17. [data-expanded] & {
  18. display: block;
  19. }
  20. font-size: 1em;
  21. line-height: 1.5;
  22. p,
  23. blockquote,
  24. ul,
  25. ol,
  26. dl,
  27. table,
  28. pre {
  29. margin-bottom: 1rem;
  30. }
  31. strong {
  32. font-weight: 600;
  33. }
  34. ol {
  35. list-style-position: inside;
  36. padding-left: 0.75rem;
  37. }
  38. ul {
  39. padding-left: 1.5rem;
  40. }
  41. h1,
  42. h2,
  43. h3,
  44. h4,
  45. h5,
  46. h6 {
  47. font-size: 1em;
  48. font-weight: 600;
  49. margin-bottom: 0.5rem;
  50. }
  51. & > *:last-child {
  52. margin-bottom: 0;
  53. }
  54. pre {
  55. --shiki-dark-bg: var(--sl-color-bg-surface) !important;
  56. background-color: var(--sl-color-bg-surface) !important;
  57. padding: 0.5rem 0.75rem;
  58. line-height: 1.6;
  59. font-size: 0.857em;
  60. white-space: pre-wrap;
  61. word-break: break-word;
  62. span {
  63. white-space: break-spaces;
  64. }
  65. }
  66. code {
  67. font-weight: 500;
  68. &:not(pre code) {
  69. &::before {
  70. content: "`";
  71. font-weight: 700;
  72. }
  73. &::after {
  74. content: "`";
  75. font-weight: 700;
  76. }
  77. }
  78. }
  79. table {
  80. border-collapse: collapse;
  81. width: 100%;
  82. }
  83. th,
  84. td {
  85. border: 1px solid var(--sl-color-border);
  86. padding: 0.5rem 0.75rem;
  87. text-align: left;
  88. }
  89. th {
  90. border-bottom: 1px solid var(--sl-color-border);
  91. }
  92. /* Remove outer borders */
  93. table tr:first-child th,
  94. table tr:first-child td {
  95. border-top: none;
  96. }
  97. table tr:last-child td {
  98. border-bottom: none;
  99. }
  100. table th:first-child,
  101. table td:first-child {
  102. border-left: none;
  103. }
  104. table th:last-child,
  105. table td:last-child {
  106. border-right: none;
  107. }
  108. }
  109. }