UPS.com - Dark Mode

UPS.com - Dark Mode!

目前為 2024-11-19 提交的版本,檢視 最新版本

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

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

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

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

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

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

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

/* ==UserStyle==
@name         UPS.com - Dark Mode
@version      20241114.23.52
@namespace    typpi.online
@description  UPS.com - Dark Mode!
@author       Nick2bad4u
@license      UnLicense
==/UserStyle== */

@-moz-document domain("ups.com") {
  /* Base dark mode filter */
  html {
    filter: invert(1) hue-rotate(180deg) !important;
  }

  /* Specific elements to exclude from inversion */
  :is(
      img,
      svg,
      video,
      iframe,
      [class*='footer'],
      [id*='footer'],
      .logo,
      .button,
      .btn,
      .input,
      .textarea,
      .card,
      .panel,
      .table,
      .modal,
      #ups-header_logo > img,
      #ups-navContainer
        > header
        > div.ups-container.navbar-expand-lg
        > div.ups-user-actions.dropdown
        > a.ups-cta.ups-cta-primary.d-none.d-md-block.ups-analytics
        > span,
      #ups-main
        > div
        > div
        > div
        > div.social.row
        > ul
        > li:nth-child(2)
        > button
        > span.ups-socialicon.ups-socialicon_facebook,
      #ups-main
        > div
        > div
        > div
        > div.social.row
        > ul
        > li:nth-child(1)
        > button
        > span.ups-socialicon.ups-socialicon_google,
      .brown.arc-container.apps-container.section,
      #tabs_0_tabContent_0 > div > div > div > div > div.package-tracker,
      #tracking-numbers
    ) {
    filter: invert(1) hue-rotate(180deg) !important;
  }

  /* Additional styling for better dark mode experience */
  a,
  li:nth-child(n) > a > span.icon.ups-icon-link_newwindow,
  #sublist-connect-with-us-3 > li:nth-child(n) > a > span.icon.icon-new-window > svg,
  #sublist-ups-companies-2 > li:nth-child(n) > a > span > svg > use,
  #sublist-ups-sites-1 > li:nth-child(n) > a > span > svg,
  #sublist-this-site-0 > li:nth-child(n) > a > span > svg,
  #sublist-connect-with-us-3 > li:nth-child(n) > a > span.icon.icon-facebook > svg > use,
  #sublist-connect-with-us-3 > li:nth-child(2) > a > span.icon.icon-x > svg > use,
  #sublist-connect-with-us-3 > li:nth-child(3) > a > span.icon.icon-instagram > svg > use,
  #sublist-connect-with-us-3 > li:nth-child(4) > a > span.icon.icon-linkedin > svg > use,
  #sublist-connect-with-us-3 > li:nth-child(5) > a > span.icon.icon-youtube > svg,
  #tabs_0_tabContent_0
    > div
    > div
    > div
    > div
    > div.track-form-wrapper
    > form
    > button.toggle-help
    > span
    > svg
    > use {
    color: #000 !important;
  }

  a > span.icon.ups-icon-link_newwindow,
  #ups-footer_legalLinks > li:nth-child(n) > a,
  #ups-footer_connectLinks > li:nth-child(n) > a > span.icon.ups-icon-link_newwindow,
  #sublist-legal-0 > li:nth-child(n) > a,
  #sublist-ups-companies-2 > li:nth-child(n) > a,
  #sublist-ups-sites-1 > li:nth-child(n) > a,
  #sublist-this-site-0 > li:nth-child(n) > a,
  #sublist-connect-with-us-3 > li:nth-child(n) > a,
  #tabs_0_tab_2 > h2,
  #tabs_0_tab_3 > h2,
  #tabs_0_tabContent_0 > div > div > div > div > div.track-form-wrapper > div.help-content > p > a,
  #ups-footer_connectLinks > li:nth-child(n) > a {
    color: #fff !important;
  }

  .button,
  .btn {
    background-color: #662f10 !important;
    color: #f8f8f2 !important;
    border: none !important;
  }

  .button:hover,
  .btn:hover {
    color: #50fa7b !important;
  }

  .input,
  .textarea {
    background-color: #44475a !important;
    color: #f8f8f2 !important;
    border: 1px solid #6272a4 !important;
  }

  .input:focus,
  .textarea:focus {
    border-color: #50fa7b !important;
  }

  .card,
  .panel {
    background-color: #44475a !important;
    color: #f8f8f2 !important;
    border: 1px solid #6272a4 !important;
  }

  .table {
    background-color: #44475a !important;
    color: #f8f8f2 !important;
  }

  .table th,
  .table td {
    border: 1px solid #6272a4 !important;
  }

  .modal {
    background-color: #282a36 !important;
    color: #f8f8f2 !important;
  }
}