css-format-monaco
TypeScript icon, indicating that this package has built-in type declarations

2.0.4 • Public • Published

css-format-monaco

Downloads Version License

CSS Formatter Plugin for monaco-editor

CSS / LESS / SCSS Support

Compatibility

Compatible with Monaco Editor v0.12.0 and above

Install

$ npm install css-format-monaco

Usage

ES Module

import cssFormatMonaco from "css-format-monaco";

const dispose = cssFormatMonaco(
  // monaco-editor it self. If not provided, will use window.monaco instead.
  // This could make the plugin support both ESM and AMD loaded monaco-editor
  monaco,
  // options
  // see full option list at https://github.com/beautify-web/js-beautify#css--html
  {
    tab_size: 2
  }
);

// run it if you want to dispose this plugin
dispose();

Browser

<script src="https://unpkg.com/css-format-monaco/dist/css-format-monaco.min.js"></script>
<script>
  // NOTE: monaco-editor should be loaded first
  // see above esm example for details
  cssFormatMonaco(monaco);
</script>

License

MIT

Package Sidebar

Install

npm i css-format-monaco

Weekly Downloads

65

Version

2.0.4

License

MIT

Unpacked Size

193 kB

Total Files

15

Last publish

Collaborators

  • troy351