I have built a Wordpress site with a few pages. I am using Blocks for everything. From the menu to the footer. Everything are blocks.
I still have not figured out, in the menu, how to highlight the current page in the menu items.
I am using tailwind CSS.
Did you use a WordPress menu? If yes then it adds this class (current-menu-item) to the menu item when it is the current page. You can style that class.
Hey Thank you,
so yes, I am using the Menu - Smart wordpress action.
This should be my style for the active menu item.
But since I am using Tailwind CSS… I created a new css file “dunecss.css” and loaded inside my style wp header block.
Result: it partially works! Wordpress applies the
font-weight: bold; but not the color property.
I am guessing this is related to some tailwind css style thing.
If i use the important ! css rule with the color property then it will work.
font-weight: bold! important;
Maybe there is another way to get the style to work. I really like Tailwind CSS though it adds and extra thing to handle.
Great! Glad you got it too work. I don’t use Tailwind so could not be of any help there