Don't apply any styles if inherit from theme is turned on
[MAILPOET-2599]
This commit is contained in:
committed by
Veljko V
parent
47142be4c5
commit
9689b846a1
@@ -107,21 +107,21 @@ const CustomTextAreaEdit = ({ attributes, setAttributes, clientId }) => {
|
|||||||
</InspectorControls>
|
</InspectorControls>
|
||||||
);
|
);
|
||||||
|
|
||||||
const labelStyles = {
|
const labelStyles = !attributes.styles.inheritFromTheme ? {
|
||||||
fontWeight: attributes.styles.bold ? 'bold' : 'inherit',
|
fontWeight: attributes.styles.bold ? 'bold' : 'inherit',
|
||||||
};
|
} : {};
|
||||||
|
|
||||||
const inputStyles = {
|
const inputStyles = !attributes.styles.inheritFromTheme ? {
|
||||||
borderRadius: attributes.styles.borderRadius ? `${attributes.styles.borderRadius}px` : 0,
|
borderRadius: attributes.styles.borderRadius ? `${attributes.styles.borderRadius}px` : 0,
|
||||||
borderWidth: attributes.styles.borderSize ? `${attributes.styles.borderSize}px` : '1px',
|
borderWidth: attributes.styles.borderSize ? `${attributes.styles.borderSize}px` : '1px',
|
||||||
borderColor: attributes.styles.borderColor || 'initial',
|
borderColor: attributes.styles.borderColor || 'initial',
|
||||||
};
|
} : {};
|
||||||
|
|
||||||
if (attributes.styles.fullWidth) {
|
if (attributes.styles.fullWidth) {
|
||||||
inputStyles.width = '100%';
|
inputStyles.width = '100%';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (attributes.styles.backgroundColor) {
|
if (attributes.styles.backgroundColor && !attributes.styles.inheritFromTheme) {
|
||||||
inputStyles.backgroundColor = attributes.styles.backgroundColor;
|
inputStyles.backgroundColor = attributes.styles.backgroundColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -14,21 +14,21 @@ const TextInputEdit = ({
|
|||||||
const input = useRef(null);
|
const input = useRef(null);
|
||||||
const id = `${name}_${Math.random().toString(36).substring(2, 15)}`;
|
const id = `${name}_${Math.random().toString(36).substring(2, 15)}`;
|
||||||
|
|
||||||
const labelStyles = {
|
const labelStyles = !styles.inheritFromTheme ? {
|
||||||
fontWeight: styles.bold ? 'bold' : 'inherit',
|
fontWeight: styles.bold ? 'bold' : 'inherit',
|
||||||
};
|
} : {};
|
||||||
|
|
||||||
const inputStyles = {
|
const inputStyles = !styles.inheritFromTheme ? {
|
||||||
borderRadius: styles.borderRadius ? `${styles.borderRadius}px` : 0,
|
borderRadius: styles.borderRadius ? `${styles.borderRadius}px` : 0,
|
||||||
borderWidth: styles.borderSize ? `${styles.borderSize}px` : '1px',
|
borderWidth: styles.borderSize ? `${styles.borderSize}px` : '1px',
|
||||||
borderColor: styles.borderColor || 'initial',
|
borderColor: styles.borderColor || 'initial',
|
||||||
};
|
} : {};
|
||||||
|
|
||||||
if (styles.fullWidth) {
|
if (styles.fullWidth) {
|
||||||
inputStyles.width = '100%';
|
inputStyles.width = '100%';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (styles.backgroundColor) {
|
if (styles.backgroundColor && !styles.inheritFromTheme) {
|
||||||
inputStyles.backgroundColor = styles.backgroundColor;
|
inputStyles.backgroundColor = styles.backgroundColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user