mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Added ghost scope to CSS variable
refs 74fe765410
- Added scoping to the global CSS variable being set by Ghost to prevent theme conflicts and create a forwards compatible pattern
This commit is contained in:
parent
74fe765410
commit
acd7e41e21
2 changed files with 3 additions and 3 deletions
|
@ -175,7 +175,7 @@ module.exports = function ghost_head(options) { // eslint-disable-line camelcase
|
|||
|
||||
if (settingsCache.get('accent_color')) {
|
||||
const accentColor = escapeExpression(settingsCache.get('accent_color'));
|
||||
const styleTag = `<style>:root {--accent-color: ${accentColor};}</style>`;
|
||||
const styleTag = `<style>:root {--ghost-accent-color: ${accentColor};}</style>`;
|
||||
const existingScriptIndex = _.findLastIndex(head, str => str.match(/<\/(style|script)>/));
|
||||
|
||||
if (existingScriptIndex) {
|
||||
|
|
|
@ -1570,7 +1570,7 @@ describe('{{ghost_head}} helper', function () {
|
|||
}
|
||||
})).then(function (rendered) {
|
||||
should.exist(rendered);
|
||||
rendered.string.should.containEql('<style>:root {--accent-color: #123456;}</style>');
|
||||
rendered.string.should.containEql('<style>:root {--ghost-accent-color: #123456;}</style>');
|
||||
done();
|
||||
}).catch(done);
|
||||
});
|
||||
|
@ -1591,7 +1591,7 @@ describe('{{ghost_head}} helper', function () {
|
|||
}
|
||||
})).then(function (rendered) {
|
||||
should.exist(rendered);
|
||||
rendered.string.should.not.containEql('--accent-color');
|
||||
rendered.string.should.not.containEql('--ghost-accent-color');
|
||||
done();
|
||||
}).catch(done);
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue