MediaWiki:Common.css: Difference between revisions
No edit summary Tag: Reverted |
Tag: Undo |
||
| Line 1,734: | Line 1,734: | ||
/* ============================================================ | /* ============================================================ | ||
--- TOC | --- TABLE OF CONTENTS (TOC) - VARIABLE SYSTEM --- | ||
1. Define the palettes (Light vs Dark) | |||
2. Apply variables to the elements | |||
============================================================ */ | ============================================================ */ | ||
/* 1. | /* 1. DEFAULT PALETTE (Light Mode) */ | ||
:root { | |||
--toc-bg: #ffffff; | --toc-bg: #ffffff; | ||
--toc-border: #e1e8eb; | --toc-border: #e1e8eb; | ||
--toc-shadow: rgba(0,0,0,0.05); | --toc-shadow: rgba(0,0,0,0.05); | ||
--toc-title: #266065; | --toc-title-color: #266065; | ||
--toc-title-border: #eef5f6; | --toc-title-border: #eef5f6; | ||
--toc-text: #546e7a; | --toc-text: #546e7a; | ||
--toc-hover-bg: #e0f2f1; | --toc-hover-bg: #e0f2f1; | ||
--toc-hover-text: #266065; | --toc-hover-text: #266065; | ||
--toc | --toc-line: #e1e8eb; | ||
--toc-number: #b0bec5; | --toc-number: #b0bec5; | ||
} | |||
/* 2. DARK MODE PALETTE (OS Preference + Night Class) */ | |||
/* Applies if OS is Dark AND User hasn't forced Light */ | |||
@media (prefers-color-scheme: dark) { | |||
:root:not(.skin-theme-clientpref-light) { | |||
--toc-bg: #1e1e1e; | |||
--toc-border: #333333; | |||
--toc-shadow: rgba(0,0,0,0.5); | |||
--toc-title-color: #4db6ac; | |||
--toc-title-border: #333333; | |||
--toc-text: #e0e0e0; | |||
--toc-hover-bg: #263238; | |||
--toc-hover-text: #80cbc4; | |||
--toc-line: #424242; | |||
--toc-number: #757575; | |||
} | |||
} | } | ||
/* | /* Applies if User explicitly clicks Dark Mode button */ | ||
html.skin-theme-clientpref-night { | |||
html.skin-theme-clientpref-night | |||
--toc-bg: #1e1e1e; | --toc-bg: #1e1e1e; | ||
--toc-border: #333333; | --toc-border: #333333; | ||
--toc-shadow: rgba(0,0,0,0.5); | --toc-shadow: rgba(0,0,0,0.5); | ||
--toc-title: #4db6ac; | --toc-title-color: #4db6ac; | ||
--toc-title-border: #333333; | --toc-title-border: #333333; | ||
--toc-text: #e0e0e0; | --toc-text: #e0e0e0; | ||
--toc-hover-bg: #263238; | --toc-hover-bg: #263238; | ||
--toc-hover-text: #80cbc4; | --toc-hover-text: #80cbc4; | ||
--toc | --toc-line: #424242; | ||
--toc-number: #757575; | --toc-number: #757575; | ||
} | } | ||
/* 3. | /* 3. FORCE LIGHT PALETTE (User explicitly clicks Light Mode) */ | ||
html.skin-theme-clientpref-light { | |||
--toc-bg: #ffffff; | |||
--toc-border: #e1e8eb; | |||
--toc-shadow: rgba(0,0,0,0.05); | |||
--toc-title-color: #266065; | |||
--toc-title-border: #eef5f6; | |||
--toc-text: #546e7a; | |||
--toc-hover-bg: #e0f2f1; | |||
--toc-hover-text: #266065; | |||
--toc-line: #e1e8eb; | |||
--toc-number: #b0bec5; | |||
} | |||
/* ============================================================ | /* ============================================================ | ||
--- | --- COMPONENT STYLING (Uses Variables) --- | ||
No need to edit below this line for colors! | |||
============================================================ */ | ============================================================ */ | ||
/* Main Container */ | |||
.mw-parser-output #toc, | |||
.mw-parser-output .toc, | |||
.vector-toc { | |||
background-color: var(--toc-bg) !important; | |||
border: 1px solid var(--toc-border) !important; | |||
border-radius: 12px !important; | |||
padding: 12px 15px !important; | |||
box-shadow: 0 4px 15px var(--toc-shadow) !important; | |||
display: inline-block !important; | |||
box-sizing: border-box !important; | |||
width: auto !important; | |||
min-width: 200px !important; | |||
max-width: 350px !important; | |||
margin-bottom: 25px !important; | |||
font-family: 'Segoe UI', Roboto, sans-serif !important; | |||
transition: background-color 0.3s ease, border-color 0.3s ease !important; | |||
} | |||
/* Title Header */ | /* Title Header */ | ||
.mw-parser-output #toctitle h2, | |||
.vector-toc-title { | |||
font-family: 'Segoe UI', Roboto, sans-serif !important; | font-family: 'Segoe UI', Roboto, sans-serif !important; | ||
font-weight: 800 !important; | font-weight: 800 !important; | ||
color: var(--toc-title-color) !important; | |||
font-size: 0.95rem !important; | |||
text-transform: uppercase !important; | text-transform: uppercase !important; | ||
letter-spacing: 0.5px !important; | letter-spacing: 0.5px !important; | ||
margin-bottom: 8px !important; | margin-bottom: 8px !important; | ||
padding-bottom: 8px !important; | padding-bottom: 8px !important; | ||
border-bottom | border-bottom: 2px solid var(--toc-title-border) !important; | ||
width: 100% !important; | width: 100% !important; | ||
} | } | ||
/* Links (Base | /* Links (Base) */ | ||
.mw-parser-output #toc a, | |||
.vector-toc-link { | |||
text-decoration: none !important; | text-decoration: none !important; | ||
color: var(--toc-text) !important; | |||
background: transparent !important; | |||
display: block !important; | display: block !important; | ||
padding: 5px 8px !important; | padding: 5px 8px !important; | ||
border-radius: 4px !important; | border-radius: 4px !important; | ||
font-weight: 500 !important; | font-weight: 500 !important; | ||
transition: all 0.2s ease !important; | transition: all 0.2s ease !important; | ||
} | } | ||
/* Links (Hover | /* Links (Hover) */ | ||
.mw-parser-output #toc a:hover, | |||
.vector-toc-link:hover { | |||
background-color: var(--toc-hover-bg) !important; | background-color: var(--toc-hover-bg) !important; | ||
color: var(--toc-hover-text) !important; | color: var(--toc-hover-text) !important; | ||
text-decoration: none !important; | |||
} | |||
/* List Structure */ | |||
.mw-parser-output #toc ul, .vector-toc-list { | |||
list-style: none !important; margin: 0 !important; padding: 0 !important; | |||
} | |||
.mw-parser-output #toc li, .vector-toc-list-item { | |||
margin: 0 !important; padding: 0 !important; font-size: 0.9rem !important; | |||
line-height: 1.2 !important; white-space: normal !important; word-wrap: break-word !important; | |||
} | } | ||
/* Indentation Lines */ | /* Indentation Lines */ | ||
.mw-parser-output #toc ul ul, .vector-toc-list .vector-toc-list { | |||
margin-left: 0 !important; | margin-left: 0 !important; | ||
padding-left: 10px !important; | padding-left: 10px !important; | ||
border-left | border-left: 2px solid var(--toc-line) !important; | ||
margin-top: 2px !important; | |||
margin-bottom: 2px !important; | |||
} | } | ||
/* Numbers & Toggles */ | /* Numbers & Toggles */ | ||
.tocnumber { color: var(--toc-number) !important; font-size: 0.85em !important; margin-right: 5px !important; } | |||
.toctogglelabel { font-size: 0.75rem !important; color: var(--toc-text) !important; opacity: 0.7; } | |||