This is a solution to the 3-column preview card component challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Note: Delete this note and update the table of contents based on what sections you keep.
Users should be able to:
I learnt to use WindiCSS's safelist config option to prevent dynamic concatenations from being removed at compile step. Will come in handy going forward.
<script>
// ...
export let color;
</script>
<!-- Windi cannot guess the possible combinations-->
<section class="... bg-{color}">
<!-- ... -->
<button class="... text-{color}">Learn More</button>
</section>
// solved
export default defineConfig({
safelist: [
'bg-orange',
'text-orange',
'bg-cyan-600',
'text-cyan-600',
'bg-cyan-700',
'text-cyan-700',
]
}