Last modified: 2013-04-05 21:47:10 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T28478, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 26478 - User CSS: @import is inside @media
User CSS: @import is inside @media
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
ResourceLoader (Other open bugs)
1.18.x
All All
: Normal enhancement (vote)
: ---
Assigned To: Trevor Parscal
http://translatewiki.net/w/load.php?d...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-12-29 14:05 UTC by Umherirrender
Modified: 2013-04-05 21:47 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Umherirrender 2010-12-29 14:05:21 UTC
I am using a @import statement in my skin.css to load css from another side. There is no way to do this with js, because sometimes I am using a browser without js. It looks like that css is not loaded anymore since the resource loader is used.

The problem is that the skin.css is wrapped in a @media {}. But the @import should be outside the @media{}.

It is possible to put a @import statement outside the @media, so it works?

Thanks.
Comment 1 Roan Kattouw 2010-12-29 15:50:04 UTC
I've always been puzzled as to why we even do @media all { } anyway. Can't we use @media just for the "special" media ('print' and 'screen') and use top-level CSS for 'all'? Of course that'd just move the problem to @import not working or not working properly for media-specific CSS, but I think that's less of a problem.
Comment 2 Umherirrender 2010-12-30 10:12:07 UTC
You can import css with @import for specific media, so that is no problem (http://www.w3.org/TR/CSS21/cascade.html#at-import)

I have also seen some user using @media in his user.css. I do not know if there also break (@media inside @media) after updating to RessourceLoader.
Comment 3 Trevor Parscal 2011-01-06 00:24:10 UTC
I sense that our cleverness is getting us in trouble..
Comment 4 Krinkle 2011-01-06 00:30:00 UTC
Before ResourceLoader imported media, user stylesheets and site styles were loaded with the media="all" attribute. I'd say keep that the way it was. No complains about that in the past right ?

That way everthing stays compatible. And everybody can keep using special styles for print only or for screen only in their User:Me/skin.css

Also, things like MediaWiki:Print.css can then simply be wrapped in @media print (not in a seperate <link>), when it's defined as module. (as can extensions when defining the style modules)
Comment 5 Roan Kattouw 2011-01-07 20:28:40 UTC
(In reply to comment #4)
> Before ResourceLoader imported media, user stylesheets and site styles were
> loaded with the media="all" attribute. I'd say keep that the way it was. No
> complains about that in the past right ?
> 
> That way everthing stays compatible. And everybody can keep using special
> styles for print only or for screen only in their User:Me/skin.css
> 
I have suppressed the output of @media all { } blocks (they're useless anyway) in r79839.

> Also, things like MediaWiki:Print.css can then simply be wrapped in @media
> print (not in a seperate <link>), when it's defined as module. (as can
> extensions when defining the style modules)
This has been done some time ago, see ResourceLoaderSiteModule.php
Comment 6 Trevor Parscal 2011-01-07 20:44:23 UTC
This is the best solution I think - good work - as long as people don't register their styles as a specific media type (something they certainly would need to go out of their way to do) they can do all the strange trickery they want, including using the @media block themselves. We need to document the caveat of using the media type registration somewhere though.
Comment 7 Roan Kattouw 2011-01-07 20:45:51 UTC
(In reply to comment #6)
> This is the best solution I think - good work - as long as people don't
> register their styles as a specific media type (something they certainly would
> need to go out of their way to do) they can do all the strange trickery they
> want, including using the @media block themselves. We need to document the
> caveat of using the media type registration somewhere though.
Once you're doing media type registration, why would you want to use @import?
Comment 8 Trevor Parscal 2011-01-07 20:46:39 UTC
Beats me - that's why this seems to be the best way to go. It works as you would imagine by default.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links