I wanna show index number before every li as content of before:: psudo element. But tailwind pseudo class before:: content not showing correctly?
(I use postcss for tailwind)
Heres this project git repo link.
Heres my nav component,
import React from "react";
import navData from "../data/navData.js";
class Nav extends React.Component {
render() {
let { brand } = navData;
let items = [];
for (const item in navData) {
items.push(navData[item]);
}
return (
<nav className="flex justify-between h-[clamp(0px,10vw,100px)] bg-base_color/75 items-center backdrop-blur-sm sticky top-0 text text-white_like">
<span className="ml-8">{brand}</span>
<ul className=" w-2/5 flex justify-between mr-8">
{items.slice(1).map((a, index) => {
return (
<li className={`before:content-['${index}']`} key={Math.random()}>
{a}
</li>
);
})}
</ul>
</nav>
);
}
}
export default Nav;
Here is my navData from another file-folder,
const navData = {
brand: "Mohiul Islam",
item1: "about",
item2: "experience",
item3: "work",
item4: "contact",
};
export default navData;