const DummyData = [
{
_id: 1,
title: "lorem ipsum",
desc: " ",
cta: "Explore Service",
ctaUrl: "/",
theme: "#E4F8ED",
btnTheme: "#4F9D73",
links: [
{
title: "Project lorem ipsum Tools ",
url: "/",
},
{
title: "Augmented lorem ipsum ",
url: "/",
},
{
title: "lorem ipsum and Forecasting ",
url: "/",
},
{
title: "Data lorem ipsum Analytics ",
url: "/",
},
{
title: "Quality Control lorem ipsum Analysis ",
url: "/",
},
],
},
// more data
]
// jsx
<div className="text-left w-full bg-amber-100 mb-5 mx-auto grid grid-cols-1 sm:grid-cols-3">
{DummyData.map((item, index) => (
<div className={`bg-[${item.theme}] p-5`} key={item._id}>
<div className="p-4 h-full flex flex-col justify-between">
<div>
<p className="text-[#101828] font-bold text-[30px] leading-[36px]">
{item.title}
</p>
<p className="text-[#101828] text-[12px] font-normal my-4 leading-[18px]">
{item.desc}
</p>
</div>
<div>
<ul className="my-8">
{item.links.map((list, index) => (
<li
key={index}
className=" border-b-[1px] w-fit border-[#DBDBDB] py-2 "
>
<Link
href={list.url}
className="text-[#101828] text-[14px] font-medium leading-[22px] w-fit flex transition-all hover:opacity-75 "
>
{list.title}
</Link>
</li>
))}
</ul>
<Link
href={item.ctaUrl}
className={`text-[#fff] text-[14px] font-medium leading-[22px] w-fit py-2 px-8 flex transition-all hover:opacity-75 bg-[${item.btnTheme}]`}
>
{item.cta}{" "}
<Icon
path={mdiArrowTopRight}
style={{ marginLeft: "0.5em" }}
size={1}
/>
</Link>
</div>
</div>
</div>
))}
</div>
Having trouble with some CSS classes not rendering properly for buttons at times? Wondering why this happens and how to fix it? Is there a better approach to achieve this functionality? View the attached image for reference below. The button backgrounds in the automation and document understanding card are not displaying correctly, unlike the speech & language card. https://i.sstatic.net/EOrNn.png
Spent an hour looking through the code.