MediaWiki:Common.css: Difference between revisions
Appearance
No edit summary Tag: Reverted |
No edit summary Tag: Reverted |
||
| Line 1: | Line 1: | ||
/* ========================================= | /* ========================================= | ||
SIDEBAR CATEGORY TREE | |||
========================================= */ | ========================================= */ | ||
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap'); | @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap'); | ||
/* Container — apply font cho | /* Container — apply font Inter cho toàn tree */ | ||
.vector-main-menu #p-CATEGORIES, | .vector-main-menu #p-CATEGORIES, | ||
.vector-main-menu .CategoryTreeTag, | .vector-main-menu .CategoryTreeTag, | ||
| Line 16: | Line 16: | ||
.CategoryTreeTag * { | .CategoryTreeTag * { | ||
font-family: 'Inter', -apple-system, "Segoe UI", Roboto, sans-serif !important; | font-family: 'Inter', -apple-system, "Segoe UI", Roboto, sans-serif !important; | ||
} | |||
/* Parent — không clip chevron */ | |||
.vector-main-menu, | |||
.vector-main-menu .mw-portlet-body, | |||
.mw-portlet-CATEGORIES, | |||
.mw-portlet-CATEGORIES .mw-portlet-body, | |||
#p-CATEGORIES { | |||
overflow: visible !important; | |||
} | } | ||
| Line 26: | Line 35: | ||
} | } | ||
/* Item | /* Item — flex row, mũi tên qua phải, sát lề trái */ | ||
.vector-main-menu .CategoryTreeItem, | .vector-main-menu .CategoryTreeItem, | ||
#p-CATEGORIES .CategoryTreeItem, | #p-CATEGORIES .CategoryTreeItem, | ||
| Line 33: | Line 42: | ||
align-items: flex-start !important; | align-items: flex-start !important; | ||
justify-content: space-between !important; | justify-content: space-between !important; | ||
padding: 7px | padding: 7px 12px 7px 0 !important; | ||
margin: 0 !important; | margin: 0 !important; | ||
border-radius: 4px; | border-radius: 4px; | ||
transition: background-color 0.15s; | transition: background-color 0.15s; | ||
overflow: visible !important; | |||
} | } | ||
.vector-main-menu .CategoryTreeItem:hover, | .vector-main-menu .CategoryTreeItem:hover, | ||
| Line 43: | Line 53: | ||
} | } | ||
/* Text label | /* Text label */ | ||
.vector-main-menu .CategoryTreeItem > bdi, | .vector-main-menu .CategoryTreeItem > bdi, | ||
.CategoryTreeItem > bdi { | .CategoryTreeItem > bdi { | ||
| Line 68: | Line 78: | ||
} | } | ||
/* Bullet — qua phải */ | /* Bullet container — qua phải, đủ rộng */ | ||
.vector-main-menu .CategoryTreeBullet, | .vector-main-menu .CategoryTreeBullet, | ||
.CategoryTreeBullet { | .CategoryTreeBullet { | ||
| Line 74: | Line 84: | ||
margin-left: 8px !important; | margin-left: 8px !important; | ||
flex-shrink: 0 !important; | flex-shrink: 0 !important; | ||
width: 20px !important; | |||
height: 20px !important; | |||
display: inline-flex !important; | |||
align-items: center !important; | |||
justify-content: center !important; | |||
overflow: visible !important; | |||
position: relative !important; | |||
} | } | ||
/* Chevron | /* Chevron toggle */ | ||
.vector-main-menu .CategoryTreeToggle, | .vector-main-menu .CategoryTreeToggle, | ||
.CategoryTreeToggle { | .CategoryTreeToggle { | ||
display: inline-block !important; | display: inline-block !important; | ||
width: 20px !important; | width: 20px !important; | ||
height: 20px !important; | height: 20px !important; | ||
background: none !important; | background: none !important; | ||
text-indent: 0 !important; | text-indent: 0 !important; | ||
| Line 92: | Line 107: | ||
margin: 0 !important; | margin: 0 !important; | ||
padding: 0 !important; | padding: 0 !important; | ||
overflow: visible !important; | overflow: visible !important; | ||
color: #2c3993 !important; | |||
} | |||
/* Ẩn content gốc của toggle */ | |||
.CategoryTreeToggle * { | |||
display: none !important; | |||
} | } | ||
/* Vẽ chevron bằng Unicode character qua pseudo */ | |||
.CategoryTreeToggle::before { | .CategoryTreeToggle::before { | ||
content: | content: "›" !important; | ||
display: inline-block !important; | |||
position: absolute !important; | position: absolute !important; | ||
top: 50% !important; | top: 50% !important; | ||
left: 50% !important; | left: 50% !important; | ||
transform: translate(-50%, -50%) rotate(0deg) !important; | |||
font-size: 22px !important; | |||
font-weight: bold !important; | |||
line-height: 1 !important; | |||
color: #2c3993 !important; | |||
transition: transform 0.2s ease !important; | transition: transform 0.2s ease !important; | ||
font-family: Arial, sans-serif !important; | |||
} | } | ||
/* Expanded — quay chevron 90deg xuống */ | |||
.CategoryTreeToggle[aria-expanded="true"]::before { | .CategoryTreeToggle[aria-expanded="true"]::before { | ||
transform: translate(-50%, - | transform: translate(-50%, -50%) rotate(90deg) !important; | ||
} | } | ||
/* Children — indent | /* Children — indent + viền trái */ | ||
.vector-main-menu .CategoryTreeChildren, | .vector-main-menu .CategoryTreeChildren, | ||
.CategoryTreeChildren { | .CategoryTreeChildren { | ||
margin-left: 4px !important; | margin-left: 4px !important; | ||
padding-left: 12px !important; | padding-left: 12px !important; | ||
padding-right: 0 !important; | |||
border-left: 1px solid #e3e7f0 !important; | border-left: 1px solid #e3e7f0 !important; | ||
overflow: visible !important; | |||
} | } | ||
Revision as of 04:18, 11 May 2026
/* =========================================
SIDEBAR CATEGORY TREE
========================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');
/* Container — apply font Inter cho toàn tree */
.vector-main-menu #p-CATEGORIES,
.vector-main-menu .CategoryTreeTag,
.mw-portlet-CATEGORIES,
.CategoryTreeTag {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
padding: 4px 0;
}
.vector-main-menu .CategoryTreeTag *,
.CategoryTreeTag * {
font-family: 'Inter', -apple-system, "Segoe UI", Roboto, sans-serif !important;
}
/* Parent — không clip chevron */
.vector-main-menu,
.vector-main-menu .mw-portlet-body,
.mw-portlet-CATEGORIES,
.mw-portlet-CATEGORIES .mw-portlet-body,
#p-CATEGORIES {
overflow: visible !important;
}
/* Section */
.vector-main-menu .CategoryTreeSection,
.CategoryTreeSection {
list-style: none;
padding: 0;
margin: 0;
}
/* Item — flex row, mũi tên qua phải, sát lề trái */
.vector-main-menu .CategoryTreeItem,
#p-CATEGORIES .CategoryTreeItem,
.CategoryTreeItem {
display: flex !important;
align-items: flex-start !important;
justify-content: space-between !important;
padding: 7px 12px 7px 0 !important;
margin: 0 !important;
border-radius: 4px;
transition: background-color 0.15s;
overflow: visible !important;
}
.vector-main-menu .CategoryTreeItem:hover,
.CategoryTreeItem:hover {
background-color: #f5f7fb;
}
/* Text label */
.vector-main-menu .CategoryTreeItem > bdi,
.CategoryTreeItem > bdi {
flex: 1 !important;
order: 1 !important;
min-width: 0 !important;
padding-left: 0 !important;
margin-left: 0 !important;
}
.vector-main-menu .CategoryTreeItem > bdi a,
.CategoryTreeItem > bdi a {
color: #2c3993 !important;
text-decoration: none !important;
font-size: 14px !important;
font-weight: 500 !important;
line-height: 1.45 !important;
display: block !important;
padding: 0 !important;
margin: 0 !important;
word-wrap: break-word;
}
.CategoryTreeItem > bdi a:hover {
color: #1f2a73 !important;
}
/* Bullet container — qua phải, đủ rộng */
.vector-main-menu .CategoryTreeBullet,
.CategoryTreeBullet {
order: 2 !important;
margin-left: 8px !important;
flex-shrink: 0 !important;
width: 20px !important;
height: 20px !important;
display: inline-flex !important;
align-items: center !important;
justify-content: center !important;
overflow: visible !important;
position: relative !important;
}
/* Chevron toggle */
.vector-main-menu .CategoryTreeToggle,
.CategoryTreeToggle {
display: inline-block !important;
width: 20px !important;
height: 20px !important;
background: none !important;
text-indent: 0 !important;
font-size: 0 !important;
position: relative !important;
cursor: pointer !important;
text-decoration: none !important;
margin: 0 !important;
padding: 0 !important;
overflow: visible !important;
color: #2c3993 !important;
}
/* Ẩn content gốc của toggle */
.CategoryTreeToggle * {
display: none !important;
}
/* Vẽ chevron bằng Unicode character qua pseudo */
.CategoryTreeToggle::before {
content: "›" !important;
display: inline-block !important;
position: absolute !important;
top: 50% !important;
left: 50% !important;
transform: translate(-50%, -50%) rotate(0deg) !important;
font-size: 22px !important;
font-weight: bold !important;
line-height: 1 !important;
color: #2c3993 !important;
transition: transform 0.2s ease !important;
font-family: Arial, sans-serif !important;
}
/* Expanded — quay chevron 90deg xuống */
.CategoryTreeToggle[aria-expanded="true"]::before {
transform: translate(-50%, -50%) rotate(90deg) !important;
}
/* Children — indent + viền trái */
.vector-main-menu .CategoryTreeChildren,
.CategoryTreeChildren {
margin-left: 4px !important;
padding-left: 12px !important;
padding-right: 0 !important;
border-left: 1px solid #e3e7f0 !important;
overflow: visible !important;
}
/* Cấp sâu hơn — chữ nhỏ hơn chút */
.CategoryTreeChildren .CategoryTreeChildren .CategoryTreeItem > bdi a {
font-size: 13px !important;
font-weight: 400 !important;
}