Skip to content

Commit

Permalink
Merge pull request #368 from MovieReviewComment/fix/issue-366/polish
Browse files Browse the repository at this point in the history
  • Loading branch information
2wheeh authored May 15, 2024
2 parents c175385 + e1cfb7d commit e8f34e4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ui/src/editor/html-config/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { HTMLConfig } from 'lexical';
import { ParagraphNode, isHTMLElement } from 'lexical';

// https://github.com/facebook/lexical/issues/6082
export const htmlConfig: HTMLConfig = {
export: new Map([
[
Expand Down Expand Up @@ -45,13 +46,13 @@ function setElementIndent(dom: HTMLElement, indent: number, indentClassName?: st
}

const indentationBaseValue =
global.window.getComputedStyle(dom).getPropertyValue('--lexical-indent-base-value') ||
window.getComputedStyle(dom).getPropertyValue('--lexical-indent-base-value') ||
DEFAULT_INDENT_VALUE;

dom.style.setProperty(
// padding-inline-start is not widely supported in email HTML, but
// Lexical Reconciler uses padding-inline-start. Using text-indent instead.
'text-indent',
`calc(${indent} * ${indentationBaseValue})`
`${indent * parseInt(indentationBaseValue, 10)}px`
);
}

0 comments on commit e8f34e4

Please sign in to comment.