]> BookStack Code Mirror - bookstack/blob - resources/js/wysiwyg/utils/styles.ts
Lexical: Kinda made row copy/paste work
[bookstack] / resources / js / wysiwyg / utils / styles.ts
1
2 export type StyleMap = Map<string, string>;
3
4 export function createStyleMapFromDomStyles(domStyles: CSSStyleDeclaration): StyleMap {
5     const styleMap: StyleMap = new Map();
6     const styleNames: string[] = Array.from(domStyles);
7     for (const style of styleNames) {
8         styleMap.set(style, domStyles.getPropertyValue(style));
9     }
10     return styleMap;
11 }