Skip to content

Commit

Permalink
ugly modification
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaolai committed Dec 8, 2022
1 parent af637c7 commit 9e6ac77
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 13 deletions.
6 changes: 4 additions & 2 deletions _site/heti-addon.js
Original file line number Diff line number Diff line change
Expand Up @@ -767,13 +767,15 @@
}

autoSpacing () {
document.addEventListener('DOMContentLoaded', () => {
const callback = () => {
const $$rootList = document.querySelectorAll(this.rootSelector);

for (let $$root of $$rootList) {
this.spacingElement($$root);
}
});
};
if (document.readyState === 'complete') setTimeout(callback);
else document.addEventListener('DOMContentLoaded', callback);
}
}

Expand Down
20 changes: 16 additions & 4 deletions _site/heti.css
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,6 @@
clear: both;
}

.heti:not(:lang(zh)):not(:lang(ja)):not(:lang(kr)), .heti:not(:lang(zh)) {
letter-spacing: 0;
}

.heti > *:first-child,
.heti section > *:first-child,
.heti td > *:first-child {
Expand Down Expand Up @@ -332,6 +328,22 @@
color: inherit;
}

.heti:not(:lang(zh)):not(:lang(ja)):not(:lang(kr)), .heti:not(:lang(zh)) {
letter-spacing: 0;
}

.heti a,
.heti abbr,
.heti code,
.heti heti-spacing,
.heti [lang="en-US"] {
/*
There should be no leeter-spacing between
English characters.
*/
letter-spacing: normal;
}

.heti h1,
.heti h2,
.heti h3,
Expand Down
26 changes: 19 additions & 7 deletions lib/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@
// 清容器浮动
@include clear-float();

// 非中文时不加间距
letter-spacing: $letter-spacing-medium;
@include non-cjk-block {
letter-spacing: $letter-spacing-normal;

}

// 清容器内首尾元素外边距
&,
section,
Expand Down Expand Up @@ -113,4 +106,23 @@
}
}
}

// 非中文时不加间距
letter-spacing: $letter-spacing-medium;
@include non-cjk-block {
letter-spacing: $letter-spacing-normal;

}

a,
abbr,
code,
heti-spacing,
[lang="en-US"] {
/*
There should be no leeter-spacing between
English characters.
*/
letter-spacing: normal;
}
}

0 comments on commit 9e6ac77

Please sign in to comment.