css: enhanced compatibility with the text-indent CSS property, closes #1267 (#1271)

This commit is contained in:
Huang Xin
2025-05-29 14:53:58 +08:00
committed by GitHub
parent ebdfc39ef6
commit b37a804192
+6 -3
View File
@@ -239,7 +239,7 @@ const getLayoutStyles = (
word-spacing: ${wordSpacing}px ${overrideLayout ? '!important' : ''};
letter-spacing: ${letterSpacing}px ${overrideLayout ? '!important' : ''};
text-indent: ${vertical ? textIndent * 1.2 : textIndent}em ${overrideLayout ? '!important' : ''};
text-align: ${justify ? 'justify' : 'inherit'} ${overrideLayout ? '!important' : ''};
text-align: ${justify ? 'justify' : ''} ${overrideLayout ? '!important' : ''};
-webkit-hyphens: ${hyphenate ? 'auto' : 'manual'};
hyphens: ${hyphenate ? 'auto' : 'manual'};
-webkit-hyphenate-limit-before: 3;
@@ -248,8 +248,7 @@ const getLayoutStyles = (
hanging-punctuation: allow-end last;
widows: 2;
}
p:has(> img:only-child), p:has(> span:only-child > img:only-child),
div[style*="text-align"] {
p:has(> img:only-child), p:has(> span:only-child > img:only-child) {
text-indent: unset !important;
}
p, div {
@@ -318,6 +317,10 @@ const getLayoutStyles = (
div.center *, p.center * { text-align: center; }
div.justify *, p.justify * { text-align: justify; }
.nonindent, .noindent {
text-indent: unset !important;
}
/* for the Gutenberg eBooks */
#pg-header * {
color: inherit !important;