I need to read a width of a class on page and base on that I need to hide a button. Without using js, since it could slow down the app since page itself is loaded with data. I was adviced to use container queries in css but they seem not to work in Mendix. It is even supported or I'm just doing things wrong?
Container queries are handled by the browser, so Mendix is probably not to blame.
You can develop a pluggable widget with a client canvas that calls a micro/nanoflow after rendering to toggle a boolean that is used in conditional visibility.
BTW a class has no width, you probably mean an element node in the DOM (something possibly visible on screen).