Wikipedia:User scripts/Guide: Difference between revisions

Content deleted Content added
Line 671:
 
=== Loading a localhost file ===
For local development only, you can load a CSS file from your local web server (see the previous section for an easy-to-install web server). Put this line at the top of your [[Special:Mypage/common.css|/common.css]]:
<syntaxhighlight lang="css" style="min-width:fit-content; max-width: 40%">
@import "http://localhost/wikipediatest.css";
</syntaxhighlight>
'''Note!''' Such <code>@import</code> statements must come before any other declarations in your CSS., But there can be <code>/*except comments */</code> above them.
 
An alternative way is to put this line in your Javascript file[[Special:Mypage/common.js|/common.js]] instead:
 
<syntaxhighlight lang="javascript" copy style="min-width:fit-content; max-width: 40%">