Is there any way to use addModuleStyles() so that it outputs browser-conditional stylesheets? Such that such a one could apply only to IE8-? That's really what I need here.
On 15/11/15 00:17, Krinkle wrote:
Just wanna make a small correction here to avoid confusion.
The top and bottom queue are both JavaScript-enabled, using 'position' => 'top' only controls where the load() command is placed (at the top or bottom, naturally). Neither of these will run in IE 8 after January.
What Florian is referring to does exist. That is the "styles-only" queue It is triggered by using addModuleStyles(). This method will ensure the module is included in a regular <link> stylesheet. These modules don't have a position, as stylesheets are always in the top.
One could consider these stylesheets as part of the top queue (based on where they are in the HTML), but we don't do that in our documentation to avoid confusion as instructions you may find about using the "top queue" will refer to the 'position' attribute as used by addModules() – which is not what you want in this case.
These styles-only modules are still processed by ResourceLoader (e.g. LESS can be used, minified, and cached as usual). We've always used this skin styling and other styles associated with server-side generated page output (e.g. thumbnail styles, table of contents, skins etc.).
Primarily because it performs better (browsers discover these urls and start fetching when statically looking ahead in the html parse stream). And because it's a more stable and a semantically correct way to associate styles. For instance, JavaScript runtime could intermittently fail for any number of reasons even in modern browsers, as well as on mobile browsers. In such scenarios the stylesheet more important, and users effectively get the fallback experience (as opposed to a page with no styling, which would happen if we don't do that).
-- Krinkle
On Fri, Nov 13, 2015 at 10:02 AM, Florian Schmidt < florian.schmidt.welzow@t-online.de> wrote:
I'm not totally sure, but if you put your styles into a top queue module, the module would be delivered through RL (with all it's features, including LESS compilation) and the browser requests it without JavaScript (it should be added into one of the RL link tags in head). The change to disable JS on IE8 should affect bottom queued modules, only (the requests for these modules are initialized by JS).
-----Original-Nachricht----- Von: "Isarra Yos" <zhorishna@gmail.com lt%3Bzhorishna@gmail.com>
Using js got around this whole problem as with that you can simply check the browser there and then conditionally mw.loader.load a size-free module for IE8.
Is there any other way around this?
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l