Office365 font change

Change the look of office 365

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @namespace   https://openuserjs.org/users/MilionMax
// @name        Office365 font change
// @description Change the look of office 365
// @match       https://outlook.office.com/*
// @include     https://teams.microsoft.com/*
// @include     https://*.sharepoint.com/*
// @grant       GM_addStyle
// @run-at      document-load 
// @version     0.0.3
// @license     MIT
// ==/UserScript==

function addGlobalStyle(css) {
    var head, style;
    head = document.getElementsByTagName('head')[0];
    if (!head) { return; }
    style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = css;
    head.appendChild(style);
}

var msiconclass = "";
var counter;
var seperator = ',';
  for (counter = 40; counter < 257; counter++) {
    msiconclass += '.css-' + counter + seperator;

  };

var fontIcon = ' { font-family: FabricMDL2Icons, controlIcons!important; }';
var fontText = ' { font-family: Manrope!important; }';
var selectIcon = 'ms-Icon, div#headerButtonsRegionId span';
var selectText = 'body, h1, h2, h3, span, .app-small-font, .ms-DetailsRow-cell, .ms-DetailsRow-cell .root-73';
var styleIcon = msiconclass + selectIcon + fontIcon ;
var styleText = selectText + fontText ;
    
/* text rule */
GM_addStyle('@import url(https://fonts.googleapis.com/css?family=Roboto|Nunito|Rubik|DM+Sans|Manrope&display=swap);');
addGlobalStyle(styleText);

/* icons rule */
addGlobalStyle(styleIcon);