position: fixed
allows content to be positioned irrespective of scroll position, whereas position: absolute
just positions content based on the nearest positioned element, while allowing the content to scroll.
In XD 21/22, the fixed positioning offset was based on the plugins panel coordinates, not the plugin’s coordinates. This meant that you needed to add like 90 or 100px vertically to avoid the header that plugins have in the panel. It also allowed the plugin to escape its own UI container.
In XD 23/24, you can now use position: fixed
. In fact, there are some plugins that clearly used it and are now slightly broken due to use. If you do use position: fixed
be sure to detect the version of XD or set your plugin’s minVersion
to 23, since XD 21/22 will render differently than 23/24.