Skip to content

Commit

Permalink
add background directly
Browse files Browse the repository at this point in the history
  • Loading branch information
WaitSpringQW committed Aug 12, 2024
1 parent 788f8fa commit a480c21
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
2 changes: 1 addition & 1 deletion includes/Hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Hooks implements
*/
public function onBeforePageDisplay($out, $skin): void
{
$out->addModules(['ext.DarkMode', 'ext.DarkMode.EmojiWrap', 'ext.DarkMode.AddBackground']);
$out->addModules(['ext.DarkMode', 'ext.DarkMode.EmojiWrap', /* 'ext.DarkMode.AddBackground' */]);
$out->addModuleStyles('ext.DarkMode.css');

if ($this->isDarkModeActive($skin)) {
Expand Down
31 changes: 29 additions & 2 deletions resources/ext.DarkMode.less
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,39 @@
background-color: #f7f7f7 !important;
}

[typeof~="mw:File"],
[typeof~="mw:File/Thumb"],
[typeof~="mw:File/Frame"],
[typeof~="mw:File/Frameless"],
.mw-halign-left,
.mw-halign-right,
.mw-halign-center {
img {
width: auto;
background: rgba(0, 0, 0, 0.1);
}
}

.darkmode-image-background {
background: rgba(0, 0, 0, 0.1);
}

.mw-no-invert .darkmode-image-background {
background: rgba(0, 0, 0, 0.1);
.mw-no-invert {
[typeof~="mw:File"],
[typeof~="mw:File/Thumb"],
[typeof~="mw:File/Frame"],
[typeof~="mw:File/Frameless"],
.mw-halign-left,
.mw-halign-right,
.mw-halign-center {
img {
background: transparent;
}
}

.darkmode-image-background {
background: transparent;
}
}

.diff-addedline .diffchange {
Expand Down

0 comments on commit a480c21

Please sign in to comment.