mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
prettier
This commit is contained in:
parent
d7f681a60b
commit
aedf3f4cba
@ -44,8 +44,8 @@ import {overflow, OVERFLOW} from './property-descriptors/overflow';
|
||||
import {overflowWrap} from './property-descriptors/overflow-wrap';
|
||||
import {paddingBottom, paddingLeft, paddingRight, paddingTop} from './property-descriptors/padding';
|
||||
import {textAlign} from './property-descriptors/text-align';
|
||||
import { position, POSITION } from './property-descriptors/position';
|
||||
import { textFillColor } from './property-descriptors/text-fill-color';
|
||||
import {position, POSITION} from './property-descriptors/position';
|
||||
import {textFillColor} from './property-descriptors/text-fill-color';
|
||||
import {textShadow} from './property-descriptors/text-shadow';
|
||||
import {textTransform} from './property-descriptors/text-transform';
|
||||
import {textStrokeColor} from './property-descriptors/text-stroke-color';
|
||||
@ -202,7 +202,7 @@ export class CSSParsedDeclaration {
|
||||
this.paddingLeft = parse(paddingLeft, declaration.paddingLeft);
|
||||
this.position = parse(position, declaration.position);
|
||||
this.textAlign = parse(textAlign, declaration.textAlign);
|
||||
this.textFillColor = parse(textFillColor, declaration.textFillColor)
|
||||
this.textFillColor = parse(textFillColor, declaration.textFillColor);
|
||||
this.textDecorationColor = parse(textDecorationColor, declaration.textDecorationColor || declaration.color);
|
||||
this.textDecorationLine = parse(textDecorationLine, declaration.textDecorationLine);
|
||||
this.textShadow = parse(textShadow, declaration.textShadow);
|
||||
|
@ -1,12 +1,18 @@
|
||||
|
||||
import { CSSParsedDeclaration } from '../css/index';
|
||||
import { isLinearGradient, isRadialGradient } from '../css/types/image';
|
||||
import { BACKGROUND_CLIP } from '../css/property-descriptors/background-clip';
|
||||
import {CSSParsedDeclaration} from '../css/index';
|
||||
import {isLinearGradient, isRadialGradient} from '../css/types/image';
|
||||
import {BACKGROUND_CLIP} from '../css/property-descriptors/background-clip';
|
||||
|
||||
export const isFontColorGradient = (styles: CSSParsedDeclaration) => {
|
||||
if (styles.backgroundImage.length === 1 && (isLinearGradient(styles.backgroundImage[0]) || isRadialGradient(styles.backgroundImage[0]))) {
|
||||
return (styles.textFillColor === 0 || styles.color === 0) && styles.backgroundClip.length === 1 && styles.backgroundClip[0] === BACKGROUND_CLIP.TEXT;
|
||||
if (
|
||||
styles.backgroundImage.length === 1 &&
|
||||
(isLinearGradient(styles.backgroundImage[0]) || isRadialGradient(styles.backgroundImage[0]))
|
||||
) {
|
||||
return (
|
||||
(styles.textFillColor === 0 || styles.color === 0) &&
|
||||
styles.backgroundClip.length === 1 &&
|
||||
styles.backgroundClip[0] === BACKGROUND_CLIP.TEXT
|
||||
);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user