FANDOM


  • Apologies if this isn't the correct board. I read the descriptions and it wasn't entirely clear to me where this would go.

    So, I have already come up with this CSS and was wondering if it would be a decent candidate to add to this wiki.

    What does it do? It fixes what I believe to be some display issues with the syntaxhighlight/source tag under certain conditions. Specifically:

    1. Line numbers longer than 2 digits
    2. Horizontal scrolling when highlighting is in use

    From what I can tell, there is no visually discernible change when these conditions aren't met; so it shouldn't cause any odd display behavior unless interacting with other CSS (such as Nord or GeSHiStyles).

    I have provided an exaggerated example below:

    <syntaxhighlight lang="css" line start="1234" highlight="3" style="width: 200px; height: 100px;">
    table {
        padding: 25px;
        background-image: url("https://vignette.wikia.nocookie.net/shadows-lionking/images/5/50/Wiki-background/revision/latest");
    }
    </syntaxhighlight>
    
    1. table {
    2.     padding: 25px;
    3.     background-image: url("https://vignette.wikia.nocookie.net/shadows-lionking/images/5/50/Wiki-background/revision/latest");
    4. }

    If it would be a good idea to add it, how do I do that? Is it just as simple as creating the documentation and stylesheet as described here or is there more to it?


    Edit:

    Apparently the line numbers aren't too much of an issue in threads. But if you test it on a normal page you can see what I am talking about. Also make sure to disable personal and site CSS/JS. Apparently Community Central already has some CSS that mitigates some of the display issue. Not sure if the same is true here.

      Loading editor
    • I personally think it's a cool idea, but I'll leave up the final decisions to the admins and other moderators and see what they think.

        Loading editor
    • if "to add to this wiki" means "add to sitewide styles", then it would be not so good idea as meets the eye. because of specific of this wiki: doc pages here might be used as a demo for the script/style. while style itself is useful, using it sitewide on this wiki might interfere with demos.

        Loading editor
    • That stylesheet is short enough that'd it'd probably be better off in the CSS Cookbook.

        Loading editor
    • Yeah, sorry about the confusion. What I meant by "add to this wiki" was adding as something users can copy/import to their own wiki or personal CSS; not necessarily something that this wiki itself would use. I could definitely add it to the cookbook; there definitely isn't a whole lot to say about it so a while separate documentation page does seem unnecessary. What section would you think it belongs to best? It could be used for both site enhancement or user customization.

      A side question: What determines if a JS demo gets placed in MediaWiki:DemoScripts.js or MediaWiki:Custom-DemoScripts? I tried to help someone out once by adding a demo for their script but apparently I added it to the wrong one.

        Loading editor
    • custom- supposed to be used for js only. .js permits all stuff.

        Loading editor
    • Okay. But what is the deciding factor for where something goes? From the looks of it, there are some demos that specify just JS but they are still in the .js.


      Edit:

      Okay, I added it under site enhancements for now. I tried to include my example from above but there seems to be some site-specific CSS that is being applied. I tried using ?usesitecss=0&useusercss=0&usesitejs=0&useuserjs=0 as well as disabling the various gadgets but I can't seem to prevent it from being applied. It is a bit annoying as it hides (i.e. you don't see it here) the 2-digit cut-off issue I mentioned. However, you can try the example on most other wikis and you would be able to see what I am talking about.

        Loading editor
    • Andrewds1021#7
      But what is the deciding factor for where something goes? From the looks of it, there are some demos that specify just JS but they are still in the .js.

      if script myscript.js has demo page myscript and there is no any special conditions, then the script might be placed into custom-. all other instances that u see in the .js are special ones: demo pagename is not equal to script name, script has special prerequsities to run, etc.
        Loading editor
    • Ah, okay. So, as long as new JS-only stuff follows the current naming convention, it should be placed in MediaWiki:Custom-DemoScripts.

        Loading editor
    • A FANDOM user
        Loading editor
Give Kudos to this message
You've given this message Kudos!
See who gave Kudos to this message
Community content is available under CC-BY-SA unless otherwise noted.