evOo-local/packages/chat-ui/src/markdown.web.css

304 lines
5.7 KiB
CSS

.rk-chat-markdown {
min-width: 0;
overflow-wrap: anywhere;
}
.rk-chat-markdown > :first-child,
.rk-chat-markdown > :first-child > :first-child {
margin-top: 0;
}
.rk-chat-markdown > :last-child,
.rk-chat-markdown > :last-child > :last-child {
margin-bottom: 0;
}
.rk-chat-markdown p,
.rk-chat-markdown blockquote,
.rk-chat-markdown pre,
.rk-chat-markdown table,
.rk-chat-markdown ul,
.rk-chat-markdown ol {
margin: 0.65em 0;
}
.rk-chat-markdown h1,
.rk-chat-markdown h2,
.rk-chat-markdown h3,
.rk-chat-markdown h4,
.rk-chat-markdown h5,
.rk-chat-markdown h6 {
margin: 0.9em 0 0.35em;
color: var(--foreground);
font-weight: 650;
line-height: 1.25;
}
.rk-chat-markdown h1 {
font-size: 1.35em;
}
.rk-chat-markdown h2 {
font-size: 1.2em;
}
.rk-chat-markdown h3,
.rk-chat-markdown h4,
.rk-chat-markdown h5,
.rk-chat-markdown h6 {
font-size: 1.05em;
}
.rk-chat-markdown ul,
.rk-chat-markdown ol {
padding-left: 1.45em;
}
.rk-chat-markdown ul {
list-style: disc;
}
.rk-chat-markdown ol {
list-style: decimal;
}
.rk-chat-markdown li + li {
margin-top: 0.25em;
}
.rk-chat-markdown li > p {
margin: 0.2em 0;
}
.rk-chat-markdown .contains-task-list,
.rk-chat-markdown .task-list-item {
list-style: none;
}
.rk-chat-markdown .contains-task-list {
padding-left: 0;
}
.rk-chat-markdown a {
color: var(--link);
text-decoration: underline;
text-decoration-color: color-mix(in srgb, var(--link) 55%, transparent);
text-underline-offset: 0.15em;
}
.rk-chat-markdown-external-link {
display: inline;
}
.rk-chat-markdown-external-icon {
display: inline-block;
width: 0.78em;
height: 0.78em;
margin-left: 0.16em;
vertical-align: 0.08em;
opacity: 0.82;
transition:
transform 0.14s ease,
opacity 0.14s ease;
}
.rk-chat-markdown-external-link:hover .rk-chat-markdown-external-icon {
opacity: 1;
transform: translate(1px, -1px);
}
.rk-chat-markdown a.rk-chat-markdown-citation {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 1.35em;
height: 1.35em;
padding: 0 0.38em;
margin-left: 0.18em;
border: 1px solid var(--border);
border-radius: 999px;
background: var(--muted);
color: var(--muted-foreground);
font-size: 0.74em;
font-weight: 560;
line-height: 1;
text-decoration: none;
vertical-align: 0.14em;
transition:
background-color 0.12s ease,
color 0.12s ease,
border-color 0.12s ease;
}
.rk-chat-markdown a.rk-chat-markdown-citation:hover {
background: var(--card);
color: var(--foreground);
border-color: var(--foreground);
}
.rk-chat-markdown-swatch {
display: inline-flex;
align-items: center;
gap: 0.34em;
padding: 0;
margin: 0;
border: 0;
background: transparent;
color: inherit;
font: inherit;
cursor: pointer;
vertical-align: baseline;
}
.rk-chat-markdown-swatch-dot {
display: inline-block;
width: 0.78em;
height: 0.78em;
border-radius: 0.22em;
border: 1px solid color-mix(in srgb, var(--foreground) 22%, transparent);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
flex-shrink: 0;
}
.rk-chat-markdown-swatch:hover code {
border-color: var(--foreground);
}
.rk-chat-markdown code {
border: 1px solid var(--border);
border-radius: 0.35em;
background: var(--muted);
color: var(--foreground);
padding: 0.08em 0.32em;
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
font-size: 0.88em;
direction: ltr;
unicode-bidi: isolate;
}
.rk-chat-markdown pre {
max-width: 100%;
overflow-x: auto;
border: 1px solid var(--border);
border-radius: 0.75em;
background: var(--card);
padding: 0.8em 0.9em;
direction: ltr;
unicode-bidi: isolate;
}
.rk-chat-markdown pre code {
border: 0;
background: transparent;
padding: 0;
font-size: 0.84em;
white-space: pre;
}
.rk-chat-markdown-pre-wrap {
position: relative;
margin: 0.65em 0;
}
.rk-chat-markdown .rk-chat-markdown-pre-wrap pre {
margin: 0;
}
.rk-chat-markdown-copy {
position: absolute;
top: 0.5em;
right: 0.5em;
display: flex;
align-items: center;
justify-content: center;
width: 1.75em;
height: 1.75em;
border: 1px solid var(--border);
border-radius: 0.4em;
background: var(--muted);
color: var(--muted-foreground);
opacity: 0;
transition: opacity 0.12s;
cursor: pointer;
}
.rk-chat-markdown-pre-wrap:hover .rk-chat-markdown-copy,
.rk-chat-markdown-copy:focus-visible {
opacity: 1;
}
.rk-chat-markdown-copy:hover {
background: var(--accent);
color: var(--foreground);
}
.rk-chat-markdown blockquote {
border-left: 3px solid var(--border);
padding-left: 0.85em;
}
.rk-chat-markdown table {
display: block;
max-width: 100%;
overflow-x: auto;
border-collapse: collapse;
font-size: 0.92em;
}
.rk-chat-markdown th,
.rk-chat-markdown td {
border: 1px solid var(--border);
padding: 0.4em 0.6em;
text-align: left;
/* Not the container's `anywhere`: its break opportunities count toward
min-content, so columns collapse to 1ch and the table never overflows. */
overflow-wrap: break-word;
}
.rk-chat-markdown th {
background: var(--muted);
color: var(--foreground);
font-weight: 600;
}
.rk-chat-markdown hr {
margin: 0.9em 0;
border: 0;
border-top: 1px solid var(--border);
}
.rk-chat-markdown img {
display: block;
max-width: 100%;
height: auto;
margin: 0.65em 0;
border-radius: 0.65em;
}
.rk-chat-markdown input[type="checkbox"] {
margin-right: 0.4em;
accent-color: var(--primary);
}
.rk-chat-markdown-streaming {
position: relative;
padding-right: 0.8em;
}
.rk-chat-markdown-cursor {
position: absolute;
right: 0;
bottom: 0.24em;
width: 0.16em;
height: 1em;
border-radius: 999px;
background: var(--muted-foreground);
animation: rkMarkdownCursor 1s steps(2, jump-none) infinite;
}
@keyframes rkMarkdownCursor {
50% {
opacity: 0;
}
}