-
Notifications
You must be signed in to change notification settings - Fork 34
/
StackExchangeWiderMode.user.js
112 lines (105 loc) · 2.66 KB
/
StackExchangeWiderMode.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
// ==UserScript==
// @name Stack Exchange Wider Mode
// @description Increase max-width of sites to 1440px
// @homepage https://github.com/samliew/SO-mod-userscripts
// @author Samuel Liew
// @version 3.0.13
//
// @match https://*.stackoverflow.com/*
// @match https://*.serverfault.com/*
// @match https://*.superuser.com/*
// @match https://*.askubuntu.com/*
// @match https://*.mathoverflow.net/*
// @match https://*.stackapps.com/*
// @match https://*.stackexchange.com/*
// @match https://stackoverflowteams.com/*
//
// @exclude https://api.stackexchange.com/*
// @exclude https://data.stackexchange.com/*
// @exclude https://contests.stackoverflow.com/*
// @exclude https://winterbash*.stackexchange.com/*
// @exclude *chat.*
// @exclude *blog.*
// @exclude */tour
// @exclude */transcript/*
//
// @require https://raw.githubusercontent.com/samliew/SO-mod-userscripts/master/lib/se-ajax-common.js
// @require https://raw.githubusercontent.com/samliew/SO-mod-userscripts/master/lib/common.js
//
// @run-at document-start
// ==/UserScript==
/* globals StackExchange */
/// <reference types="./globals" />
'use strict';
const breakpoints = {
standard: 1264,
wide: 1440,
wider: 1580,
widerer: 1920,
widest: 2560,
full: 99999
};
const maxWidth = breakpoints.wider;
const leftSidebarWidth = 164;
// Append styles
const styles = document.createElement('style');
styles.setAttribute('data-somu', GM_info?.script.name);
styles.innerHTML = `
/* General */
.contentWrapper,
.top-bar .-container,
body > .container,
body > #container {
max-width: ${maxWidth}px;
width: 100%;
}
body#chat-body #container {
max-width: none;
width: 100%;
}
#left-sidebar ~ #content {
max-width: ${maxWidth - leftSidebarWidth}px;
width: calc(100% - ${leftSidebarWidth}px);
margin-left: auto;
margin-right: auto;
}
html.html__unpinned-leftnav #content {
max-width: none;
width: 100%;
}
/* Mod pages */
.flag-container {
width: calc(100% - 330px);
}
.flagged-posts {
width: 100%;
}
/* Stack Exchange */
header.siteHeader {
padding: 0 20px;
}
body > .wrapper > #content {
max-width: none;
width: auto;
}
#mainArea {
max-width: ${maxWidth - leftSidebarWidth}px;
width: calc(100% - 240px);
}
#mainArea + #sideBar {
width: 220px;
}
#mainArea > * {
width: auto;
}
#mainArea #question-list,
#mainArea #question-list .question-container {
width: 100%;
box-sizing: border-box;
}
#mainArea #question-list .question-container .question {
width: calc(100% - 70px);
box-sizing: border-box;
}
`.replace(/;/g, ' !important;');
document.head.appendChild(styles);