Skip to content
This repository was archived by the owner on Aug 12, 2022. It is now read-only.
/ css-format-monaco Public archive

css/less/scss format support for monaco editor

License

Notifications You must be signed in to change notification settings

troy351/css-format-monaco

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ced1f99 · Aug 12, 2022

History

55 Commits
Feb 18, 2021
Mar 11, 2019
Nov 16, 2019
Mar 11, 2019
Nov 16, 2019
Feb 18, 2021
Nov 16, 2019
Aug 12, 2022
Nov 16, 2019
Oct 21, 2021
Apr 7, 2020
Mar 11, 2019
Mar 11, 2019
Aug 1, 2021

Repository files navigation

css-format-monaco

Downloads Version License

CSS Formatter Plugin for monaco-editor

CSS / LESS / SCSS Support

Deprecated

CSS Formatter was builtin since monaco-editor@0.34.0

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