style: add letter spacing to cjk header, navbar and post titles

This commit is contained in:
radishzzz 2025-05-11 00:52:02 +01:00
parent 385b5508aa
commit 9c1d2241d4
8 changed files with 25 additions and 64 deletions

View file

@ -17,7 +17,7 @@ const SubtitleTag = isPost ? 'div' : 'h2'
<header
class:list={[
isPost ? 'mb-10.8' : 'mb-10.5',
'lg:(uno-desktop-column top-20)',
'cjk:tracking-0.02em lg:(uno-desktop-column top-20)',
]}
>
<TitleTag

View file

@ -37,7 +37,7 @@ const navItems = [
class:list={[
isPost ? 'hidden lg:block' : '',
'mb-10.5 text-3.6 font-semibold leading-8.75 font-navbar',
'lg:(uno-desktop-column text-4 leading-9.72 bottom-50)',
'cjk:tracking-0.02em lg:(uno-desktop-column text-4 leading-9.72 bottom-50)',
]}
>
<ul>

View file

@ -39,7 +39,7 @@ function getPostPath(post: Post) {
{/* post title */}
<h3 class="inline">
<a
class="hover:c-primary"
class="cjk:tracking-0.02em hover:c-primary"
lg={isHome ? 'font-medium text-4.5' : ''}
href={getPostPath(post)}
transition:name={`post-${post.data.abbrlink || post.id}-${lang}`}

View file

@ -7,10 +7,7 @@
/* 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';
--at-apply: 'cjk:tracking-0.02em break-words leading-1.5em hyphens-auto';
}
/* Customized Post Title */
@ -48,12 +45,7 @@
.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';
--at-apply: 'cjk:text-pretty cjk:tracking-0.05em text-balance';
}
.heti :where(h1 + h2),
.heti :where(h2 + h3),
@ -65,10 +57,7 @@
/* 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';
--at-apply: 'cjk:text-justify mb-4 text-pretty';
}
/* Links */
@ -103,12 +92,9 @@ html.dark .heti pre :where(span) {
/* Inline Code */
.heti :where(code) {
--at-apply: 'px-0.4em py-0.2em text-0.85em tracking-0 uno-round-border bg-secondary/5';
--at-apply: 'cjk:break-all 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';
}
@ -266,16 +252,12 @@ html.dark .heti sup a:target {
}
/* Cite */
.heti :where(cite:is(:lang(zh), :lang(ja), :lang(ko))) {
--at-apply: 'not-italic';
.heti :where(cite) {
--at-apply: 'cjk:not-italic';
}
/* Quotes */
.heti :where(q) {
.heti :where(q:is(:lang(zh), :lang(ja), :lang(ko))) {
quotes: "「" "」" "『" "』";
}
.heti :where(q:not(:lang(zh)):not(:lang(ja)):not(:lang(ko))) {
quotes: initial;
quotes: auto;
}