I show data with custom text color and how can I set background color with Javascript / alpinejs 2.2 to be text always good visible?
Thanks!
I show data with custom text color and how can I set background color with Javascript / alpinejs 2.2 to be text always good visible?
Thanks!
Using Alpine.js you can bind the style
attribute:
<div x-data="{ background: '#333' }" x-bind:style="`background-color: ${background}`">Dark grey background container</div>