var clientParam = new URL(window.location.href).searchParams.get("_client");
var file = location.pathname.split("/").pop();
var link = document.createElement("link");

link.href = file.substr(0, file.lastIndexOf(".")) + "/frontendapi/dynamic_file/custom_css" + (typeof clientParam == 'string' ? "/" + clientParam : '');
link.type = "text/css";
link.rel = "stylesheet";
link.media = "screen,print";

document.getElementsByTagName("head")[0].appendChild(link);