CSS: Move author color padding to `setAuthorStyle()`

This prevents the padding from clashing with plugins that use the
`aceSetAuthorStyle` hook.
pull/5093/head
Richard Hansen 2021-06-18 17:20:52 -04:00
parent 2745557127
commit 3d40ab7e8c
2 changed files with 10 additions and 15 deletions

View File

@ -58,11 +58,6 @@ html.outer-editor, html.inner-editor {
color: inherit; color: inherit;
} }
#innerdocbody.authorColors span {
padding-top: 3px;
padding-bottom: 4px;
}
option { option {
text-transform: capitalize; text-transform: capitalize;
} }

View File

@ -226,18 +226,18 @@ function Ace2Inner(editorInfo, cssManagers) {
if ((typeof info.fade) === 'number') { if ((typeof info.fade) === 'number') {
bgcolor = fadeColor(bgcolor, info.fade); bgcolor = fadeColor(bgcolor, info.fade);
} }
const authorStyle = cssManagers.inner.selectorStyle(authorSelector);
const parentAuthorStyle = cssManagers.parent.selectorStyle(authorSelector);
// author color
authorStyle.backgroundColor = bgcolor;
parentAuthorStyle.backgroundColor = bgcolor;
const textColor = const textColor =
colorutils.textColorFromBackgroundColor(bgcolor, parent.parent.clientVars.skinName); colorutils.textColorFromBackgroundColor(bgcolor, parent.parent.clientVars.skinName);
authorStyle.color = textColor; const styles = [
parentAuthorStyle.color = textColor; cssManagers.inner.selectorStyle(authorSelector),
cssManagers.parent.selectorStyle(authorSelector),
];
for (const style of styles) {
style.backgroundColor = bgcolor;
style.color = textColor;
style['padding-top'] = '3px';
style['padding-bottom'] = '4px';
}
} }
}; };