Skip to content

Commit

Permalink
remove theme-dark class from body
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpapst committed May 16, 2023
1 parent 069a810 commit f438b55
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
8 changes: 1 addition & 7 deletions src/Twig/RuntimeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,7 @@ public function getRouteByAlias(string $routeName): string

public function bodyClass(string $class = ''): string
{
$classList = explode(' ', $class);

if ($this->helper->isDarkMode()) {
$classList[] = 'theme-dark';
}

return implode(' ', array_values($classList));
return $class;
}

public function theme(): string
Expand Down
2 changes: 1 addition & 1 deletion tests/Twig/RuntimeExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function testBodyClass()
$this->assertEquals('test', $sut->bodyClass('test'));

$sut = $this->getSut(['dark_mode' => true]);
$this->assertEquals('test theme-dark', $sut->bodyClass('test'));
$this->assertEquals('test', $sut->bodyClass('test'));
}

public function testTheme()
Expand Down

0 comments on commit f438b55

Please sign in to comment.