Office365 font change

Change the look of office 365

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

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

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

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

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