开发JavaScript【油猴子脚本】给微信公众平台UI定制化❄️2winter2020-08-102020-08-10代码超级简单,可以自己注入css哈。 1234567891011121314151617181920212223242526272829303132333435363738// ==UserScript==// @name 微信公众平台轻主题// @namespace http://blog.borebooks.top// @version 0.1// @description 微信后台主题// @author IWH718// @match https://mp.weixin.qq.com/*// @grant none// ==/UserScript==(function() { // 'use strict'; const md = { rules:'', sheet:null, primary_color:'#1aad19', create_css(){ let head = document.head || document.getElementsByTagName('head')[0]; let style = document.createElement('style'); style.type = 'text/css'; head.appendChild(style); this.sheet = style.sheet ||style.styleSheet; }, add_rules(rules=null,index=0){ !this.sheet && this.create_css(); this.sheet.insertRule(rules, index); } }; console.log('微信主题'); md.add_rules("*{transition:300ms!important;font-family:'宋体'}"); md.add_rules('.mod_default_box {box-shadow: 0 2px 12px 4px rgba(0,0,0,0.05)!important;border-radius:20px}'); md.add_rules('.menu_title.selected {color: #fff!important;display:inline!important}'); md.add_rules('.menu_title.selected a{color: #ffffff!important}'); md.add_rules('.side_l .col_side{border-right:none!important}'); md.add_rules('.menu_title.selected .menu_name{padding:10px!important;background:#1aad19!important;box-shadow: 0 2px 12px 4px rgba(0,0,0,0.1)!important;border-radius:25px;}'); // Your code here...})();