Skip to content

Commit

Permalink
refactor: css rules for non-CJK blocks using a new function
Browse files Browse the repository at this point in the history
  • Loading branch information
kirklin committed Sep 22, 2023
1 parent b06169f commit adf0b96
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
9 changes: 5 additions & 4 deletions src/typography/css/other.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { getVariables } from "./variables";
import { getNonCjkBlockCss } from "./nonCjkBlock";

export const generateOtherCss = (selectorName: string) => {
return `
Expand Down Expand Up @@ -79,10 +80,10 @@ export const generateOtherCss = (selectorName: string) => {
text-emphasis: filled circle;
text-emphasis-position: under right;
}
.${selectorName} .${selectorName}-em:not(:lang(zh)):not(:lang(ja)):not(:lang(ko)), .${selectorName} .${selectorName}-em:not(:lang(zh)) {
-webkit-text-emphasis: none;
text-emphasis: none;
}
${getNonCjkBlockCss(`${selectorName}-em`, {
"-webkit-text-emphasis": "start",
"text-emphasis": "none",
})}
.${selectorName} .${selectorName}-ruby--inline {
display: inline-flex;
flex-direction: column-reverse;
Expand Down
4 changes: 0 additions & 4 deletions src/typography/preflights/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ export const ChineseBase = {
"text-align": "justify",
},

"p:not(:lang(zh)):not(:lang(ja)):not(:lang(ko))": {
"text-align": "start",
},

"pre": {
"margin-block-start": `calc(${getVariables.stdBlockUnit} * 0.5)`,
"margin-block-end": `calc(${getVariables.stdBlockUnit} * 0.5)`,
Expand Down

0 comments on commit adf0b96

Please sign in to comment.