fix body font size regression

This commit is contained in:
Sindre Sorhus 2014-09-01 00:41:10 +02:00
parent cbefe8761f
commit 9bee1ac647
2 changed files with 10 additions and 4 deletions

View File

@ -88,7 +88,6 @@
box-sizing: border-box;
}
.markdown-body,
.markdown-body input {
font: 13px Helvetica, arial, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
line-height: 1.4;

View File

@ -57,13 +57,19 @@ function cleanupCss(str) {
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])) {
el.declarations = el.declarations.filter(function (declaration) {
if (!/^font|^(?:line-height|color)$|text-size-adjust$/.test(declaration.property)) {
return false;
// remove everything from body/html other than these
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';
}
if (!/\.markdown-body/.test(selector)) {
selector = '.markdown-body ' + selector;
}