Grok Code Style

Shrink and style pre/code blocks on Grok pages only

As of 15.03.2025. See ბოლო ვერსია.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Grok Code Style
// @namespace    http://tampermonkey.net/
// @version      1.2
// @description  Shrink and style pre/code blocks on Grok pages only
// @author       You
// @match        https://x.com/i/grok*
// @match        https://grok.com/*
// @match        https://grok.x.ai/*
// @match        https://x.ai/*
// @exclude      https://greasyfork.org/*
// @exclude      https://*.org/*
// @grant        GM_addStyle
// @license      MIT
// ==/UserScript==

GM_addStyle(`
    :not([class*="highlight"]:not([id*="highlight"])) > pre,
    :not([class*="highlight"]:not([id*="highlight"])) > code {
        max-height: 150px;
        overflow-y: auto;
        font-size: 11px;
        line-height: 1.2;
        background-color: #f5f5f5;
        padding: 4px;
        border: 1px solid #ddd;
        margin: 0;
        display: block;
    }
`);