You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+60-55Lines changed: 60 additions & 55 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@
7
7
</p>
8
8
</p>
9
9
10
-
Custom UI Style is a VSCode extension that modify CSS and JS code in editor and webview, unify global font family, setup background image and Electron BrowserWindow options, add your custom CSS or JS code, or patching file in other VSCode extensions
10
+
Custom UI Style is a VSCode extension that allows you to customize the editor's appearance and behavior by injecting custom CSS and JavaScript. You can unify the global font family, set a background image, modify Electron `BrowserWindow` options, add your own custom styles and scripts, and even patch files in other VSCode extensions.
11
11
12
12
- Works with VSCode 1.103! (Tested on Windows and MacOS)
13
13
@@ -21,28 +21,27 @@ Untested on Linux and VSCode forks (like Cursor, WindSurf, etc.), and I currentl
21
21
22
22
## Features
23
23
24
-
-Unified global font family
25
-
-Setup background image
26
-
-Custom nest stylesheet for both editor and webview
27
-
-Custom Electron `BrowserWindow` options
28
-
-[From V0.4.0] Support total restart
29
-
-[From V0.4.0] Suppress corrupt message
30
-
-[From V0.4.2]Load external CSS or JS file
31
-
-[From V0.6.0]Patch files in extension
24
+
-Unify the global font family for the editor and webviews.
25
+
-Set a background image for the editor window.
26
+
-Apply custom stylesheets to both the editor and webviews.
27
+
-Configure Electron `BrowserWindow` options.
28
+
-Support for restarting VSCode to apply changes.
29
+
-Suppress the "Your Code installation is corrupt" message.
30
+
- Load external CSS and JavaScript files.
31
+
- Patch files in other extensions.
32
32
33
33
## Usage
34
34
35
-
When first installed or new VSCode version upgraded, the plugin will prompt to dump backup file.
35
+
1.**Backup:** When you first install the extension or after a VSCode update, you'll be prompted to create a backup of the original files. This is important for rollback.
36
+
2.**Configure:** Add your customizations to your `settings.json` file. See the [Example](#example) and [Configurations](#configurations) sections for details.
37
+
3.**Apply:** Open the Command Palette (<kbd>Ctrl+Shift+P</kbd> or <kbd>Cmd+Shift+P</kbd>) and run `Custom UI Style: Reload` to apply your changes.
38
+
4.**Rollback:** To revert all changes and restore the original VSCode files, run `Custom UI Style: Rollback` from the Command Palette.
36
39
37
-
After changing the configuration, please open command panel and run `Custom UI Style: Reload` to apply the configuration.
38
-
39
-
To rollback or uninstall the plugin, please open command panel and run `Custom UI Style: Rollback` to restore the original VSCode file.
40
-
41
-
See [details](https://github.com/shalldie/vscode-background?tab=readme-ov-file#warns)
40
+
See [details](https://github.com/shalldie/vscode-background?tab=readme-ov-file#warns) for more information.
42
41
43
42
### Example
44
43
45
-
Avaiable CSS Variables:
44
+
Available CSS Variables:
46
45
47
46
-`--cus-monospace-font`: Target monospace font family
48
47
-`--cus-sans-font`: Target sans-serif font family
@@ -122,11 +121,13 @@ Avaiable CSS Variables:
122
121
123
122
### External Resources (CSS or JS File)
124
123
125
-
From v0.4.2, the extension supports loading external CSS or JS file from local file or remote URL. This operation may introduce security issue or runtime crash, use it with caution!
124
+
Starting from v0.4.2, you can load external CSS and JavaScript files from local or remote URLs.
126
125
127
-
All resources will be applied in editor instead of webview.
126
+
> [!caution]
127
+
> Loading external resources can introduce security risks or cause runtime crashes. Use this feature with caution.
128
128
129
-
All resources will be fetched, merged and persist according to resource type during reload, so there is no watcher support.
129
+
- All resources are applied to the editor, not webviews.
130
+
- Resources are fetched and merged during reload. Live-watching of files is not supported.
130
131
131
132
```jsonc
132
133
{
@@ -164,17 +165,17 @@ All resources will be fetched, merged and persist according to resource type dur
164
165
165
166
#### Load Strategy
166
167
167
-
By default, all resources will be refetched during every reload. Failed fetch will be skipped.
168
+
By default, all resources are re-fetched on every reload, and failed fetches are skipped.
168
169
169
-
To skip refetching resources if there is nothing changed on `custom-ui-style.external.imports`and all resources are successfully fetched before, setup:
170
+
To cache resources and avoid re-fetching when `custom-ui-style.external.imports`is unchanged, set the load strategy to `"cache"`:
170
171
171
172
```jsonc
172
173
{
173
174
"custom-ui-style.external.loadStrategy":"cache"
174
175
}
175
176
```
176
177
177
-
To disable all external resources, setup:
178
+
To disable all external resources, set the load strategy to `"disable"`:
178
179
179
180
```jsonc
180
181
{
@@ -206,41 +207,44 @@ Find and replace target string or `Regexp` in extension's file
206
207
207
208
## FAQ
208
209
209
-
### What is modified
210
+
### What is modified?
210
211
211
-
ALL modifications are located in VSCode's installation directory, and modified files are backed up with `custom-ui-style` suffix in same directory. See all file paths in [path.ts](https://github.com/subframe7536/vscode-custom-ui-style/tree/main/src/path.ts)
212
+
This extension modifies files in your VSCode installation directory. All modified files are backed up with a `.custom-ui-style` suffix in the same directory. You can see the full list of modified files in [`path.ts`](https://github.com/subframe7536/vscode-custom-ui-style/tree/main/src/path.ts).
212
213
213
-
When reload config, the extension will check backup file first, then read content from backup file and overwrite the original file with patches. Finally try to reload window or restart APP.
214
+
When you reload the configuration, the extension restores the original files from the backup, applies your custom patches, and then reloads the window or restarts the application.
214
215
215
216
### No Effect
216
217
217
-
If you are using Windows or Linux, make sure you have closed all the VSCode windows and then restart.
218
+
If your changes don't seem to apply, you may need to fully restart VSCode.
218
219
219
-
If you are using MacOS, press <kbd>Command + Q</kbd> first, then restart VSCode.
220
+
-**Windows/Linux:** Close all VSCode windows and restart the application.
221
+
-**macOS:** Press <kbd>Command + Q</kbd> to quit the application, then restart it.
220
222
221
-
There are [guide](https://github.com/subframe7536/vscode-custom-ui-style/issues/1#issuecomment-2423660217) and [video](https://github.com/subframe7536/vscode-custom-ui-style/issues/2#issuecomment-2432225106) (MacOS) of the process.
223
+
There are also a [guide](https://github.com/subframe7536/vscode-custom-ui-style/issues/1#issuecomment-2423660217) and a [video](https://github.com/subframe7536/vscode-custom-ui-style/issues/2#issuecomment-2432225106) (macOS) available for more detailed instructions.
222
224
223
225
### EROFS: read-only file system
224
226
225
-
This extension need to modify VSCode's source code but VSCode runs on read-only filesystem (snap, AppImage...). Maybe you need to choose another way to install VSCode.
227
+
If you see this error, it means VSCode is installed on a read-only filesystem (e.g., via Snap or AppImage). This extension needs to write to the installation directory, so you'll need to install VSCode using a different method.
226
228
227
229
### RangeError: Maximum call stack size exceeded
228
230
229
-
Due to system permission restrictions, maybe you will receive `RangeError: Maximum call stack size exceeded` prompt when you reload the configuration. You need to fully close VSCode first (press <kbd>Command + Q</kbd> on MacOS), then run:
231
+
This error can occur due to system permission restrictions. To fix it, you need to change the ownership of the VSCode installation directory.
232
+
233
+
First, fully close VSCode (<kbd>Command + Q</_kbd> on macOS). Then, run the following command:
230
234
231
235
```sh
232
-
#MacOS
236
+
#macOS
233
237
sudo chown -R $(whoami)"/Applications/Visual Studio Code.app"
234
238
235
239
# Linux
236
240
sudo chown -R $(whoami)"/usr/local/code"
237
241
```
238
242
239
-
See in [#6](https://github.com/subframe7536/vscode-custom-ui-style/issues/6)
243
+
See [#6](https://github.com/subframe7536/vscode-custom-ui-style/issues/6) for more details.
240
244
241
245
### Fail to render panel
242
246
243
-
According to [#34](https://github.com/subframe7536/vscode-custom-ui-style/issues/34), in Cursor (close source VSCode's fork), the extension detail panel will not show by default due to the violation of iframe's CSP. Currently the way to fix it is just skip patch on webview, so please set:
247
+
In some VSCode forks like Cursor, the extension detail panel may not render due to a Content Security Policy (CSP) violation. To work around this, you can disable the webview patch:
244
248
245
249
```json
246
250
{
@@ -252,28 +256,29 @@ According to [#34](https://github.com/subframe7536/vscode-custom-ui-style/issues
|`custom-ui-style.preferRestart`| Prefer to restart vscode after update instead of reload window only (ALWAYS true when VSCode version >= 1.95.0) |`boolean`|`false`|
258
-
|`custom-ui-style.reloadWithoutPrompting`| Reload/restart immediately, instead of having to click 'Reload Window' in the notification |`boolean`|`false`|
|`custom-ui-style.electron`| Electron BrowserWindow options |`object`|`{}`|
261
-
|`custom-ui-style.font.monospace`| Global monospace font family that apply in both editor and webview, fallback to editor's font family |`string`| `` |
262
-
|`custom-ui-style.font.sansSerif`| Global sans-serif font family that apply in both editor and webview |`string`| `` |
263
-
|`custom-ui-style.background.url`| Full-screen background image url (will not sync), support protocol: 'https://', 'file://', 'data:' |`string`| `` |
264
-
|`custom-ui-style.background.syncURL`| Full-screen background image url (will sync), support variable: [${userHome}, ${env:your_env_name:optional_fallback_value}], has lower priority than 'Url', support protocol: 'https://', 'file://', 'data:' |`string`| `` |
0 commit comments