MediaWiki:CollapsibleTree.css: Difference between revisions
From The Seven Sages of Rome
No edit summary |
No edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
/* Hide nested lists by default to prevent FOUC */ | |||
.collapsible-tree > ul ul { | |||
display: none; | |||
} | |||
.collapsible-tree > ul { | .collapsible-tree > ul { | ||
margin: 0; | margin: 0; | ||
padding-left: | padding-left: 28px; | ||
list-style: none; | list-style: none; | ||
line-height: 2em; | line-height: 2.2em; | ||
} | } | ||
.collapsible-tree > ul li { | .collapsible-tree > ul li { | ||
position: relative; | position: relative; | ||
transition: all 0.2s ease; | |||
} | } | ||
.collapsible-tree > ul li a { | .collapsible-tree > ul li a { | ||
padding-left: 0.5rem; | padding-left: 0.5rem; | ||
color: #2563eb; | |||
text-decoration: none; | |||
transition: color 0.2s ease; | |||
} | |||
.collapsible-tree > ul li a:hover { | |||
color: #1e40af; | |||
text-decoration: underline; | |||
} | } | ||
/* Modern tree lines with smoother styling */ | |||
.collapsible-tree > ul li::before, | .collapsible-tree > ul li::before, | ||
.collapsible-tree > ul li::after { | .collapsible-tree > ul li::after { | ||
content: ""; | content: ""; | ||
position: absolute; | position: absolute; | ||
left: - | left: -18px; | ||
border-left: 1px | border-left: 1px solid #d1d5db; | ||
} | } | ||
.collapsible-tree > ul li::before { | .collapsible-tree > ul li::before { | ||
top: 0; | top: 0; | ||
width: | width: 18px; | ||
height: 1em; | height: 1.1em; | ||
border-bottom: 1px | border-bottom: 1px solid #d1d5db; | ||
} | } | ||
| Line 44: | Line 59: | ||
} | } | ||
/* | /* Modern toggle icon */ | ||
.js-toggle-icon { | .js-toggle-icon { | ||
position: relative; | position: relative; | ||
z-index: 1; | z-index: 1; | ||
display: inline- | display: inline-flex; | ||
align-items: center; | |||
justify-content: center; | |||
width: 18px; | |||
height: 18px; | |||
margin: 0 4px 0 -26px; | |||
cursor: pointer; | cursor: pointer; | ||
font-style: normal; | font-style: normal; | ||
background- | font-size: 12px; | ||
border: 1px solid # | font-weight: 600; | ||
border-radius: 2px; | background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%); | ||
border: 1px solid #d1d5db; | |||
border-radius: 3px; | |||
color: #4b5563; | |||
transition: all 0.2s ease; | |||
user-select: none; | |||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); | |||
} | |||
.js-toggle-icon:hover { | |||
background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%); | |||
border-color: #9ca3af; | |||
color: #1f2937; | |||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); | |||
transform: scale(1.05); | |||
} | |||
.js-toggle-icon:active { | |||
transform: scale(0.95); | |||
box-shadow: 0 0 0 rgba(0, 0, 0, 0.05); | |||
} | |||
/* Highlight parent items with children */ | |||
.collapsible-tree > ul li.has-children > a { | |||
font-weight: 500; | |||
} | |||
/* Optional: Add subtle hover effect to tree items */ | |||
.collapsible-tree > ul li:hover > a { | |||
background-color: rgba(59, 130, 246, 0.05); | |||
border-radius: 3px; | |||
margin-left: -4px; | |||
padding-left: calc(0.5rem + 4px); | |||
} | |||
.collapsible-tree ul, | |||
.collapsible-tree li { | |||
list-style: none; | |||
} | } | ||
Latest revision as of 09:34, 13 January 2026
/* Hide nested lists by default to prevent FOUC */
.collapsible-tree > ul ul {
display: none;
}
.collapsible-tree > ul {
margin: 0;
padding-left: 28px;
list-style: none;
line-height: 2.2em;
}
.collapsible-tree > ul li {
position: relative;
transition: all 0.2s ease;
}
.collapsible-tree > ul li a {
padding-left: 0.5rem;
color: #2563eb;
text-decoration: none;
transition: color 0.2s ease;
}
.collapsible-tree > ul li a:hover {
color: #1e40af;
text-decoration: underline;
}
/* Modern tree lines with smoother styling */
.collapsible-tree > ul li::before,
.collapsible-tree > ul li::after {
content: "";
position: absolute;
left: -18px;
border-left: 1px solid #d1d5db;
}
.collapsible-tree > ul li::before {
top: 0;
width: 18px;
height: 1.1em;
border-bottom: 1px solid #d1d5db;
}
/* Hide vertical line for first item */
.collapsible-tree > ul > li:first-child::before {
border-left: none;
}
.collapsible-tree > ul li::after {
top: 1.1em;
bottom: 1px;
}
/* Hide lines for last item */
.collapsible-tree > ul li:last-child::after {
display: none;
}
/* Modern toggle icon */
.js-toggle-icon {
position: relative;
z-index: 1;
display: inline-flex;
align-items: center;
justify-content: center;
width: 18px;
height: 18px;
margin: 0 4px 0 -26px;
cursor: pointer;
font-style: normal;
font-size: 12px;
font-weight: 600;
background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
border: 1px solid #d1d5db;
border-radius: 3px;
color: #4b5563;
transition: all 0.2s ease;
user-select: none;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.js-toggle-icon:hover {
background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
border-color: #9ca3af;
color: #1f2937;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
transform: scale(1.05);
}
.js-toggle-icon:active {
transform: scale(0.95);
box-shadow: 0 0 0 rgba(0, 0, 0, 0.05);
}
/* Highlight parent items with children */
.collapsible-tree > ul li.has-children > a {
font-weight: 500;
}
/* Optional: Add subtle hover effect to tree items */
.collapsible-tree > ul li:hover > a {
background-color: rgba(59, 130, 246, 0.05);
border-radius: 3px;
margin-left: -4px;
padding-left: calc(0.5rem + 4px);
}
.collapsible-tree ul,
.collapsible-tree li {
list-style: none;
}