vite adds scripts and styles just before </head> this might be a problem with css specificity since in dev it's not that way. maybe instead of replacing ssr-head comment replace </head>