MediaWiki:Common.css: Difference between revisions
(Add wiki styling) |
(Add comprehensive modern styling with family tree and mobile support) |
||
| Line 1: | Line 1: | ||
/* | /* ============================================ | ||
TOON WIKI - MODERN RESPONSIVE STYLING | |||
============================================ */ | |||
/* ===== CSS Variables ===== */ | |||
:root { | |||
--tw-primary: #1a4d7a; | |||
--tw-primary-light: #2c5aa0; | |||
--tw-secondary: #f8f9fa; | |||
--tw-border: #c8ccd1; | |||
--tw-text: #202122; | |||
--tw-text-muted: #72777d; | |||
--tw-link: #0645ad; | |||
--tw-link-new: #ba0000; | |||
--tw-air: #FF9900; | |||
--tw-water: #003399; | |||
--tw-earth: #006633; | |||
--tw-fire: #AA0000; | |||
--tw-radius: 8px; | |||
--tw-shadow: 0 2px 8px rgba(0,0,0,0.1); | |||
--tw-transition: 0.2s ease; | |||
} | |||
/* ===== Base Improvements ===== */ | |||
.mw-parser-output { | |||
line-height: 1.7; | |||
font-size: 16px; | |||
} | |||
.mw-parser-output p { | |||
margin-bottom: 1em; | |||
} | |||
.mw-body-content a:not(.new) { | |||
color: var(--tw-link); | |||
text-decoration: none; | |||
border-bottom: 1px solid transparent; | |||
transition: border-color var(--tw-transition); | |||
} | |||
.mw-body-content a:not(.new):hover { | |||
border-bottom-color: var(--tw-link); | |||
} | |||
a.new { | |||
color: var(--tw-link-new); | |||
} | |||
/* ===== Quote Templates ===== */ | /* ===== Quote Templates ===== */ | ||
.quote { | |||
border-radius: var(--tw-radius) !important; | |||
box-shadow: var(--tw-shadow); | |||
margin: 1.5em auto !important; | |||
max-width: 600px; | |||
font-size: 1.05em; | |||
transition: transform var(--tw-transition); | |||
} | |||
.quote:hover { | |||
transform: translateY(-2px); | |||
} | |||
.quote a { | .quote a { | ||
color: inherit !important; | color: inherit !important; | ||
} | } | ||
.quote_link_color a | .quote_link_color a, | ||
.quote_link_color_light a { | .quote_link_color_light a { | ||
text-decoration: underline; | text-decoration: underline; | ||
} | } | ||
/* ===== Infobox Styles ===== */ | /* ===== Infobox Styles ===== */ | ||
.infobox { | .infobox, | ||
.character-infobox { | |||
border-radius: var(--tw-radius) !important; | |||
box-shadow: var(--tw-shadow); | |||
overflow: hidden; | |||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; | ||
} | } | ||
.character-infobox th { | .character-infobox th { | ||
font-weight: 600; | font-weight: 600; | ||
color: | color: var(--tw-text); | ||
} | } | ||
.character-infobox td { | .character-infobox td { | ||
color: #444; | color: #444; | ||
} | } | ||
.character-infobox | .character-infobox img { | ||
max-width: 100%; | |||
height: auto; | |||
} | } | ||
/* ===== | /* ===== Family Tree Styles ===== */ | ||
. | .familytree { | ||
line-height: 1. | margin: 1.5em 0; | ||
padding: 1em; | |||
background: linear-gradient(135deg, #fafbfc, #f0f2f5); | |||
border: 1px solid var(--tw-border); | |||
border-radius: var(--tw-radius); | |||
overflow-x: auto; | |||
box-shadow: var(--tw-shadow); | |||
} | |||
.familytree table { | |||
border-collapse: collapse; | |||
} | |||
.family-tree-table-cell { | |||
padding: 0; | |||
vertical-align: middle; | |||
} | |||
.family-tree-line-table { | |||
width: 30px; | |||
border-collapse: collapse; | |||
} | |||
.family-tree-line { | |||
width: 15px; | |||
height: 15px; | |||
background: transparent; | |||
} | |||
.family-tree-line-solid-right { | |||
border-right: 2px solid #666; | |||
} | |||
.family-tree-line-solid-bottom { | |||
border-bottom: 2px solid #666; | |||
} | |||
.family-tree-line-dashed-right { | |||
border-right: 2px dashed #999; | |||
} | |||
.family-tree-line-dashed-bottom { | |||
border-bottom: 2px dashed #999; | |||
} | |||
.family-tree-element { | |||
padding: 8px 12px; | |||
background: white; | |||
border: 2px solid var(--tw-primary); | |||
border-radius: 6px; | |||
text-align: center; | |||
font-weight: 500; | |||
white-space: nowrap; | |||
box-shadow: 0 2px 4px rgba(0,0,0,0.1); | |||
transition: all var(--tw-transition); | |||
} | |||
.family-tree-element:hover { | |||
background: var(--tw-primary); | |||
color: white; | |||
transform: scale(1.05); | |||
} | } | ||
. | .family-tree-element a { | ||
color: inherit !important; | |||
text-decoration: none !important; | |||
} | } | ||
| Line 43: | Line 145: | ||
figure.mw-halign-left, | figure.mw-halign-left, | ||
figure.mw-halign-right { | figure.mw-halign-right { | ||
border-radius: var(--tw-radius); | |||
overflow: hidden; | |||
box-shadow: var(--tw-shadow); | |||
transition: transform var(--tw-transition); | |||
} | } | ||
figure.mw-halign-right { | figure.mw-halign-left:hover, | ||
figure.mw-halign-right:hover { | |||
transform: translateY(-4px); | |||
} | } | ||
figure figcaption { | figure figcaption { | ||
font-size: 0.9em; | font-size: 0.9em; | ||
color: | color: var(--tw-text-muted); | ||
padding: | padding: 8px 12px; | ||
background: | background: var(--tw-secondary); | ||
text-align: center; | text-align: center; | ||
} | |||
figure img { | |||
display: block; | |||
max-width: 100%; | |||
height: auto; | |||
} | } | ||
/* ===== Gallery Improvements ===== */ | /* ===== Gallery Improvements ===== */ | ||
.gallery { | .gallery { | ||
margin: | margin: 1.5em 0; | ||
display: flex; | |||
flex-wrap: wrap; | |||
gap: 10px; | |||
justify-content: center; | |||
} | } | ||
.gallerybox { | .gallerybox { | ||
background: | background: white; | ||
border: 1px solid | border: 1px solid var(--tw-border); | ||
border-radius: | border-radius: var(--tw-radius); | ||
overflow: hidden; | overflow: hidden; | ||
transition: all var(--tw-transition); | |||
} | |||
.gallerybox:hover { | |||
box-shadow: var(--tw-shadow); | |||
transform: translateY(-4px); | |||
} | } | ||
.gallerytext { | .gallerytext { | ||
font-size: 0.85em; | font-size: 0.85em; | ||
padding: | padding: 8px; | ||
text-align: center; | text-align: center; | ||
background: var(--tw-secondary); | |||
background: | |||
} | } | ||
/* ===== Section Headers ===== */ | /* ===== Section Headers ===== */ | ||
h2 { | |||
border-bottom: | border-bottom: 3px solid var(--tw-primary); | ||
padding-bottom: 0. | padding-bottom: 0.5em; | ||
margin-top: 2em; | |||
} | } | ||
h2 .mw-headline { | h2 .mw-headline { | ||
font-size: 1. | color: var(--tw-primary); | ||
font-size: 1.5em; | |||
border-bottom: none; | |||
} | } | ||
h3 .mw-headline { | h3 .mw-headline { | ||
font-size: 1. | color: var(--tw-primary-light); | ||
font-size: 1.2em; | |||
border- | } | ||
/* ===== TOC Improvements ===== */ | |||
.toc { | |||
background: linear-gradient(135deg, #fff, var(--tw-secondary)); | |||
border: 1px solid var(--tw-border); | |||
border-radius: var(--tw-radius); | |||
padding: 1.5em; | |||
box-shadow: var(--tw-shadow); | |||
max-width: 400px; | |||
} | |||
.toctitle h2 { | |||
border: none; | |||
margin: 0 0 0.5em 0; | |||
} | } | ||
/* ===== Imported Content Notice ===== */ | /* ===== Imported Content Notice ===== */ | ||
. | .mw-parser-output > div:first-child { | ||
border-radius: var(--tw-radius); | |||
border-left: 4px solid | border-left: 4px solid var(--tw-primary); | ||
} | } | ||
/* ===== Reference Styling ===== */ | /* ===== Reference Styling ===== */ | ||
.reference { | .reference { | ||
font-size: 0. | font-size: 0.8em; | ||
vertical-align: super; | vertical-align: super; | ||
line-height: 0; | line-height: 0; | ||
| Line 111: | Line 237: | ||
.references { | .references { | ||
font-size: 0.9em; | font-size: 0.9em; | ||
color: | color: var(--tw-text-muted); | ||
background: var(--tw-secondary); | |||
padding: 1em; | |||
border-radius: var(--tw-radius); | |||
margin-top: 2em; | |||
} | |||
.references li { | |||
margin-bottom: 0.5em; | |||
} | } | ||
/* ===== Category Links ===== */ | /* ===== Category Links ===== */ | ||
#catlinks { | #catlinks { | ||
background: # | background: linear-gradient(135deg, #fff, var(--tw-secondary)); | ||
border: 1px solid # | border: 1px solid var(--tw-border); | ||
border-radius: var(--tw-radius); | |||
padding: 1em 1.5em; | |||
margin-top: 3em; | |||
box-shadow: var(--tw-shadow); | |||
} | |||
/* ===== Icons Template ===== */ | |||
#icons { | |||
float: right; | |||
margin: 0 0 1em 1em; | |||
padding: 8px 12px; | |||
background: white; | |||
border: 1px solid var(--tw-border); | |||
border-radius: var(--tw-radius); | |||
box-shadow: var(--tw-shadow); | |||
display: flex; | |||
gap: 4px; | |||
align-items: center; | |||
} | |||
#icons img { | |||
transition: transform var(--tw-transition); | |||
} | |||
#icons img:hover { | |||
transform: scale(1.2); | |||
} | |||
/* ===== Main article template ===== */ | |||
.mw-parser-output > div[style*="font-style: italic"] { | |||
background: var(--tw-secondary); | |||
padding: 8px 16px; | |||
border-radius: var(--tw-radius); | |||
border-left: 4px solid var(--tw-primary); | |||
margin: 1em 0; | |||
} | |||
/* ===== Smooth Scrolling ===== */ | |||
html { | |||
scroll-behavior: smooth; | |||
} | |||
/* ============================================ | |||
MOBILE RESPONSIVE DESIGN | |||
============================================ */ | |||
@media screen and (max-width: 768px) { | |||
.mw-parser-output { | |||
font-size: 15px; | |||
line-height: 1.6; | |||
} | |||
/* Stack infobox on mobile */ | |||
.infobox, | |||
.character-infobox { | |||
float: none !important; | |||
width: 100% !important; | |||
margin: 1em 0 !important; | |||
} | |||
/* Stack images on mobile */ | |||
figure.mw-halign-left, | |||
figure.mw-halign-right { | |||
float: none !important; | |||
margin: 1em 0 !important; | |||
max-width: 100%; | |||
} | |||
/* Full-width quotes on mobile */ | |||
.quote { | |||
margin: 1em 0 !important; | |||
max-width: 100%; | |||
} | |||
/* Icons wrap on mobile */ | |||
#icons { | |||
float: none; | |||
margin: 0 0 1em 0; | |||
flex-wrap: wrap; | |||
justify-content: center; | |||
} | |||
/* TOC full width on mobile */ | |||
.toc { | |||
max-width: 100%; | |||
} | |||
/* Family tree scroll on mobile */ | |||
.familytree { | |||
display: block; | |||
overflow-x: auto; | |||
-webkit-overflow-scrolling: touch; | |||
} | |||
/* Better touch targets */ | |||
a { | |||
padding: 2px 0; | |||
} | |||
/* Larger section headers on mobile */ | |||
h2 { | |||
font-size: 1.4em; | |||
} | |||
h3 { | |||
font-size: 1.2em; | |||
} | |||
} | |||
/* ============================================ | |||
ENGAGEMENT & ADDICTIVE FEATURES | |||
============================================ */ | |||
/* Smooth image loading */ | |||
img { | |||
opacity: 1; | |||
transition: opacity 0.3s ease; | |||
} | |||
img[loading] { | |||
opacity: 0; | |||
} | |||
/* Reading progress indicator */ | |||
.mw-parser-output::before { | |||
content: ''; | |||
position: fixed; | |||
top: 0; | |||
left: 0; | |||
width: 0; | |||
height: 3px; | |||
background: linear-gradient(90deg, var(--tw-air), var(--tw-water), var(--tw-earth), var(--tw-fire)); | |||
z-index: 9999; | |||
animation: none; | |||
} | |||
/* Highlight current section in TOC */ | |||
.vector-toc-link:hover { | |||
background: var(--tw-secondary); | |||
border-radius: 4px; | border-radius: 4px; | ||
} | } | ||
/* | /* Engaging hover effects */ | ||
a.new { | .mw-body-content a:not(.new):not(.reference):hover { | ||
color | background: rgba(26, 77, 122, 0.1); | ||
border-radius: 2px; | |||
padding: 0 2px; | |||
margin: 0 -2px; | |||
} | |||
/* Card-like sections */ | |||
.mw-parser-output h2 + p, | |||
.mw-parser-output h3 + p { | |||
padding-left: 0.5em; | |||
border-left: 2px solid transparent; | |||
transition: border-color var(--tw-transition); | |||
} | } | ||
.mw-parser-output h2 + p:hover, | |||
color: | .mw-parser-output h3 + p:hover { | ||
border-left-color: var(--tw-primary); | |||
} | } | ||
/* | /* Animated list items */ | ||
.mw-parser-output ul li, | |||
.mw-parser-output ol li { | |||
transition: transform var(--tw-transition); | |||
} | |||
.mw-parser-output ul li:hover, | |||
.mw-parser-output ol li:hover { | |||
transform: translateX(4px); | |||
} | } | ||
/* Dark mode prep (can be enabled later) */ | |||
@media (prefers-color-scheme: dark) { | |||
/* Variables can be overridden here for dark mode */ | |||
} | } | ||
Revision as of 22:50, 22 December 2025
/* ============================================
TOON WIKI - MODERN RESPONSIVE STYLING
============================================ */
/* ===== CSS Variables ===== */
:root {
--tw-primary: #1a4d7a;
--tw-primary-light: #2c5aa0;
--tw-secondary: #f8f9fa;
--tw-border: #c8ccd1;
--tw-text: #202122;
--tw-text-muted: #72777d;
--tw-link: #0645ad;
--tw-link-new: #ba0000;
--tw-air: #FF9900;
--tw-water: #003399;
--tw-earth: #006633;
--tw-fire: #AA0000;
--tw-radius: 8px;
--tw-shadow: 0 2px 8px rgba(0,0,0,0.1);
--tw-transition: 0.2s ease;
}
/* ===== Base Improvements ===== */
.mw-parser-output {
line-height: 1.7;
font-size: 16px;
}
.mw-parser-output p {
margin-bottom: 1em;
}
.mw-body-content a:not(.new) {
color: var(--tw-link);
text-decoration: none;
border-bottom: 1px solid transparent;
transition: border-color var(--tw-transition);
}
.mw-body-content a:not(.new):hover {
border-bottom-color: var(--tw-link);
}
a.new {
color: var(--tw-link-new);
}
/* ===== Quote Templates ===== */
.quote {
border-radius: var(--tw-radius) !important;
box-shadow: var(--tw-shadow);
margin: 1.5em auto !important;
max-width: 600px;
font-size: 1.05em;
transition: transform var(--tw-transition);
}
.quote:hover {
transform: translateY(-2px);
}
.quote a {
color: inherit !important;
}
.quote_link_color a,
.quote_link_color_light a {
text-decoration: underline;
}
/* ===== Infobox Styles ===== */
.infobox,
.character-infobox {
border-radius: var(--tw-radius) !important;
box-shadow: var(--tw-shadow);
overflow: hidden;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.character-infobox th {
font-weight: 600;
color: var(--tw-text);
}
.character-infobox td {
color: #444;
}
.character-infobox img {
max-width: 100%;
height: auto;
}
/* ===== Family Tree Styles ===== */
.familytree {
margin: 1.5em 0;
padding: 1em;
background: linear-gradient(135deg, #fafbfc, #f0f2f5);
border: 1px solid var(--tw-border);
border-radius: var(--tw-radius);
overflow-x: auto;
box-shadow: var(--tw-shadow);
}
.familytree table {
border-collapse: collapse;
}
.family-tree-table-cell {
padding: 0;
vertical-align: middle;
}
.family-tree-line-table {
width: 30px;
border-collapse: collapse;
}
.family-tree-line {
width: 15px;
height: 15px;
background: transparent;
}
.family-tree-line-solid-right {
border-right: 2px solid #666;
}
.family-tree-line-solid-bottom {
border-bottom: 2px solid #666;
}
.family-tree-line-dashed-right {
border-right: 2px dashed #999;
}
.family-tree-line-dashed-bottom {
border-bottom: 2px dashed #999;
}
.family-tree-element {
padding: 8px 12px;
background: white;
border: 2px solid var(--tw-primary);
border-radius: 6px;
text-align: center;
font-weight: 500;
white-space: nowrap;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
transition: all var(--tw-transition);
}
.family-tree-element:hover {
background: var(--tw-primary);
color: white;
transform: scale(1.05);
}
.family-tree-element a {
color: inherit !important;
text-decoration: none !important;
}
/* ===== Image Improvements ===== */
figure.mw-halign-left,
figure.mw-halign-right {
border-radius: var(--tw-radius);
overflow: hidden;
box-shadow: var(--tw-shadow);
transition: transform var(--tw-transition);
}
figure.mw-halign-left:hover,
figure.mw-halign-right:hover {
transform: translateY(-4px);
}
figure figcaption {
font-size: 0.9em;
color: var(--tw-text-muted);
padding: 8px 12px;
background: var(--tw-secondary);
text-align: center;
}
figure img {
display: block;
max-width: 100%;
height: auto;
}
/* ===== Gallery Improvements ===== */
.gallery {
margin: 1.5em 0;
display: flex;
flex-wrap: wrap;
gap: 10px;
justify-content: center;
}
.gallerybox {
background: white;
border: 1px solid var(--tw-border);
border-radius: var(--tw-radius);
overflow: hidden;
transition: all var(--tw-transition);
}
.gallerybox:hover {
box-shadow: var(--tw-shadow);
transform: translateY(-4px);
}
.gallerytext {
font-size: 0.85em;
padding: 8px;
text-align: center;
background: var(--tw-secondary);
}
/* ===== Section Headers ===== */
h2 {
border-bottom: 3px solid var(--tw-primary);
padding-bottom: 0.5em;
margin-top: 2em;
}
h2 .mw-headline {
color: var(--tw-primary);
font-size: 1.5em;
border-bottom: none;
}
h3 .mw-headline {
color: var(--tw-primary-light);
font-size: 1.2em;
}
/* ===== TOC Improvements ===== */
.toc {
background: linear-gradient(135deg, #fff, var(--tw-secondary));
border: 1px solid var(--tw-border);
border-radius: var(--tw-radius);
padding: 1.5em;
box-shadow: var(--tw-shadow);
max-width: 400px;
}
.toctitle h2 {
border: none;
margin: 0 0 0.5em 0;
}
/* ===== Imported Content Notice ===== */
.mw-parser-output > div:first-child {
border-radius: var(--tw-radius);
border-left: 4px solid var(--tw-primary);
}
/* ===== Reference Styling ===== */
.reference {
font-size: 0.8em;
vertical-align: super;
line-height: 0;
}
.references {
font-size: 0.9em;
color: var(--tw-text-muted);
background: var(--tw-secondary);
padding: 1em;
border-radius: var(--tw-radius);
margin-top: 2em;
}
.references li {
margin-bottom: 0.5em;
}
/* ===== Category Links ===== */
#catlinks {
background: linear-gradient(135deg, #fff, var(--tw-secondary));
border: 1px solid var(--tw-border);
border-radius: var(--tw-radius);
padding: 1em 1.5em;
margin-top: 3em;
box-shadow: var(--tw-shadow);
}
/* ===== Icons Template ===== */
#icons {
float: right;
margin: 0 0 1em 1em;
padding: 8px 12px;
background: white;
border: 1px solid var(--tw-border);
border-radius: var(--tw-radius);
box-shadow: var(--tw-shadow);
display: flex;
gap: 4px;
align-items: center;
}
#icons img {
transition: transform var(--tw-transition);
}
#icons img:hover {
transform: scale(1.2);
}
/* ===== Main article template ===== */
.mw-parser-output > div[style*="font-style: italic"] {
background: var(--tw-secondary);
padding: 8px 16px;
border-radius: var(--tw-radius);
border-left: 4px solid var(--tw-primary);
margin: 1em 0;
}
/* ===== Smooth Scrolling ===== */
html {
scroll-behavior: smooth;
}
/* ============================================
MOBILE RESPONSIVE DESIGN
============================================ */
@media screen and (max-width: 768px) {
.mw-parser-output {
font-size: 15px;
line-height: 1.6;
}
/* Stack infobox on mobile */
.infobox,
.character-infobox {
float: none !important;
width: 100% !important;
margin: 1em 0 !important;
}
/* Stack images on mobile */
figure.mw-halign-left,
figure.mw-halign-right {
float: none !important;
margin: 1em 0 !important;
max-width: 100%;
}
/* Full-width quotes on mobile */
.quote {
margin: 1em 0 !important;
max-width: 100%;
}
/* Icons wrap on mobile */
#icons {
float: none;
margin: 0 0 1em 0;
flex-wrap: wrap;
justify-content: center;
}
/* TOC full width on mobile */
.toc {
max-width: 100%;
}
/* Family tree scroll on mobile */
.familytree {
display: block;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}
/* Better touch targets */
a {
padding: 2px 0;
}
/* Larger section headers on mobile */
h2 {
font-size: 1.4em;
}
h3 {
font-size: 1.2em;
}
}
/* ============================================
ENGAGEMENT & ADDICTIVE FEATURES
============================================ */
/* Smooth image loading */
img {
opacity: 1;
transition: opacity 0.3s ease;
}
img[loading] {
opacity: 0;
}
/* Reading progress indicator */
.mw-parser-output::before {
content: '';
position: fixed;
top: 0;
left: 0;
width: 0;
height: 3px;
background: linear-gradient(90deg, var(--tw-air), var(--tw-water), var(--tw-earth), var(--tw-fire));
z-index: 9999;
animation: none;
}
/* Highlight current section in TOC */
.vector-toc-link:hover {
background: var(--tw-secondary);
border-radius: 4px;
}
/* Engaging hover effects */
.mw-body-content a:not(.new):not(.reference):hover {
background: rgba(26, 77, 122, 0.1);
border-radius: 2px;
padding: 0 2px;
margin: 0 -2px;
}
/* Card-like sections */
.mw-parser-output h2 + p,
.mw-parser-output h3 + p {
padding-left: 0.5em;
border-left: 2px solid transparent;
transition: border-color var(--tw-transition);
}
.mw-parser-output h2 + p:hover,
.mw-parser-output h3 + p:hover {
border-left-color: var(--tw-primary);
}
/* Animated list items */
.mw-parser-output ul li,
.mw-parser-output ol li {
transition: transform var(--tw-transition);
}
.mw-parser-output ul li:hover,
.mw-parser-output ol li:hover {
transform: translateX(4px);
}
/* Dark mode prep (can be enabled later) */
@media (prefers-color-scheme: dark) {
/* Variables can be overridden here for dark mode */
}