All files / roosterjs-content-model-dom/lib/formatHandlers/common boxShadowFormatHandler.ts

100% Statements 5/5
87.5% Branches 7/8
100% Functions 2/2
100% Lines 5/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19            1x   36x 1x       55x 1x        
import type { BoxShadowFormat } from 'roosterjs-content-model-types';
import type { FormatHandler } from '../FormatHandler';
 
/**
 * @internal
 */
export const boxShadowFormatHandler: FormatHandler<BoxShadowFormat> = {
    parse: (format, element) => {
        if (element.style?.boxShadow) {
            format.boxShadow = element.style.boxShadow;
        }
    },
    apply: (format, element) => {
        if (format.boxShadow) {
            element.style.boxShadow = format.boxShadow;
        }
    },
};