From 8ddbd36d251ce0da5cceadd3c5a19f42147dfe0d Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Sat, 24 Aug 2019 21:58:16 +0100 Subject: [PATCH] Merge 'skins.timeless.misc' back into 'skins.timeless' Follows-up f450f7e13 and 1bb12ffaae85a1 which introduce and explaine that module's need based on what I believe was a misunderstanding. Specifying an options object (e.g. with a "media" key) is optional for a stylesheet, and a module can have any number of CSS or LESS files that are packaged together. The syntax for this was designed for PHP and unfortunately does not translate elegantly to JSON, but it does work. In PHP, examples of this can be found that look as follows: 'styles' => [ 'foo.css', 'bar.css' => [ 'media' => 'print' ], 'quux.css', ], Other examples of this in JSON can be found in Nostalgia.git and ArticlePlaceholder.git. Change-Id: Ie2a39a79c0892a1c5699a05071216eb5fe660bc1 --- includes/SkinTimeless.php | 4 ---- includes/TimelessVariablesModule.php | 2 +- skin.json | 8 +------- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/includes/SkinTimeless.php b/includes/SkinTimeless.php index b78b28e..95e14a8 100644 --- a/includes/SkinTimeless.php +++ b/includes/SkinTimeless.php @@ -28,10 +28,6 @@ class SkinTimeless extends SkinTemplate { $out->addModuleStyles( [ 'mediawiki.skinning.content.externallinks', 'skins.timeless', - // This is a separate module from skins.timeless because it has its own - // @media declarations in its less, and apparently modules cannot be defined - // with both. That is the only reason. - 'skins.timeless.misc' ] ); $out->addModules( [ 'skins.timeless.js', diff --git a/includes/TimelessVariablesModule.php b/includes/TimelessVariablesModule.php index e516e20..9a172fc 100644 --- a/includes/TimelessVariablesModule.php +++ b/includes/TimelessVariablesModule.php @@ -2,7 +2,7 @@ /** * ResourceLoader module to set some LESS variables for the skin */ -class TimelessVariablesModule extends ResourceLoaderFileModule { +class TimelessVariablesModule extends ResourceLoaderSkinModule { /** * Add our LESS variables * diff --git a/skin.json b/skin.json index a8e2454..774471f 100644 --- a/skin.json +++ b/skin.json @@ -50,19 +50,13 @@ "resources/screen-mobile.less": { "media": "screen and (max-width: 850px)" }, + "0": "resources/screen-misc.less", "resources/print.css": { "media": "print" } }, "@NOTE": "Remember to also update variables.less if you change the width cutoffs here. screen-misc.less and mobile.js may also need updating." }, - "skins.timeless.misc": { - "targets": [ "desktop", "mobile" ], - "class": "ResourceLoaderSkinModule", - "styles": [ - "resources/screen-misc.less" - ] - }, "skins.timeless.js": { "targets": [ "desktop" ], "scripts": [