来自外部服务器的CSS @import,比如get query

I have spent the past few days but I can not find a solution.

I try to import an external CSS directly from the CSS file using @import rule like this:

@import url(http://myanothersite.com/styles.php?style=1);

I need my external site using a php script gave the desired style depending on get request. But the problem is that the external site with the script does not give any style line. Maybe someone knows how to solve this problem.

Something similar had seen with fonts from Google, there is a script

https://fonts.googleapis.com/css?family=Ubuntu:400&subset=latin

and result is

@font-face {
font-family: 'Ubuntu';
font-style: normal;
font-weight: 400;
src: local('Ubuntu'), url(https://fonts.gstatic.com/s/ubuntu/v8/sDGTilo5QRsfWu6Yc11AXg.woff2) format('woff2');
}

You have to set the content type of your PHP file to CSS. Just simply place the following line on the top of your PHP code:

header("Content-type: text/css");