blog/src/styles/heti.css

267 lines
6.1 KiB
CSS

/*!
* Project: Heti
* URL: https://github.com/sivan/heti
* Source: https://unpkg.com/heti/umd/heti.min.css
* Customized for Astro Theme Retypeset
*/
/* Global Styles */
.heti {
--at-apply: 'break-words leading-normal hyphens-auto cjk:tracking-0.02em';
}
/* Customized Post Title */
.heti .post-title {
--at-apply: 'mb-2 text-8.6 font-bold lg:text-9';
}
/* KaTeX Overflow Fix */
.heti .katex-display {
--at-apply: 'overflow-x-auto overflow-y-hidden scrollbar-hidden';
}
.heti .katex-display::-webkit-scrollbar {
display: none;
}
/* Headings */
.heti :where(h1, h2, h3, h4, h5, h6) {
--at-apply: 'mb-4 font-semibold';
}
.heti :where(h1, h2, h3) {
--at-apply: 'text-balance leading-1.33em cjk:text-pretty cjk:tracking-0.05em';
}
.heti :where(h1) {
--at-apply: 'mt-9.6 text-7 text-primary';
}
.heti :where(h2) {
--at-apply: 'mt-9.6 text-6 text-primary';
}
.heti :where(h3) {
--at-apply: 'mt-6.5 text-5';
}
.heti :where(h4) {
--at-apply: 'mt-6 text-4.5';
}
.heti :where(h5) {
--at-apply: 'mt-6 text-4';
}
.heti :where(h6) {
--at-apply: 'mt-6 font-normal';
}
.heti :where(h1 + h2, h2 + h3, h3 + h4, h4 + h5, h5 + h6) {
--at-apply: 'mt-4';
}
/* Paragraphs */
.heti :where(p) {
--at-apply: 'mb-4 text-pretty cjk:text-justify';
}
/* Links */
.heti :where(a:not(.gc-container)) {
--at-apply: 'break-all font-semibold tracking-0 underline underline-0.075em decoration-secondary/80 underline-offset-0.1em';
--at-apply: 'transition-colors duration-300 ease-out hover:(c-primary decoration-primary/80) lg:underline-0.1em';
}
/* Images */
.heti :where(img) {
--at-apply: 'mb-4 mx-auto cursor-zoom-in';
}
.heti :where(figure) {
--at-apply: 'mx-auto mb-4';
}
.heti figure img {
--at-apply: 'mb-0';
}
.heti :where(figcaption) {
--at-apply: 'mt-3 text-center text-sm text-secondary/80';
}
/* Video */
.heti :where(iframe) {
--at-apply: 'mb-4 w-full aspect-video';
}
/* Code Blocks */
.heti :where(pre) {
--at-apply: 'mb-4 overflow-auto uno-round-border px-4 py-3 bg-secondary/5!';
scrollbar-width: thin;
scrollbar-color: oklch(var(--un-preset-theme-colors-secondary) / 0) transparent;
transition: scrollbar-color 0.3s ease-out;
}
.heti :where(pre:hover) {
scrollbar-color: oklch(var(--un-preset-theme-colors-secondary) / 0.15) transparent;
}
.heti pre :where(code) {
--at-apply: 'border-none bg-transparent p-0';
}
html.dark .heti pre :where(span) {
--at-apply: 'text-[var(--shiki-dark)]!';
}
/* Inline Code */
.heti :where(code) {
--at-apply: 'uno-round-border bg-secondary/5 px-0.4em py-0.2em text-0.85em tracking-0 cjk:break-all';
counter-reset: line;
}
.heti :where(code) span.line {
--at-apply: 'relative pl-8';
}
.heti :where(code) span.line::before {
--at-apply: 'absolute left-0 w-4 text-secondary/40 leading-1.9em';
content: counter(line);
counter-increment: line;
direction: rtl;
}
/* Blockquotes */
.heti :where(blockquote) {
--at-apply: 'mb-4 border-l-4 border-secondary/25 border-solid px-4 py-0.5 c-secondary/80';
}
.heti blockquote[class*="admonition-"] {
--at-apply: 'py-1.5 c-secondary';
}
.heti blockquote blockquote {
--at-apply: 'py-0';
}
.heti blockquote > :first-child {
--at-apply: 'mt-0';
}
.heti blockquote > :last-child {
--at-apply: 'mb-0';
}
/* Tables */
.heti :where(table) {
--at-apply: 'mb-4 box-border block max-w-full table-fixed overflow-x-auto';
scrollbar-width: thin;
scrollbar-color: oklch(var(--un-preset-theme-colors-secondary) / 0) transparent;
transition: scrollbar-color 0.3s ease-out;
}
.heti :where(table:hover) {
scrollbar-color: oklch(var(--un-preset-theme-colors-secondary) / 0.15) transparent;
}
.heti :where(th),
.heti :where(td) {
--at-apply: 'border-b border-b-secondary/25 px-3 pb-1.5';
}
.heti :where(tr td:first-child),
.heti :where(tr th:first-child) {
--at-apply: 'pl-0';
}
.heti :where(tr td:last-child),
.heti :where(tr th:last-child) {
--at-apply: 'pr-0';
}
.heti :where(td) {
--at-apply: 'pt-1.5';
}
.heti :where(tr:last-child td) {
--at-apply: 'border-b-0';
}
/* Lists */
.heti :where(ul),
.heti :where(ol) {
--at-apply: 'mb-4 pl-2em';
}
.heti ul :where(ul),
.heti ul :where(ol),
.heti ol :where(ul),
.heti ol :where(ol) {
--at-apply: 'mb-0.25em mt-0';
}
.heti :where(ul) {
--at-apply: 'list-disc';
}
.heti :where(ol) {
--at-apply: 'list-decimal';
}
.heti ul :where(ul),
.heti ol :where(ul) {
--at-apply: 'list-circle';
}
.heti ul ul :where(ul),
.heti ul ol :where(ul),
.heti ol ul :where(ul),
.heti ol ol :where(ul) {
--at-apply: 'list-square';
}
.heti :where(li) {
--at-apply: 'mt-0.25em list-unset';
}
/* Superscript and Subscript >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> */
.heti :where(sub),
.heti :where(sup) {
--at-apply: 'relative mx-0.1em align-baseline text-0.75em';
}
.heti :where(sub) {
--at-apply: 'bottom--0.25em';
}
.heti :where(sup) {
--at-apply: 'top--0.5em';
}
/* Abbreviations */
.heti :where(abbr[title]) {
--at-apply: 'cursor-help border-b-1 border-secondary border-dotted pb-0.25 no-underline';
}
/* Wavy Underline */
.heti :where(u) {
--at-apply: 'underline decoration-red-400 underline-offset-0.25em decoration-wavy';
}
html.dark .heti :where(u) {
--at-apply: 'decoration-red-400/60';
}
/* Keyboard Input */
.heti :where(kbd) {
--at-apply: 'inline-block px-0.4em py-0.3em text-0.85em font-bold leading-none tracking-0';
--at-apply: 'uno-round-border border-secondary/40 text-secondary';
}
/* Highlighted Text */
.heti :where(mark) {
--at-apply: 'bg-mark py-0.65 text-inherit';
}
/* Footnotes */
.heti sub :where(a),
.heti sup :where(a) {
--at-apply: 'no-underline';
}
.heti sup:target,
.heti sup a:target {
--at-apply: 'bg-mark';
}
.heti .data-footnote-backref {
--at-apply: 'font-serif no-underline';
}
/* Horizontal Rules */
.heti :where(hr) {
--at-apply: 'mb-4 border-t-2 border-secondary/5';
}
/* Bold */
.heti :where(b),
.heti :where(strong) {
--at-apply: 'font-semibold';
}
/* Italic */
.heti :where(em) {
--at-apply: 'italic';
}
/* Cite */
.heti :where(cite) {
--at-apply: 'cjk:not-italic';
}
/* Quotes */
.heti :where(q:is(:lang(zh), :lang(ja), :lang(ko))) {
quotes: "「" "」" "『" "』";
}