# Import CSS

> Editor42 Import CSS plugin — scans stylesheets and converts CSS selectors into editor format definitions.

Source: https://editor42.com/plugins/importcss  
Every page of editor42.com has a Markdown copy at its URL + `.md` (`index.md` after a URL that ends in `/`); all of them are in one file: https://editor42.com/llms-full.txt

Plugin alias: `importcss`

```js
editor42.init({
  plugins: 'importcss'
});
```

Scans CSS stylesheets loaded in the editor content area and automatically converts their CSS selectors into editor format/style definitions. These are surfaced in the Formats/Styles dropdown, allowing users to apply CSS classes without manual format configuration.

## Options

| Option | Type | Default | Description |
|---|---|---|---|
| `importcss_merge_classes` | boolean | `true` | Merge CSS classes onto existing elements. |
| `importcss_exclusive` | boolean | `true` | Each selector appears only once. |
| `importcss_selector_converter` | function | — | Custom converter from CSS selector to format definition. |
| `importcss_selector_filter` | string/RegExp/function | — | Include/exclude selectors. |
| `importcss_file_filter` | string/RegExp/function | — | Include/exclude stylesheets by URL. |
| `importcss_groups` | object[] | — | Organize imported styles into named groups. |
| `importcss_append` | boolean | `false` | Append to existing formats instead of replacing. |

## Events

| Event | Description |
|---|---|
| `addStyleModifications` | Dispatched with `{ items, replace }` after processing. |

## API

| Method | Description |
|---|---|
| `convertSelectorToFormat(selectorText)` | Converts a CSS selector to a format object. |
