Skip to content

Commit

Permalink
Fix normal & dark CSS always being included in addition to our custom…
Browse files Browse the repository at this point in the history
… link tag
  • Loading branch information
dsevillamartin committed Jul 13, 2022
1 parent 534e237 commit aa2b4d1
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/Content/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ public function __invoke(Document $document, Request $request)
$nightCss = $this->assets->makeDarkCss();
$dayCss = $this->assets->makeCss();

if ($this->config->inDebugMode()) {
$this->forceCommit([$dayCss, $nightCss]);
}

$preference = $this->getThemePreference($request);

$isAuto = $preference === 0;
Expand All @@ -66,11 +70,10 @@ public function __invoke(Document $document, Request $request)

protected function assembleCompilers(?string $locale): array
{
$compilers = parent::assembleCompilers($locale);

$compilers['css'][] = $this->assets->makeDarkCss();

return $compilers;
return [
'js' => [$this->assets->makeJs(), $this->assets->makeLocaleJs($locale)],
'css' => [$this->assets->makeLocaleCss($locale)]
];
}

/**
Expand Down

0 comments on commit aa2b4d1

Please sign in to comment.