YouTube Custom Material Design Style

Apply Material Design Lite styling to YouTube

当前为 2024-11-04 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         YouTube Custom Material Design Style
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Apply Material Design Lite styling to YouTube
// @match        *://www.youtube.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Add custom styles to the document
    const style = document.createElement('style');
    style.textContent = `
        /* Import Material Design Lite CSS and Roboto Font */
        @import url('https://code.getmdl.io/1.3.0/material.indigo-pink.min.css');
        @import url('https://fonts.googleapis.com/css?family=Roboto:300,400,500,700');

        /* Root variables */
        :root {
            --showRtcConnectionStatusIcon: block; /* Show video call ping/status icon */
            --jumboEmojiSize: 2rem; /* Old size: 2rem | New size: 3rem */
        }

        /* Example Material Design Lite styles */
        body {
            font-family: 'Roboto', sans-serif;
        }

        /* Resize jumbo emojis */
        .jumbo-emoji {
            font-size: var(--jumboEmojiSize);
        }

        /* Other custom styles can be added here */
    `;
    document.head.appendChild(style);
})();