mirror of
https://github.com/sindresorhus/github-markdown-css.git
synced 2024-03-22 13:10:53 +08:00
fix body font size regression
This commit is contained in:
parent
cbefe8761f
commit
9bee1ac647
|
@ -88,7 +88,6 @@
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.markdown-body,
|
|
||||||
.markdown-body input {
|
.markdown-body input {
|
||||||
font: 13px Helvetica, arial, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
|
font: 13px Helvetica, arial, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
|
||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
|
|
13
index.js
13
index.js
|
@ -57,13 +57,19 @@ function cleanupCss(str) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// remove `body` from `body, input {}`
|
||||||
|
if (el.selectors[0] === 'body' && el.selectors[1] === 'input') {
|
||||||
|
el.selectors.shift();
|
||||||
|
}
|
||||||
|
|
||||||
if (el.selectors.length === 1 && /^(?:html|body)$/.test(el.selectors[0])) {
|
if (el.selectors.length === 1 && /^(?:html|body)$/.test(el.selectors[0])) {
|
||||||
el.declarations = el.declarations.filter(function (declaration) {
|
el.declarations = el.declarations.filter(function (declaration) {
|
||||||
if (!/^font|^(?:line-height|color)$|text-size-adjust$/.test(declaration.property)) {
|
// remove everything from body/html other than these
|
||||||
return false;
|
if (/^font|^(?:line-height|color)$|text-size-adjust$/.test(declaration.property)) {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,6 +78,7 @@ function cleanupCss(str) {
|
||||||
selector = '.markdown-body';
|
selector = '.markdown-body';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!/\.markdown-body/.test(selector)) {
|
if (!/\.markdown-body/.test(selector)) {
|
||||||
selector = '.markdown-body ' + selector;
|
selector = '.markdown-body ' + selector;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user