Steam Store Width CSS fix

Set a fixed width constant for Steam store page layout.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Steam Store Width CSS fix
// @namespace    https://store.steampowered.com/
// @version      1.0
// @description  Set a fixed width constant for Steam store page layout.
// @match        https://store.steampowered.com/app/*
// @grant        none
// @run-at       document-idle
// @license      MIT
// ==/UserScript==

(function() {
  'use strict';

  // Define your width constant (in px)
  const STORE_PAGE_WIDTH = 1000;

  const css = `
    body.v6.widestore {
      --store-page-width: ${STORE_PAGE_WIDTH}px !important;
    }
    body.v6.widestore .page_content {
      max-width: ${STORE_PAGE_WIDTH + 100}px !important; /* e.g., width + margin/padding */
      width: 100% !important;
      margin: 0 auto !important;
    }
    .widestore .queue_ctn {
      max-width: ${STORE_PAGE_WIDTH + 100}px !important;
      width: 100% !important;
      background: rgba(0, 0, 0, 0.2) !important;
      margin: 0 auto 16px auto !important;
    }
  `;

  const style = document.createElement('style');
  style.textContent = css;
  document.head.appendChild(style);
})();