Default font color of richtext control
-
18-02-2021 - |
문제
Is it possible to set the default color of a Richtext React control element? I'm trying to make my webpart responsive to the section background color.
It's possible to give the richtext element its own class but I can't get it to respond to setting the color property.
해결책
I've figured out a workaround using a jQuery function that's called 'when needed':
export function SetRichtextDefaultColor(color : string){
$(".ql-editor").children("p").css("color", color);
}
a little more spohisticated, to make sure the background color is reflected on all editors correctly:
$('.ql-editor').each(function(){
var col = $(this).closest('.answer').css("color");
$(this).children("p").css("color", col);
});
제휴하지 않습니다 sharepoint.stackexchange