be5invis / vscode-custom-css

Custom CSS Plugin for Visual Studio Code. Based on vscode-icon
MIT License
868 stars 64 forks source link

Inline a css/js file in settings #199

Closed maxpatiiuk closed 1 year ago

maxpatiiuk commented 1 year ago

I am loving this extension so far. Have one suggestion:

It would be awesome to be able to specify the custom css inline in the settings.json, rather than the path to the CSS/js file.

Benefits:

Drawbacks:

If this sounds good, I would be happy to implement this feature and open a PR

Would look something like this:

// settings.json
{
  "vscode_custom_css.inline": "/* css string here */",
}

One issue is that multiline strings are not available in the settings.json, however, multiline is allowed in the Settings UI:

https://code.visualstudio.com/api/references/contribution-points#Configuration-property-schema

That might look like this:

Screenshot 2023-08-07 at 09 32 19

maxpatiiuk commented 1 year ago

A bit trickier alternative, but provides a better UX:

Create a custom webview for editing settings - and that webview could display a proper monaco editor with syntax highlighting.

The webview could inturn update the pref in settings.json OR, the extension could use ExtensionContext.globalState with setKeysForSync (see https://code.visualstudio.com/api/extension-capabilities/common-capabilities#data-storage) to store a syncable setting/settings

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days.