Import CSS
Plugin alias: importcss
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. |