I have encountered something strange while working with Tailwind, wondering if anyone understands what is going on.
I am trying to center a popupmeny under the button that opened it, like this:
To do this I am positioning the menu using a translate expression:
const menuOffset = size.width / 2 - 1 + 'px'; //size.width = width of the button
className=`left-full translate-x-[calc(-75%-${menuOffset})]`
This works here where the button is 24x24px in size.
But for this button which is 32x32px, it seems like the expression is just invalid and the menu ends up like this:
I tried tweaking the one that works and it seems that while -75% works, -76% or -74% does not work. Why on earth is this? Does anyone know?