Domanda

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.

È stato utile?

Soluzione

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);

});
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top