跳转到内容

MediaWiki:Gadget-ViewerMode.css:修订间差异

来自槌基百科
读者模式切换 CSS
 
Full visitor simulation styles + escape pill
 
(未显示同一用户的3个中间版本)
第1行: 第1行:
/* ViewerMode gadget — hides editing UI in visitor view */
/* ─── ViewerMode gadget ──────────────────────────────────────────── */


/* Section [edit] links */
/* ══ READER VIEW: hide all editor-only UI ══════════════════════════ */
html.viewer-mode .mw-editsection {
html.viewer-mode .mw-editsection,
    display: none !important;
}
 
/* Edit / View source / Visual edit page tabs */
html.viewer-mode #ca-edit,
html.viewer-mode #ca-edit,
html.viewer-mode #ca-ve-edit,
html.viewer-mode #ca-ve-edit,
html.viewer-mode #ca-viewsource {
html.viewer-mode #ca-viewsource,
    display: none !important;
html.viewer-mode #p-cactions,
}
html.viewer-mode #ca-watch,
html.viewer-mode #ca-unwatch,
html.viewer-mode .vector-sticky-header-edit-icons { display: none !important; }
 
/* Hide the user avatar / personal menu dropdown */
html.viewer-mode #vector-user-links-dropdown        { display: none !important; }
 
/* Hide our own editor-only buttons */
html.viewer-mode #vm-toggle  { display: none !important; }
html.viewer-mode #hp-hide-btn { display: none !important; }


/* More actions menu (move, delete, protect...) */
/* ══ HEADER TOGGLE PILL ═════════════════════════════════════════════ */
html.viewer-mode #p-cactions {
.vm-toggle {
     display: none !important;
    display: inline-flex;
    align-items: center;
    padding: 0.28em 0.75em;
    border: 1.5px solid #c8ccd1;
    border-radius: 20px;
    background: #fff;
    color: #3a3a3a;
    font-size: 0.82em;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    margin-right: 0.5em;
     line-height: 1.5;
}
}
.vm-toggle:hover      { background: #eaf3fb; border-color: #4a7fa5; color: #2c3a4a; }
.vm-toggle.vm-active  { background: #2c5282; border-color: #2c5282; color: #fff; }
.vm-toggle.vm-active:hover { background: #2a4a7f; }


/* Watch / Unwatch */
/* ══ ESCAPE PILL (bottom-left, reader-view only) ════════════════════ */
html.viewer-mode #ca-watch,
#vm-exit {
html.viewer-mode #ca-unwatch {
    display: none;          /* hidden by default */
     display: none !important;
    position: fixed;
    bottom: 1.5rem;
    left: 1.2rem;
    z-index: 9997;
    align-items: center;
    padding: 0.4em 1em;
    border: none;
    border-radius: 20px;
    background: rgba(44, 82, 130, 0.88);
    color: #fff;
    font-size: 0.82em;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(0,0,0,0.22);
    backdrop-filter: blur(4px);
    transition: background 0.15s, transform 0.15s;
     white-space: nowrap;
}
}
html.viewer-mode #vm-exit { display: flex !important; }
#vm-exit:hover { background: rgba(44, 82, 130, 1); transform: scale(1.03); }


/* Vector 2022 sticky header edit button */
/* ══ THEME VARIANTS ═════════════════════════════════════════════════ */
html.viewer-mode .vector-sticky-header-edit-icons {
html.theme-dark .vm-toggle            { background: #252836; border-color: #4a5568; color: #e2e8f0; }
    display: none !important;
html.theme-dark .vm-toggle:hover      { background: #2d3748; border-color: #63b3ed; color: #90cdf4; }
}
html.theme-dark .vm-toggle.vm-active  { background: #2b6cb0; border-color: #2b6cb0; color: #fff; }
html.theme-dark #vm-exit              { background: rgba(43,108,176,0.9); }


/* Highlight toggle button when viewer mode is active */
html.theme-warm .vm-toggle           { border-color: #c8922a; color: #5c3d11; }
html.viewer-mode #pt-viewer-mode a {
html.theme-warm .vm-toggle:hover      { background: #f5ede0; border-color: #9c6b1e; }
    color: #f0a500 !important;
html.theme-warm .vm-toggle.vm-active  { background: #7a4f1d; border-color: #7a4f1d; color: #fff; }
    font-weight: bold;
html.theme-warm #vm-exit              { background: rgba(122,79,29,0.9); }
}

2026年3月12日 (四) 13:26的最新版本

/* ─── ViewerMode gadget ──────────────────────────────────────────── */

/* ══ READER VIEW: hide all editor-only UI ══════════════════════════ */
html.viewer-mode .mw-editsection,
html.viewer-mode #ca-edit,
html.viewer-mode #ca-ve-edit,
html.viewer-mode #ca-viewsource,
html.viewer-mode #p-cactions,
html.viewer-mode #ca-watch,
html.viewer-mode #ca-unwatch,
html.viewer-mode .vector-sticky-header-edit-icons { display: none !important; }

/* Hide the user avatar / personal menu dropdown */
html.viewer-mode #vector-user-links-dropdown        { display: none !important; }

/* Hide our own editor-only buttons */
html.viewer-mode #vm-toggle   { display: none !important; }
html.viewer-mode #hp-hide-btn { display: none !important; }

/* ══ HEADER TOGGLE PILL ═════════════════════════════════════════════ */
.vm-toggle {
    display: inline-flex;
    align-items: center;
    padding: 0.28em 0.75em;
    border: 1.5px solid #c8ccd1;
    border-radius: 20px;
    background: #fff;
    color: #3a3a3a;
    font-size: 0.82em;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    margin-right: 0.5em;
    line-height: 1.5;
}
.vm-toggle:hover       { background: #eaf3fb; border-color: #4a7fa5; color: #2c3a4a; }
.vm-toggle.vm-active   { background: #2c5282; border-color: #2c5282; color: #fff; }
.vm-toggle.vm-active:hover { background: #2a4a7f; }

/* ══ ESCAPE PILL (bottom-left, reader-view only) ════════════════════ */
#vm-exit {
    display: none;          /* hidden by default */
    position: fixed;
    bottom: 1.5rem;
    left: 1.2rem;
    z-index: 9997;
    align-items: center;
    padding: 0.4em 1em;
    border: none;
    border-radius: 20px;
    background: rgba(44, 82, 130, 0.88);
    color: #fff;
    font-size: 0.82em;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(0,0,0,0.22);
    backdrop-filter: blur(4px);
    transition: background 0.15s, transform 0.15s;
    white-space: nowrap;
}
html.viewer-mode #vm-exit { display: flex !important; }
#vm-exit:hover { background: rgba(44, 82, 130, 1); transform: scale(1.03); }

/* ══ THEME VARIANTS ═════════════════════════════════════════════════ */
html.theme-dark .vm-toggle            { background: #252836; border-color: #4a5568; color: #e2e8f0; }
html.theme-dark .vm-toggle:hover      { background: #2d3748; border-color: #63b3ed; color: #90cdf4; }
html.theme-dark .vm-toggle.vm-active  { background: #2b6cb0; border-color: #2b6cb0; color: #fff; }
html.theme-dark #vm-exit              { background: rgba(43,108,176,0.9); }

html.theme-warm .vm-toggle            { border-color: #c8922a; color: #5c3d11; }
html.theme-warm .vm-toggle:hover      { background: #f5ede0; border-color: #9c6b1e; }
html.theme-warm .vm-toggle.vm-active  { background: #7a4f1d; border-color: #7a4f1d; color: #fff; }
html.theme-warm #vm-exit              { background: rgba(122,79,29,0.9); }