fix .octoicons font name - fixes #9

This commit is contained in:
Sindre Sorhus 2014-09-01 01:13:09 +02:00
parent 9bee1ac647
commit 8efcd68fd0
2 changed files with 12 additions and 2 deletions

View File

@ -748,7 +748,7 @@
}
.markdown-body .octicon {
font: normal normal 16px octicons;
font: normal normal 16px octicons-anchor;
line-height: 1;
display: inline-block;
text-decoration: none;

View File

@ -62,6 +62,17 @@ function cleanupCss(str) {
el.selectors.shift();
}
// rename the .octoicons font
if (el.selectors[0] === '.octicon') {
el.declarations = el.declarations.map(function (el) {
if (el.property === 'font') {
el.value += '-anchor';
}
return el;
});
}
if (el.selectors.length === 1 && /^(?:html|body)$/.test(el.selectors[0])) {
el.declarations = el.declarations.filter(function (declaration) {
// remove everything from body/html other than these
@ -78,7 +89,6 @@ function cleanupCss(str) {
selector = '.markdown-body';
}
if (!/\.markdown-body/.test(selector)) {
selector = '.markdown-body ' + selector;
}