Content deleted Content added
Polygnotus (talk | contribs) No edit summary |
Polygnotus (talk | contribs) No edit summary |
||
Line 196:
}
body {
margin-right: ${this.isVisible ? this.sidebarWidth : '0'} !important;
transition: margin-right 0.3s ease;
}
/* Target Wikipedia's main content containers */
#mw-page-base,
#mw-head-base,
#mw-head,
#content,
#mw-panel,
.mw-body,
#footer {
margin-right: ${this.isVisible ? this.sidebarWidth : '0'} !important;
transition: margin-right 0.3s ease;
}
/* For Vector 2022 skin */
.vector-header-container,
.mw-page-container,
.vector-main-menu-container {
margin-right: ${this.isVisible ? this.sidebarWidth : '0'} !important;
transition: margin-right 0.3s ease;
Line 206 ⟶ 224:
border-radius: 4px;
}
.claude-sidebar-hidden body
.claude-sidebar-hidden #mw-page-base,
.claude-sidebar-hidden #mw-head-base,
.claude-sidebar-hidden #mw-head,
.claude-sidebar-hidden #content,
.claude-sidebar-hidden #mw-panel,
.claude-sidebar-hidden .mw-body,
.claude-sidebar-hidden #footer,
.claude-sidebar-hidden .vector-header-container,
.claude-sidebar-hidden .mw-page-container,
.claude-sidebar-hidden .vector-main-menu-container {
margin-right: 0 !important;
}
Line 270 ⟶ 298:
const widthPx = newWidth + 'px';
sidebar.style.width = widthPx;
this.sidebarWidth = widthPx;
localStorage.setItem('claude_sidebar_width', widthPx);
Line 287 ⟶ 315:
if (claudeTab) claudeTab.style.display = 'none';
this.applyMarginToContainers(this.sidebarWidth);
this.isVisible = true;
Line 297 ⟶ 326:
document.body.classList.add('claude-sidebar-hidden');
if (claudeTab) claudeTab.style.display = 'list-item';
// Remove margin from all containers
this.applyMarginToContainers('0');
this.isVisible = false;
localStorage.setItem('claude_sidebar_visible', 'false');
}
applyMarginToContainers(margin) {
const selectors = [
'body',
'#mw-page-base',
'#mw-head-base',
'#mw-head',
'#content',
'#mw-panel',
'.mw-body',
'#footer',
'.vector-header-container',
'.mw-page-container',
'.vector-main-menu-container'
];
selectors.forEach(selector => {
const elements = document.querySelectorAll(selector);
elements.forEach(el => {
el.style.marginRight = margin;
});
});
}
adjustMainContent() {
if (this.isVisible) {
} else {
}
}
|