Merge pull request #22495 from overleaf/revert-22468-td-bs5-ieee-overall-theme

Revert "Always apply overall dark theme with IEEE-branded editor and tear down ieee-stylesheet feature flag"

GitOrigin-RevId: 223b4816b02ba96212ea7e779e16770cd4f16949
This commit is contained in:
Tim Down
2024-12-13 09:05:33 +00:00
committed by Copybot
parent 11de9a366c
commit b2b398ba0d
7 changed files with 19 additions and 25 deletions
@@ -189,13 +189,13 @@ module.exports = function (webRouter, privateApiRouter, publicApiRouter) {
res.locals.getCssThemeModifier = function (
userSettings,
brandVariation,
enableIeeeBranding
ieeeStylesheetEnabled
) {
// Themes only exist in OL v2
if (Settings.overleaf != null) {
// The IEEE theme is no longer applied in the editor, which sets
// enableIeeeBranding to false, but is used in the IEEE portal
if (enableIeeeBranding && res.locals.isIEEE(brandVariation)) {
// The IEEE theme takes precedence over the user personal setting, i.e. a user with
// a theme setting of "light" will still get the IEE theme in IEEE branded projects.
if (ieeeStylesheetEnabled && res.locals.isIEEE(brandVariation)) {
return 'ieee-'
} else if (userSettings && userSettings.overallTheme != null) {
return userSettings.overallTheme
@@ -213,10 +213,11 @@ module.exports = function (webRouter, privateApiRouter, publicApiRouter) {
bootstrapVersion = 3
) {
// Pick which main stylesheet to use based on Bootstrap version
const bootstrap5Modifier = bootstrapVersion === 5 ? '-bootstrap-5' : ''
const computedThemeModifier = bootstrapVersion === 5 ? '' : themeModifier
return res.locals.buildStylesheetPath(
bootstrapVersion === 5
? 'main-style-bootstrap-5.css'
: `main-${themeModifier}style.css`
`main-${computedThemeModifier}style${bootstrap5Modifier}.css`
)
}