Changing font color based on condition

Why you do this…??? (do you have more of stored keys in wix-storage)?

$w("#"+section+"comp").text=local.getItem("SC"+section+"_comparison");

Why not just →

let comparison = local.getItem("SChouse_comparison");
let txtColor = local.getItem("SChouse_color");

One hint/tip → Try to use more SHORTEN variables, do not create long variable-names → it will let explode your code. What do i mean?

Here an example:
Why this…(do you have more of similar/different keys to be stored in the wix-storage)?

local.setItem("SChouse_comparison",comparison);

If not, than just do the following…

local.setItem("comparison",comparison);

The same for… (instead of…)

textcolor

Do…

txtColor

Yes these are very little detailed improvements, but when you will perhaps handle bigger codes in your future, this will keep a good overview of your code.

Also try to find a basic systematic definition rule for all of your variables, constants and so on…

What do i mean?

Here you use this method → score_comp
And here another → textcolor
A third one could be —> textColor
A fourth systematical one could be → txtColor
… and so on.

What do i want to tell you?
Try to find your own unique fixed coding style → this will upgrade your own CODE-readability → because you will have a systematical written code.

And for your color problem…

let size = 10px
let color = local.getItem("SChouse_color");
let text = "My text here...."
$w('#element').html=`<p style="color:${color}; font-size:${size}">${text}</p>`;