Skip to content

简悦主题 | Simpread Theme by ped-Yc

Screenshot of 简悦主题 | Simpread Theme

Details

Authorped-Yc

LicenseNo License

Category*

Created

Updated

Code size7.6 kB

Code checksum75a85a90

Statistics

Learn how we calculate statistics in the FAQ.

Failed to fetch stats.

Description

简悦阅读模式样式美化。只会对<sr-read>标签生效

Simpread read mode style beautify.Only take effect on <sr-read>

Notes

Userstyle doesn't have notes.

Source code

/* ==UserStyle==
@name         简悦主题 | Simpread Theme
@version      20250327.07.12
@namespace    https://userstyles.world/user/ped-Yc
@description  简悦阅读模式样式美化。只会对<sr-read>标签生效Simpread read mode style beautify.Only take effect on <sr-read>
@author       ped-Yc
@license      No License
==/UserStyle== */

:root {
    --sr-primary-color: hsl(164deg 70.47% 30.02%);
    --sr-accent-color: #0d400d;
    --sr-background-color: rgba(255, 255, 255, 0.95);
    --sr-hyperlink-color: #5BA4B5;
    --sr-box-shadow: 0 8px 16px rgba(0, 32, 0, 0.12);
    --sr-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --text-shadow-1px: 1px 1px 1px rgba(0, 0, 0, 0.25);
}

/* 容器优化 */
.simpread-read-root {
    background: linear-gradient(rgba(77, 113, 91, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77, 113, 91, 0.06) 1px, transparent 1px);
    background-size: 24px 24px;
    background-attachment: fixed;
    isolation: isolate;
}

/* 标注 */
sr-annote {
    padding: 0;
}
code:has(sr-annote) {
    all: unset;
    color: var(--sr-hyperlink-color)!important;
}

/* sr-read span:has(sr-annote) {
    background-color: var(--sr-annote-color-1)
}
 */
/* 主内容区 */
sr-read {
    width: min(800px, 90%) !important;
    min-width: 800px;
    margin: 40px auto;
    padding: 2rem 3rem;
    background: var(--sr-background-color);
    border-radius: 12px;
    box-shadow: var(--sr-box-shadow);
    transition: var(--sr-transition);
    z-index: 1;
    transform-origin: center top;
    animation: sr-entry 0.6s ease-out;
}

/* 排版系统 */
sr-read * {
    font-family: "LXGW WenKai GB Screen", system-ui;
    line-height: 1.7;
    color: #334139;
}

sr-rd-desc {
    color: gray;
}

sr-read:hover {
    box-shadow: 0 12px 24px rgba(0, 32, 0, 0.18);
}

sr-read table {
    background-color: #fff;
    border-color: #fff;
}

/* sr-read sr-rd-desc {} */
sr-read details {
    background: #e6f4ea;
    border-radius: .25rem;
    padding: 1rem;
    text-shadow: var(--text-shadow-1px)/*     summary {} */
}

/* 超链接 */
sr-rd-content a {
    color: var(--sr-hyperlink-color);
    text-decoration: none;
    background: linear-gradient(currentColor 0 100%) 0 100% / 0 1px no-repeat;
    transition: background-size 0.3s ease;
}

/* cout */
sr-read sr-deeplink {
    box-shadow: var(--sr-box-shadow);
    border-radius: 12px;
    transition: background-size 0.3s ease;
}


/* 段落样式 */
sr-read p {
    margin: 1.5em 0;
    padding-left: 1rem;
    border-left: 3px solid rgba(77, 113, 91, 0.15);
}

/* 标题系统 */
sr-read sr-rd-title,
sr-read h1,
sr-read h2,
sr-read h3,
sr-read h4,
sr-read h5,
sr-read h6 {
    font-family: "Aa奶糖油画体", cursive;
    font-weight: 600;
    padding-bottom: 0.5rem;
    border-bottom: 2px dashed var(--sr-primary-color);
    text-shadow: var(--text-shadow-1px, 1px 1px 1px rgba(0, 0, 0, .3)) animation: fade-in 0.9s ease-out;
}

sr-read sr-rd-title {
    font-size: 2.4rem;
    text-align: center;
    margin: 2rem 0 2.5rem;
}

/* 头图优化 */
sr-read .sr-cover {
    overflow: hidden;
    border-radius: 8px;
    transition: var(--sr-transition);

    > img {
        width: 100%;
        height: 360px;
        object-fit: cover;
        transition: transform 0.4s ease;

        &:hover {
            transform: scale(1.02);
        }
    }
}

/* 代码块 */
sr-read pre,
sr-read code {
    /*     all:unset; */
    font-family: "LXGW WenKai Mono GB Screen", monospace;
    background: rgba(77, 113, 91, 0.08);
    border-radius: 6px;
    padding: 1rem;
    font-size: 1.4rem;
    line-height: 1.6;
    overflow-x: auto;
    color: inherit;
    align-content: center;
}

sr-read p code {
    cursor: pointer;
    color: #fff;
    background-color: var(--sr-primary-color)
}

/* 目录系统 */
sr-read toc-bg {
    /* 定位系统 */
    position: fixed !important;
    /*     margin: 20px 0; */
    top: clamp(20px, 50vh, calc(100vh - 200px)) !important;
    transform: translateY(-50%) !important;
    width: 500px!important;
    z-index: 1000;
    overflow-y: auto;
    line-height: 150%;
}

/* 默认状态下隐藏内部内容 */
sr-read toc-bg toc,
sr-read toc-bg .toc-title,
sr-read toc-bg outline {
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

/* 内部目录样式保持原有定义 */
sr-read toc-bg toc {
    display: flex;
    flex-direction: column;
    left: 100px;
    align-items: start;
    box-shadow: var(--sr-box-shadow);
    border-radius: 12px;
    max-height: 80vh;
    /*     max-width: 500px; */
    overflow: auto;
    transition: max-height 0.3s ease, max-width 0.3s ease, padding 0.3s ease, background 0.3s ease;

    /* 鼠标移入时展开目录 */
    &:hover {
        cursor: pointer;
        /* 展开高度足够显示所有内容 */
        padding: 1rem 2rem 1rem 0;
        /* 恢复内边距 */
        background: var(--sr-background-color) !important;
        /* 恢复背景色 */
    }

    & outline {
        height: auto;
        padding: 6px 12px;
        transition: var(--sr-transition);
    }

    & outline a {
        color: var(--sr-primary-color);
        padding: 0 3px;
        border-radius: 6px;
        display: block;
        position: relative;
        transition: var(--sr-transition);
    }

    & outline a::before {
        content: "";
        position: absolute;
        left: -8px;
        top: 50%;
        width: 6px;
        height: 2px;
        background: rgba(77, 113, 91, 0.3);
        transition: width 0.3s ease;
    }

    & outline:hover a {
        background: rgba(77, 113, 91, 0.08);
        padding-left: 1.6rem;
    }

    & outline:hover a::before {
        width: 10px;
        background: var(--sr-accent-color);
    }

    & .toc-title {
        font-family: "Aa奶糖油画体", cursive;
        color: var(--sr-accent-color);
        font-size: 1.8rem;
        margin-bottom: 1rem;
        border-bottom: 2px solid rgba(77, 113, 91, 0.15);
    }


    & .toc-outline-active + a {
        font-weight: 600;
        color: var(--sr-accent-color);
        background: var(--sr-hyperlink-color);
    }
}

/* 鼠标移入时内部内容渐显 */
sr-read toc-bg:hover toc,
sr-read toc-bg:hover .toc-title,
sr-read toc-bg:hover outline {
    opacity: 1;
}


/* 调整不同目录级别的缩进 */
sr-read toc-bg.toc-level-h2 {
    margin-left: 1rem;
}
sr-read toc-bg.toc-level-h3 {
    margin-left: 2rem;
}
sr-read toc-bg.toc-level-h4 {
    margin-left: 3rem;
}

/* 响应式设计 */
@media screen and (max-width: 1400px) {
    sr-read toc-bg {
        display: none!important;
    }
}

/* 动画系统 */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes sr-entry {
    from {
        opacity: 0;
        transform: translateY(20px) rotateX(2deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

@keyframes title-entry {
    from {
        opacity: 0;
        letter-spacing: 0.15em;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        letter-spacing: 0.05em;
        transform: translateX(0);
    }
}

@-moz-document url-prefix("https://segmentfault.com/") {
button[data-toggle="tooltip"] {
    display: none;
}
}

@-moz-document url-prefix("https://dev.to/") {
sr-rd-content {
    pre {
        color: #000!important;
    }
}
}

@-moz-document url-prefix("https://grok.com/") {
sr-rd .message-bubble p {
    color: hsl(164deg 70.47% 30.02%);
}
}

Reviews

No reviews yet.