Skip to content

Commit 012ce10

Browse files
committed
[NO GBP] Fix 516 scrollbar and background image (#88617)
Ports - ParadiseSS13/Paradise#26433 Fixes scrollbar color for Byond 516, and background position Colorfull scrollbar <details><summary> Videos </summary> https://github.com/user-attachments/assets/969b4f6f-f553-4786-86c7-df11c034675b </details> :cl: fix: Fixed scrollbar colors and background position in TGUI on Byond 516 /:cl:
1 parent 448359c commit 012ce10

File tree

5 files changed

+42
-6
lines changed

5 files changed

+42
-6
lines changed

html/statbrowser.css

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
.light:root {
2+
--scrollbar-base: #f2f2f2;
3+
--scrollbar-thumb: #a7a7a7;
4+
}
5+
6+
html,
7+
body {
8+
scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-base);
9+
}
10+
111
body {
212
font-family: Verdana, Geneva, Tahoma, sans-serif;
313
font-size: 12px;
@@ -177,9 +187,16 @@ img {
177187
margin-bottom: 1em;
178188
}
179189

180-
/* Dark theme colors */
190+
/**
191+
* MARK: Dark theme colors
192+
*/
193+
.dark:root {
194+
--scrollbar-base: #151515;
195+
--scrollbar-thumb: #363636;
196+
}
197+
181198
body.dark {
182-
background-color: #131313;
199+
background-color: #151515;
183200
color: #b2c4dd;
184201
scrollbar-base-color: #1c1c1c;
185202
scrollbar-face-color: #3b3b3b;
@@ -201,7 +218,7 @@ body.dark {
201218
}
202219

203220
.dark #menu {
204-
background-color: #131313;
221+
background-color: #151515;
205222
}
206223

207224
.dark #menu.tabs-classic .button.active {

html/statbrowser.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,9 +705,11 @@ function draw_verbs(cat) {
705705
function set_theme(which) {
706706
if (which == "light") {
707707
document.body.className = "";
708+
document.documentElement.className = 'light';
708709
set_style_sheet("browserOutput_white");
709710
} else if (which == "dark") {
710711
document.body.className = "dark";
712+
document.documentElement.className = 'dark';
711713
set_style_sheet("browserOutput");
712714
}
713715
}

tgui/packages/tgui/layouts/Layout.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ type Props = Partial<{
2121

2222
export function Layout(props: Props) {
2323
const { className, theme = 'nanotrasen', children, ...rest } = props;
24+
document.documentElement.className = `theme-${theme}`;
2425

2526
return (
2627
<div className={'theme-' + theme}>

tgui/packages/tgui/styles/layouts/Layout.scss

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,29 @@
44
*/
55

66
@use 'sass:color';
7-
@use '../base.scss';
7+
@use '../base';
8+
@use '../functions.scss' as *;
89

10+
$luminance: luminance(base.$color-bg);
911
$scrollbar-color-multiplier: 1 !default;
12+
$scrollbar-base: color.scale(
13+
base.$color-bg,
14+
$lightness: -33% * $scrollbar-color-multiplier
15+
);
16+
$scrollbar-face: color.scale(
17+
base.$color-bg,
18+
$lightness: if($luminance > 0.05, 30%, 10%) * $scrollbar-color-multiplier
19+
);
1020

21+
// Fancy scrollbar
22+
html,
23+
body {
24+
scrollbar-color: $scrollbar-face $scrollbar-base;
25+
}
26+
27+
// Remove with 516, IE legacy code
1128
.Layout,
1229
.Layout * {
13-
// Fancy scrollbar
1430
scrollbar-base-color: color.scale(
1531
base.$color-bg,
1632
$lightness: -25% * $scrollbar-color-multiplier

tgui/packages/tgui/styles/main.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
// NT Theme
9797
.Layout__content {
9898
background-image: url('../assets/bg-nanotrasen.svg');
99-
background-size: 70%;
99+
background-size: 70% 70%;
100100
background-position: center;
101101
background-repeat: no-repeat;
102102
}

0 commit comments

Comments
 (0)