mirror of
https://codeberg.org/tacerus/teddit.git
synced 2024-11-22 23:09:28 +01:00
#51 update theme with url query parameter.
Also fixed a nested comment alternating style issue
This commit is contained in:
parent
febf9c72c1
commit
ca706be5d5
15
app.js
15
app.js
@ -93,6 +93,21 @@ if(config.use_compression) {
|
|||||||
|
|
||||||
app.use(cookieParser())
|
app.use(cookieParser())
|
||||||
|
|
||||||
|
const themeMiddleware = (req, res, next) => {
|
||||||
|
let themeOverride = req.query.theme
|
||||||
|
if( themeOverride) {
|
||||||
|
// Convert Dark to dark since the stylesheet has it lower case
|
||||||
|
themeOverride = themeOverride.toLowerCase();
|
||||||
|
// This override here will set it for the current request
|
||||||
|
req.cookies.theme = themeOverride
|
||||||
|
// this will set it for future requests
|
||||||
|
res.cookie('theme', themeOverride, {maxAge: 31536000, httpOnly: true})
|
||||||
|
}
|
||||||
|
next();
|
||||||
|
}
|
||||||
|
|
||||||
|
app.use(themeMiddleware)
|
||||||
|
|
||||||
if(config.use_view_cache) {
|
if(config.use_view_cache) {
|
||||||
app.set('view cache', true)
|
app.set('view cache', true)
|
||||||
}
|
}
|
||||||
|
36
dist/css/styles.css
vendored
36
dist/css/styles.css
vendored
@ -146,29 +146,29 @@ body.dark .comment .comment .comment .comment .comment .comment .comment .commen
|
|||||||
background: var(--darkbg);
|
background: var(--darkbg);
|
||||||
}
|
}
|
||||||
body.dark .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment {
|
body.dark .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment {
|
||||||
background: var(--darkbg);
|
background: var(--darkbglight);
|
||||||
}
|
}
|
||||||
body.dark .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment {
|
body.dark .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment {
|
||||||
background: var(--darkbglight);
|
background: var(--darkbg);
|
||||||
}
|
}
|
||||||
body.dark .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment {
|
body.dark .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment {
|
||||||
background: var(--darkbg);
|
background: var(--darkbglight);
|
||||||
}
|
}
|
||||||
body.dark .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment {
|
body.dark .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment {
|
||||||
background: var(--darkbglight);
|
background: var(--darkbg);
|
||||||
}
|
}
|
||||||
body.dark .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment {
|
body.dark .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment {
|
||||||
background: var(--darkbg);
|
background: var(--darkbglight);
|
||||||
}
|
}
|
||||||
body.dark .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment {
|
body.dark .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment {
|
||||||
background: var(--darkbglight);
|
|
||||||
}
|
|
||||||
body.dark .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment {
|
|
||||||
background: var(--darkbg);
|
background: var(--darkbg);
|
||||||
}
|
}
|
||||||
body.dark .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment {
|
body.dark .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment {
|
||||||
background: var(--darkbglight);
|
background: var(--darkbglight);
|
||||||
}
|
}
|
||||||
|
body.dark .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment {
|
||||||
|
background: var(--darkbg);
|
||||||
|
}
|
||||||
body.dark .comment .meta .created a {
|
body.dark .comment .meta .created a {
|
||||||
color: #7b7b7b;
|
color: #7b7b7b;
|
||||||
}
|
}
|
||||||
@ -715,29 +715,29 @@ input[type="submit"]:hover,
|
|||||||
background: var(--whitebg);
|
background: var(--whitebg);
|
||||||
}
|
}
|
||||||
.comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment {
|
.comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment {
|
||||||
background: var(--whitebg);
|
background: var(--lightgray);
|
||||||
}
|
}
|
||||||
.comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment {
|
.comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment {
|
||||||
background: var(--lightgray);
|
background: var(--whitebg);
|
||||||
}
|
}
|
||||||
.comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment {
|
.comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment {
|
||||||
background: var(--whitebg);
|
background: var(--lightgray);
|
||||||
}
|
}
|
||||||
.comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment {
|
.comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment {
|
||||||
background: var(--lightgray);
|
background: var(--whitebg);
|
||||||
}
|
}
|
||||||
.comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment {
|
.comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment {
|
||||||
background: var(--whitebg);
|
background: var(--lightgray);
|
||||||
}
|
}
|
||||||
.comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment {
|
.comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment {
|
||||||
background: var(--lightgray);
|
|
||||||
}
|
|
||||||
.comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment {
|
|
||||||
background: var(--whitebg);
|
background: var(--whitebg);
|
||||||
}
|
}
|
||||||
.comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment {
|
.comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment {
|
||||||
background: var(--lightgray);
|
background: var(--lightgray);
|
||||||
}
|
}
|
||||||
|
.comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment .comment {
|
||||||
|
background: var(--whitebg);
|
||||||
|
}
|
||||||
/* POST */
|
/* POST */
|
||||||
#post .info {
|
#post .info {
|
||||||
float: left;
|
float: left;
|
||||||
|
Loading…
Reference in New Issue
Block a user