[MediaWiki-l] Is namespace specific CSS possible?

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[MediaWiki-l] Is namespace specific CSS possible?

rkevans
Hello,

I would like the CSS to be slightly different depending on which namespace the article is in; such as, a different background or logo. Is this possible?

MediaWiki 1.28.2
PHP 5.6.31 (apache2handler)
MariaDB 5.5.52-MariaDB
ICU 50.1.2

Thank you,
-Rich


_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is namespace specific CSS possible?

Amanda Quad
Hello,
I think so. I think you can customize your MediaWiki:Common.css page to include different stylings for different namespaces. Don't quote me on that though - but I think it's possible.
--Amanda


On Wednesday, August 2, 2017, 12:56 PM, Evans, Richard K. (GRC-H000) <[hidden email]> wrote:

Hello,

I would like the CSS to be slightly different depending on which namespace the article is in; such as, a different background or logo. Is this possible?

MediaWiki 1.28.2
PHP 5.6.31 (apache2handler)
MariaDB 5.5.52-MariaDB
ICU 50.1.2

Thank you,
-Rich


_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l



_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is namespace specific CSS possible?

rkevans
In reply to this post by rkevans
Looks like I posted my question just a moment too soon ... I just found this:
https://www.mediawiki.org/wiki/Manual:Using_custom_namespaces#Styling_namespaces

Thanks though,
Cheers!
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is namespace specific CSS possible?

rkevans
In reply to this post by Amanda Quad
Hi Amanda, yes, thank you!

I just discovered that the default skin (monobook) is indeed able to do this with common.css, but then I quickly discovered that common.css seems to be completely ignored by the Semantic Mediawiki "Chameleon"

https://www.mediawiki.org/wiki/Skin:Chameleon

It's a great skin and I have other reasons for needing to use it. Can anyone give me a few pointers on how to change the css of a skin like that.. it seems to not use CSS at all.

-Rich
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is namespace specific CSS possible?

Stephan Gambke-3
Hi Rich.
First of all, Chameleon should support MediaWiki:Common.css. I just tried setting it to
body.mediawiki {background-image: url(https://lh3.googleusercontent.com/mvHbePT-FyB8YpsjecAdCSvK7XoqOcsa4rqpCksWUDZ1koC_2cOfzvt2QU6rPsk5Yuri=w300) !important;background-repeat: repeat;}
on a test wiki and it worked (Careful, this accesses an external resource!).
If this really doesn't work, you could try adding your own less file. See https://github.com/cmln/chameleon/blob/master/docs/customization.md#changing-styles-fonts-colors-padding-etc

Less is a superset of css, so anything you can put in a css file, you can also put in a less file. However, I suspect if it does not work in MediaWiki:Common.css, it won't work in its own file either. One issue with Twitter Bootstrap used by Chameleon is, that it sometimes sets css rules so specific, that they take precedence over what you try to set. So, make sure to be more specific.
Cheers
Stephan

> -------- Original Message --------
> Subject: Re: [MediaWiki-l] Is namespace specific CSS possible?
> Local Time: August 2, 2017 7:21 PM
> UTC Time: August 2, 2017 5:21 PM
> From: [hidden email]
> To: MediaWiki announcements and site admin list <[hidden email]>
> Hi Amanda, yes, thank you!
> I just discovered that the default skin (monobook) is indeed able to do this with common.css, but then I quickly discovered that common.css seems to be completely ignored by the Semantic Mediawiki "Chameleon"
> https://www.mediawiki.org/wiki/Skin:Chameleon
> It"s a great skin and I have other reasons for needing to use it. Can anyone give me a few pointers on how to change the css of a skin like that.. it seems to not use CSS at all.
> -Rich
> _______________________________________________
> MediaWiki-l mailing list
> To unsubscribe, go to:
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is namespace specific CSS possible?

Stephan Gambke-3
Trying again with the correct content (s/url/url/):
body.mediawiki {background-image: url(https://lh3.googleusercontent.com/mvHbePT-FyB8YpsjecAdCSvK7XoqOcsa4rqpCksWUDZ1koC_2cOfzvt2QU6rPsk5Yuri=w300) !important;background-repeat: repeat;}
If this does not work, I blame it on my mail provider.

> -------- Original Message --------
> Subject: Re: [MediaWiki-l] Is namespace specific CSS possible?
> Local Time: August 2, 2017 9:25 PM
> UTC Time: August 2, 2017 7:25 PM
> From: [hidden email]
> To: MediaWiki announcements and site admin list <[hidden email]>
> MediaWiki announcements and site admin list <[hidden email]>
> Hi Rich.
> First of all, Chameleon should support MediaWiki:Common.css. I just tried setting it to
> body.mediawiki {background-image: url(https://lh3.googleusercontent.com/mvHbePT-FyB8YpsjecAdCSvK7XoqOcsa4rqpCksWUDZ1koC_2cOfzvt2QU6rPsk5Yuri=w300) !important;background-repeat: repeat;}
> on a test wiki and it worked (Careful, this accesses an external resource!).
> If this really doesn't work, you could try adding your own less file. See https://github.com/cmln/chameleon/blob/master/docs/customization.md#changing-styles-fonts-colors-padding-etc
>
> Less is a superset of css, so anything you can put in a css file, you can also put in a less file. However, I suspect if it does not work in MediaWiki:Common.css, it won't work in its own file either. One issue with Twitter Bootstrap used by Chameleon is, that it sometimes sets css rules so specific, that they take precedence over what you try to set. So, make sure to be more specific.
> Cheers
> Stephan
>
>> -------- Original Message --------
>> Subject: Re: [MediaWiki-l] Is namespace specific CSS possible?
>> Local Time: August 2, 2017 7:21 PM
>> UTC Time: August 2, 2017 5:21 PM
>> From: [hidden email]
>> To: MediaWiki announcements and site admin list <[hidden email]>
>> Hi Amanda, yes, thank you!
>> I just discovered that the default skin (monobook) is indeed able to do this with common.css, but then I quickly discovered that common.css seems to be completely ignored by the Semantic Mediawiki "Chameleon"
>> https://www.mediawiki.org/wiki/Skin:Chameleon
>> It"s a great skin and I have other reasons for needing to use it. Can anyone give me a few pointers on how to change the css of a skin like that.. it seems to not use CSS at all.
>> -Rich
>> _______________________________________________
>> MediaWiki-l mailing list
>> To unsubscribe, go to:
>> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is namespace specific CSS possible?

rkevans
Hi Stephan, ... Ah! .. that worked very well. Fabulous. Thank you! I'm not sure what my earlier issue was.

So..  if I wanted that background image to only appear on, say, Namespace ID=4012, what would I edit it as?

The code:

.ns-4012 body.mediawiki {background-image: url(https://lh3.googleusercontent.com/mvHbePT-FyB8YpsjecAdCSvK7XoqOcsa4rqpCksWUDZ1koC_2cOfzvt2QU6rPsk5Yuri=w300) !important;background-repeat: repeat;}

Does not do what I hoped it would. Any thoughts?

Thank you so much!
-Rich
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is namespace specific CSS possible?

Bartosz Dziewoński
On 2017-08-03 00:28, Evans, Richard K. (GRC-H000) wrote:
> Hi Stephan, ... Ah! .. that worked very well. Fabulous. Thank you! I'm not sure what my earlier issue was.
>
> So..  if I wanted that background image to only appear on, say, Namespace ID=4012, what would I edit it as?
>
> The code:
>
> .ns-4012 body.mediawiki {background-image: url(https://lh3.googleusercontent.com/mvHbePT-FyB8YpsjecAdCSvK7XoqOcsa4rqpCksWUDZ1koC_2cOfzvt2QU6rPsk5Yuri=w300) !important;background-repeat: repeat;}
>
> Does not do what I hoped it would. Any thoughts?

Both "mediawiki" and "ns-4012" are classes on the <body> tag, so the
selector should be: body.mediawiki.ns-4012

--
Bartosz Dziewoński

_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is namespace specific CSS possible?

rkevans
In reply to this post by rkevans
Ha! Got it..

body.mediawiki.ns-4012 {background-image: url(..myImageURL..)!important;background-repeat: repeat;}

does it.

Thank you so much!
-Rich
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Loading...