Jump to content

MediaWiki:Common.css

From SOJI ELECTRONICS
Revision as of 04:21, 11 May 2026 by Admin (talk | contribs)

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
/* =========================================
   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 — dùng SVG inline */
.vector-main-menu .CategoryTreeToggle,
.CategoryTreeToggle {
    display: inline-block !important;
    width: 20px !important;
    height: 20px !important;
    background: none !important;
    text-indent: -9999px !important;
    font-size: 0 !important;
    position: relative !important;
    cursor: pointer !important;
    text-decoration: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
}

/* Ẩn nội dung gốc */
.CategoryTreeToggle * {
    display: none !important;
}

/* Vẽ chevron > bằng SVG, hướng sang PHẢI */
.CategoryTreeToggle::before {
    content: '' !important;
    display: block !important;
    width: 12px !important;
    height: 12px !important;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232c3993' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='9 18 15 12 9 6'/></svg>") no-repeat center center !important;
    background-size: contain !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    transition: transform 0.2s ease !important;
}

/* Khi expanded — quay XUỐNG (90 độ) */
.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;
}
SOJI Electronics