Forum:Less wasteful SiteNotice

From the RuneScape Wiki, the wiki for all things RuneScape
Jump to: navigation, search
Forums: Yew Grove > Less wasteful SiteNotice
Archive
This page or section is an archive.
Please do not edit the contents of this page.
This thread was archived on 19 July 2009 by Azaz129.

No, I'm not asking for a change to the site notice in any way really. Well, except adding a little css snippet that gets rid of the margin and padding on the site notice's tables. Basically some of the space around the site notice is removed(although, not all of it).

/* Saves some space with the site notice */
#siteNotice table {
    margin: 0;
    padding: 0;
}
http://img13.imageshack.us/img13/4199/beforeafters.png

Discussion

We don't need a forum for this. Just change it, if people dont like it after a few days we can change back. YG is for big stuff.--Degenret01 03:56, 29 June 2009 (UTC)

Lol. I can't see the difference. =p Santa hat.png Powers38 おはようヾ(´・ω・`) 03:57, 29 June 2009 (UTC)

Neither. Just change it. ~ Fire Surge icon.png Sentry Telos Talk  06:05, 29 June 2009 (UTC)

Comment - In Monobook, the sitenotice becomes too close to the main tabs.   az talk   15:04, 29 June 2009 (UTC)

It can just be added to [[MediaWiki:Monaco.css]] then. - TehKittyCatTalk Wikian-Book 20:34, 29 June 2009 (UTC)
I've added it to Monaco.css, but I don't see any changes. Is this because it is already in Common.css?   az talk  

:::It should be working now, the cache had to catch up. - TehKittyCatTalk Wikian-Book 21:49, 29 June 2009 (UTC)

nvm, it reverted back, may be it is just the usual blame Wikia's cache. - TehKittyCatTalk Wikian-Book 21:57, 29 June 2009 (UTC)

You need to give the SiteNotice table an ID first.

//-->{| width="100%" class="wikitable collapsible" id="siteNotice"

And then edit the ccs [[MediaWiki:Monaco.css|Monaco.ccs]] ;

/* Fix padding for table in "MediaWiki:SiteNotice" */
#siteNotice {
    margin: 0px;
    padding: 0px;
}

Adult chameleon (automatic).png Anurin Talk · Sign! . 10:34, 1 July 2009 (UTC)

According to the HTML, the DIV already has the same ID:

<div id="siteNotice"><script type="text/javascript" language="JavaScript"> ... </script></div>

If I'm not mistaken, all IDs must be unique.   az talk   15:12, 1 July 2009 (UTC)
Well then you give it another name? :s Adult chameleon (automatic).png Anurin Talk · Sign! . 15:47, 1 July 2009 (UTC)
Does it work now?   az talk   16:04, 1 July 2009 (UTC)
No it doesn't =/. Can you remove the "!important" from the sitenotice codes in monaco.css and common.css? It overrides my personal css so I cant test anything. Adult chameleon (automatic).png Anurin Talk · Sign! . 16:55, 1 July 2009 (UTC)

Just add !important in your CSS file.   az talk   17:04, 1 July 2009 (UTC)

From Wikipedia,

Author stylesheets, in this order:
  • MediaWiki in general, per skin: http://meta.wikimedia.org/skins-1.5/monobook/main.css etc.
  • site-wide for all skins: MediaWiki:Common.css
  • site-wide per skin: MediaWiki:Monobook.css, etc.
  • user-specific per wiki and per skin: User:username/monobook.css, etc. (note that in the CSS terminology this is not a user stylesheet)

User stylesheet:

  • web-wide, user-specific: local file, referred to in the browser settings, or directly set in the browser

In the case of conflicting style settings for a piece of content, the resulting setting depends primarily on the indication "!important". Secondarily, if both are important, the user wins, if neither is, the author wins. Tertiarily it depends on specificity. Only lastly it depends on order between and within stylesheets: the last wins. Thus a User:username/monobook.css does not win from MediaWiki:Monobook.css (both author, not user) if the specificity of the latter is greater.

Ooh thanks =) Adult chameleon (automatic).png Anurin Talk · Sign! . 17:06, 1 July 2009 (UTC)

Fixed. Add this code to [[MediaWiki:Monaco.css|Monaco.ccs]] Adult chameleon (automatic).png Anurin Talk · Sign! . 17:15, 1 July 2009 (UTC)

/* Fix padding for table in "MediaWiki:SiteNotice" */
div#siteNotice {
    margin-top: -12px !important;
}
Does it work now?   az talk   17:25, 1 July 2009 (UTC)
No. How come it doesn't work now but did work on my personal monaco.css? o_O Adult chameleon (automatic).png Anurin Talk · Sign! . 22:18, 1 July 2009 (UTC)
And I thought I was going crazy about it working on personal, but not site. Maybe I can grab someone from #wikia to figure the css out. - TehKittyCatTalk Wikian-Book 01:55, 2 July 2009 (UTC)

With help on irc it has been solved:

Add to MediaWiki:Common.css, what we were missing was that [[MediaWiki:Monaco.css]] only works with custom Monaco. The "div#article" makes it only apply to Monaco. So, just add the "div#article" if you use the other suggested versions.

/* Remove the padding around the site notice */
div#article div#siteNotice table {
    margin: 0 !important;
    padding: 0 !important;
}
div#article div#siteNotice {
    margin-top: -12px !important;
    margin-left: -11px !important;
    margin-right: -11px !important;
    margin-bottom: -7px !important;
}

It will look like this(ignore the colors):
http://img197.imageshack.us/img197/7575/finalkug.png

- TehKittyCatTalk Wikian-Book 02:29, 2 July 2009 (UTC)

I modified the CSS a bit. The margins were off by some pixels, and I adjusted them. Since "padding: 0" is already defined, I didn't include it in "div#article div#siteNotice table". The new CSS is as follows:

/* Fix padding for table in "MediaWiki:SiteNotice" */
div#siteNotice {                      /* For both Monobook and Monaco */
    padding: 0 !important;            /* original setting is: 0 .9em; */
}

div#article div#siteNotice table {    /* Specific for Monaco */
    margin: 0 !important;
}

div#article div#siteNotice {          /* Specific for Monaco */
    margin-top: -10px !important;
    margin-left: -10px !important;
    margin-right: -11px !important;
}

It works now.   az talk   06:31, 2 July 2009 (UTC)

Looks nice. Smile - TehKittyCatTalk Wikian-Book 06:33, 2 July 2009 (UTC)

Request for closure - This has been completed. - TehKittyCatTalk Wikian-Book 23:57, 18 July 2009 (UTC)