Home

Awesome

<p align="center"> <img height="128" src="./res/icon.png"></img> <h1 align="center">Custom UI Style</h1> <p align="center"> <a href="https://marketplace.visualstudio.com/items?itemName=subframe7536.custom-ui-style" target="__blank"><img src="https://img.shields.io/visual-studio-marketplace/v/subframe7536.custom-ui-style.svg?color=eee&amp;label=VS%20Code%20Marketplace&logo=visual-studio-code" alt="Visual Studio Marketplace Version" /></a> <a href="https://kermanx.github.io/reactive-vscode/" target="__blank"><img src="https://img.shields.io/badge/made_with-reactive--vscode-%23007ACC?style=flat&labelColor=%23229863" alt="Made with reactive-vscode" /></a> </p> </p>

VSCode extension that custom ui css style in both editor and webview

[!warning] This extension works by editting the VSCode's css and js files.

So, a warning appears while the first time to install or VSCode update. You can click the [never show again] to avoid it. From V0.4.0, the warning will no longer prompt. #11

Features

Usage

When first installed or new VSCode version upgraded, the plugin will prompt to dump backup file.

After changing the configuration, please open command panel and run Custom UI Style: Reload to apply the configuration.

To rollback or uninstall the plugin, please open command panel and run Custom UI Style: Rollback to restore the original VSCode file.

See details

FAQ

No Effect?

If you are using Windows or Linux, make sure you have closed all the VSCode windows and then restart.

If you are using MacOS, press <kbd>Command + Q</kbd> first, then restart VSCode.

There are guide and video (MacOS) of the process.

RangeError: Maximum call stack size exceeded

Due to system permission restrictions, you will receive RangeError: Maximum call stack size exceeded prompt when you reload the configuration. You need to fully close (press <kbd>Command + Q</kbd>) VSCode first, then run:

sudo chown -R $(whoami) "/Applications/Visual Studio Code.app"

See #6

Notice

Please make sure the VSCode is totally replaced while upgrading.

Configurations

<!-- configs -->
KeyDescriptionTypeDefault
custom-ui-style.preferRestartPrefer to restart vscode after update instead of reload window only (ALWAYS true when VSCode version >= 1.95.0)booleanfalse
custom-ui-style.reloadWithoutPromptingReload/restart immediately, instead of having to click 'Reload Window' in the notificationbooleanfalse
custom-ui-style.watchWatch configuration changes and reload window automaticallybooleantrue
custom-ui-style.electronElectron BrowserWindow optionsobject{}
custom-ui-style.font.monospaceGlobal monospace font family that apply in both editor and webview, fallback to editor's font familystring``
custom-ui-style.font.sansSerifGlobal sans-serif font family that apply in both editor and webviewstring``
custom-ui-style.background.urlFull-screen background image url, support protocol: 'https://', 'file://', 'data:'string``
custom-ui-style.background.opacityBackground image opacitynumber0.9
custom-ui-style.background.sizeBackground image sizestring"cover"
custom-ui-style.background.positionBackground image positionstring"center"
custom-ui-style.stylesheetCustom css for editor, support nest selectorsobject{}
custom-ui-style.webview.monospaceSelectorCustom monospace selector in webviewarray``
custom-ui-style.webview.sansSerifSelectorCustom sans-serif selector in webviewarray``
custom-ui-style.webview.stylesheetCustom css for webview, support nest selectorsobject{}
<!-- configs -->

Commands

<!-- commands -->
CommandTitle
custom-ui-style.reloadCustom UI Style: Reload
custom-ui-style.rollbackCustom UI Style: Rollback
<!-- commands -->

Example

Avaiable CSS Variables:

{
  // Electron BrowserWindow options
  //  - https://www.electronjs.org/docs/latest/api/base-window
  //  - https://www.electronjs.org/docs/latest/api/browser-window
  "custom-ui-style.electron": {
    // Frameless window (no title bar, no macos traffic light buttons)
    //  - "A frameless window removes all chrome applied by the OS, including window controls"
    //  - https://www.electronjs.org/docs/latest/api/base-window#new-basewindowoptions
    //  - https://www.electronjs.org/docs/latest/tutorial/custom-window-styles#frameless-windows
    //  - https://www.electronjs.org/docs/latest/tutorial/custom-title-bar
    "frame": false,
    // Disable rounded corners (macos)
    //  - https://www.electronjs.org/docs/latest/api/base-window#new-basewindowoptions
    //  - "Whether frameless window should have rounded corners on macOS"
    //  - "Setting this property to false will prevent the window from being fullscreenable"
    "roundedCorners": false,
  },
  "custom-ui-style.font.sansSerif": "Maple UI, -apple-system",
  "custom-ui-style.background.url": "file:///D:/image/ide-bg.jpg",
  "custom-ui-style.webview.monospaceSelector": [".codeblock", ".prism [class*='language-']"],
  "custom-ui-style.stylesheet": {
    "span:not([class*='dyn-rule'])+span[class*='dyn-rule']": {
      "border-top-left-radius": "3px",
      "border-bottom-left-radius": "3px"
    },
    "span[class*='dyn-rule']:has(+span:not([class*='dyn-rule']))": {
      "border-top-right-radius": "3px",
      "border-bottom-right-radius": "3px"
    },
    ".cdr": {
      "border-radius": "3px"
    },
    ".quick-input-widget": {
      "top": "25vh !important"
    },
    ".overlayWidgets .editorPlaceholder": {
      "line-height": "unset !important"
    },
    ".monaco-workbench .activitybar .monaco-action-bar": {
      "& .action-label": {
        "font-size": "20px !important",
        "&::before": {
          "position": "absolute",
          "z-index": 2
        },
        "&::after": {
          "content": "''",
          "width": "75%",
          "height": "75%",
          "position": "absolute",
          "border-radius": "6px"
        }
      },
      "& .action-item:hover .action-label": {
        "color": "var(--vscode-menu-selectionForeground) !important",
        "&::after": {
          "background-color": "var(--vscode-menu-selectionBackground)"
        }
      }
    }
  }
}

Credit

License

MIT