fix: apply layout styles to div tag, closes #1130 (#1142)

This commit is contained in:
Huang Xin
2025-05-13 19:48:21 +08:00
committed by GitHub
parent 4779e2638f
commit d96fb32bcf
2 changed files with 7 additions and 4 deletions
+5 -2
View File
@@ -75,7 +75,10 @@ const Slider: React.FC<SliderProps> = ({
<div
className='bg-base-300 absolute h-full rounded-full'
style={{
width: percentage > 0 ? `calc(${percentage}% + ${heightPx / 2}px)` : '0px',
width:
percentage > 0
? `max(calc(${percentage}% + ${heightPx / 2}px), ${heightPx}px)`
: '0px',
[isRtl ? 'right' : 'left']: 0,
}}
></div>
@@ -94,7 +97,7 @@ const Slider: React.FC<SliderProps> = ({
}}
>
<div
className={`bg-base-200 flex h-full items-center justify-center rounded-full text-sm shadow-md ${bubbleClassName}`}
className={`bg-base-200 flex h-full items-center justify-center rounded-full text-xs shadow-md ${bubbleClassName}`}
style={{ width: `${heightPx}px` }}
>
{bubbleElement || bubbleLabel}
+2 -2
View File
@@ -227,7 +227,7 @@ const getLayoutStyles = (
width: auto;
background-color: transparent !important;
}
p, li, blockquote, dd {
p, div, li, blockquote, dd {
line-height: ${lineSpacing} ${overrideLayout ? '!important' : ''};
word-spacing: ${wordSpacing}px ${overrideLayout ? '!important' : ''};
letter-spacing: ${letterSpacing}px ${overrideLayout ? '!important' : ''};
@@ -241,7 +241,7 @@ const getLayoutStyles = (
hanging-punctuation: allow-end last;
widows: 2;
}
p {
p, div {
${vertical ? `margin-left: ${paragraphMargin}em ${overrideLayout ? '!important' : ''};` : ''}
${vertical ? `margin-right: ${paragraphMargin}em ${overrideLayout ? '!important' : ''};` : ''}
${!vertical ? `margin-top: ${paragraphMargin}em ${overrideLayout ? '!important' : ''};` : ''}