YouTube Custom Material Design Style

Apply Material Design Lite styling to YouTube

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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);
})();