mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-16 19:51:07 +02:00
278 lines
6.2 KiB
CSS
278 lines
6.2 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-1.5em tracking-0.02em hyphens-auto';
|
|
}
|
|
.heti:not(:lang(zh)):not(:lang(ja)):not(:lang(ko)) {
|
|
--at-apply: 'tracking-0';
|
|
}
|
|
|
|
/* Customized Post Title */
|
|
.heti .post-title {
|
|
--at-apply: 'mb-2 text-8.6 font-bold leading-12 c-primary lg:text-9';
|
|
}
|
|
|
|
/* KaTeX Formula 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),
|
|
.heti :where(h2),
|
|
.heti :where(h3),
|
|
.heti :where(h4),
|
|
.heti :where(h5),
|
|
.heti :where(h6) {
|
|
--at-apply: 'mt-6 mb-3 font-semibold';
|
|
}
|
|
.heti :where(h1) {
|
|
--at-apply: 'text-8 leading-12';
|
|
}
|
|
.heti :where(h2) {
|
|
--at-apply: 'text-6 leading-9';
|
|
}
|
|
.heti :where(h3) {
|
|
--at-apply: 'text-5 leading-9';
|
|
}
|
|
.heti :where(h4) {
|
|
--at-apply: 'text-4.5 leading-6';
|
|
}
|
|
.heti :where(h5) {
|
|
--at-apply: 'text-4 leading-6';
|
|
}
|
|
.heti :where(h6) {
|
|
--at-apply: 'text-3.5 leading-6';
|
|
}
|
|
.heti :where(h1),
|
|
.heti :where(h2),
|
|
.heti :where(h3) {
|
|
--at-apply: 'text-pretty tracking-0.05em';
|
|
}
|
|
.heti :where(h1:not(:lang(zh)):not(:lang(ja)):not(:lang(ko))),
|
|
.heti :where(h2:not(:lang(zh)):not(:lang(ja)):not(:lang(ko))),
|
|
.heti :where(h3:not(:lang(zh)):not(:lang(ja)):not(:lang(ko))) {
|
|
--at-apply: 'text-balance tracking-0';
|
|
}
|
|
.heti :where(h1 + h2),
|
|
.heti :where(h2 + h3),
|
|
.heti :where(h3 + h4),
|
|
.heti :where(h4 + h5),
|
|
.heti :where(h5 + h6) {
|
|
--at-apply: 'mt-3';
|
|
}
|
|
|
|
/* Paragraphs */
|
|
.heti :where(p) {
|
|
--at-apply: 'mb-4 text-justify text-pretty';
|
|
}
|
|
.heti :where(p:not(:lang(zh)):not(:lang(ja)):not(:lang(ko))) {
|
|
--at-apply: 'text-start';
|
|
}
|
|
|
|
/* Links */
|
|
.heti :where(a:not(.gc-container)) {
|
|
--at-apply: 'break-all font-medium tracking-0 underline decoration-secondary/40 underline-0.075em underline-offset-0.14em';
|
|
--at-apply: 'transition-colors hover:(c-primary decoration-secondary/80) lg:underline-0.1em';
|
|
}
|
|
|
|
/* Images */
|
|
.heti :where(img) {
|
|
--at-apply: 'mx-auto rounded cursor-zoom-in';
|
|
transform: translateZ(0);
|
|
-webkit-transform: translateZ(0);
|
|
}
|
|
.heti :where(figure) {
|
|
--at-apply: 'mx-auto mb-4';
|
|
}
|
|
.heti :where(figcaption) {
|
|
--at-apply: 'mt-2 text-center text-sm text-secondary/80';
|
|
}
|
|
|
|
/* Code Blocks */
|
|
.heti :where(pre) {
|
|
--at-apply: 'mb-4 px-4 py-3 overflow-auto uno-round-border bg-secondary/5!';
|
|
}
|
|
.heti pre :where(code) {
|
|
--at-apply: 'p-0 border-none bg-transparent';
|
|
}
|
|
html.dark .heti pre :where(span) {
|
|
--at-apply: 'text-[var(--shiki-dark)]!';
|
|
}
|
|
|
|
/* Inline Code */
|
|
.heti :where(code) {
|
|
--at-apply: 'px-0.4em py-0.2em text-0.85em tracking-0 uno-round-border bg-secondary/5';
|
|
counter-reset: line;
|
|
}
|
|
.heti :where(code:is(:lang(zh), :lang(ja), :lang(ko))) {
|
|
--at-apply: 'break-all';
|
|
}
|
|
.heti :where(code) span.line {
|
|
--at-apply: 'relative pl-8';
|
|
}
|
|
.heti :where(code) span.line::before {
|
|
--at-apply: 'absolute left-0 w-4 leading-1.9em text-secondary/40';
|
|
content: counter(line);
|
|
counter-increment: line;
|
|
direction: rtl;
|
|
}
|
|
|
|
/* Blockquotes */
|
|
.heti :where(blockquote) {
|
|
--at-apply: 'mb-4 px-4 py-0.5 c-secondary/80 border-l-4 border-solid border-secondary/25';
|
|
}
|
|
.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 block box-border table-fixed max-w-full overflow-x-auto scrollbar-hidden';
|
|
}
|
|
.heti :where(table)::-webkit-scrollbar {
|
|
--at-apply: 'hidden';
|
|
}
|
|
.heti :where(th),
|
|
.heti :where(td) {
|
|
--at-apply: 'px-3 py-1.5 border border-solid border-secondary/25';
|
|
}
|
|
.heti :where(th) {
|
|
--at-apply: 'bg-secondary/5';
|
|
}
|
|
|
|
/* 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: 'mt-0 mb-0.25em';
|
|
}
|
|
.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 text-0.75em leading-1 align-baseline';
|
|
}
|
|
.heti :where(sub) {
|
|
--at-apply: 'bottom--0.25em';
|
|
}
|
|
.heti :where(sup) {
|
|
--at-apply: 'top--0.5em';
|
|
}
|
|
|
|
/* Abbreviations */
|
|
.heti :where(abbr[title]) {
|
|
--at-apply: 'pb-0.25 no-underline border-b-1 border-dotted border-secondary cursor-help';
|
|
}
|
|
|
|
/* Wavy Underline */
|
|
.heti :where(u) {
|
|
--at-apply: 'underline underline-offset-0.25em decoration-wavy decoration-red-400';
|
|
}
|
|
html.dark .heti :where(u) {
|
|
--at-apply: 'decoration-red-400/80';
|
|
}
|
|
|
|
/* 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: 'py-0.25 text-inherit bg-[rgba(255,235,0,0.5)]';
|
|
}
|
|
html.dark .heti :where(mark) {
|
|
--at-apply: 'text-background';
|
|
}
|
|
|
|
/* Footnotes */
|
|
.heti sub :where(a),
|
|
.heti sup :where(a) {
|
|
--at-apply: 'no-underline';
|
|
}
|
|
.heti sup:target,
|
|
.heti sup a:target {
|
|
--at-apply: 'bg-[rgba(255,235,0,0.5)]';
|
|
}
|
|
html.dark .heti sup:target,
|
|
html.dark .heti sup a:target {
|
|
--at-apply: 'text-background';
|
|
}
|
|
.heti .data-footnote-backref {
|
|
--at-apply: 'no-underline font-serif';
|
|
}
|
|
|
|
/* 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:is(:lang(zh), :lang(ja), :lang(ko))) {
|
|
--at-apply: 'not-italic';
|
|
}
|
|
|
|
/* Quotes */
|
|
.heti :where(q) {
|
|
quotes: "「" "」" "『" "』";
|
|
}
|
|
.heti :where(q:not(:lang(zh)):not(:lang(ja)):not(:lang(ko))) {
|
|
quotes: initial;
|
|
quotes: auto;
|
|
}
|
|
|