Skip to content

Commit f62caa1

Browse files
committed
fix css issues with vector (and vector-2022) skin
1 parent ec10d13 commit f62caa1

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

modules/ext.bootstrapComponents.vector-fix.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,7 @@ body.skin-vector {
3030
font-size: inherit;
3131
font-family: sans-serif !important;
3232
}
33+
34+
body.skin-vector *, *::before, *::after {
35+
box-sizing: initial;
36+
}

src/Hooks/OutputPageParserOutput.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828

2929
use BootstrapComponents\ApplicationFactory;
3030
use BootstrapComponents\ParserOutputHelper;
31-
use Geocoder\Exception\LogicException;
3231
use MWException;
3332
use OutputPage;
3433
use ParserOutput;
@@ -95,6 +94,10 @@ public function process(): bool
9594
$this->getOutputPage()->addHTML( $deferredText );
9695
}
9796

97+
if ( $this->getParserOutputHelper()->vectorSkinInUse() ) {
98+
$this->getOutputPage()->addModules( [ 'ext.bootstrapComponents.vector-fix' ] );
99+
}
100+
98101
return true;
99102
}
100103

src/ParserOutputHelper.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
namespace BootstrapComponents;
2828

29-
use \ConfigException;
3029
use \Html;
3130
use \MediaWiki\MediaWikiServices;
3231
use \ParserOutput;
@@ -158,7 +157,7 @@ public function areImageModalsSuppressed() {
158157
*
159158
* @return string
160159
*/
161-
public function getContentForLaterInjection( \ParserOutput $parserOutput ) {
160+
public function getContentForLaterInjection( \ParserOutput $parserOutput ): string {
162161
$deferredContent = $parserOutput->getExtensionData( self::EXTENSION_DATA_DEFERRED_CONTENT_KEY );
163162

164163
if ( empty( $deferredContent ) || !is_array( $deferredContent ) ) {
@@ -210,14 +209,11 @@ public function loadBootstrapModules() {
210209
if ( is_a( $parserOutput, ParserOutput::class ) ) {
211210
// Q: when do we expect \Parser->getOutput() not to be a \ParserOutput? A: During tests.
212211
$parserOutput->setExtensionData( 'bsc_load_modules', true );
213-
if ( $this->vectorSkinInUse() ) {
214-
$parserOutput->addModules( [ 'ext.bootstrapComponents.vector-fix' ] );
215-
}
216212
}
217213
}
218214

219215
/**
220-
* Formats a text as error text so it can be added to the output.
216+
* Formats a text as error text, so it can be added to the output.
221217
*
222218
* @param string $errorMessageName
223219
*
@@ -241,7 +237,7 @@ public function renderErrorMessage( $errorMessageName ) {
241237
* @return bool
242238
*/
243239
public function vectorSkinInUse() {
244-
return strtolower( $this->getNameOfActiveSkin() ) == 'vector';
240+
return in_array( strtolower( $this->getNameOfActiveSkin() ), [ 'vector', 'vector-2022' ] ) ;
245241
}
246242

247243
/**

0 commit comments

Comments
 (0)