Skip to content

Commit

Permalink
Boostrap 5 upgrade: restored default colors due to Firefox not suppor…
Browse files Browse the repository at this point in the history
…ting relative CSS colors.
  • Loading branch information
gammamatrix committed May 12, 2024
1 parent 846cb21 commit 3ab35d1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
8 changes: 1 addition & 7 deletions src/Report/Html/Colors.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,7 @@ final class Colors

public static function default(): self
{
return new self(
'rgb(from var(--bs-success) r g b / 0.1)',
'rgb(from var(--bs-success) r g b / 0.33)',
'rgb(from var(--bs-success) r g b / 0.67)',
'rgb(from var(--bs-warning) r g b / 0.1)',
'rgb(from var(--bs-danger) r g b / 0.1)',
);
return new self('#dff0d8', '#c3e3b5', '#99cb84', '#fcf8e3', '#f2dede');
}

public static function from(string $successLow, string $successMedium, string $successHigh, string $warning, string $danger): self
Expand Down
10 changes: 5 additions & 5 deletions tests/tests/Report/Html/ColorsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ public function testCanBeCreatedFromDefaults(): void
{
$colors = Colors::default();

$this->assertSame('rgb(from var(--bs-success) r g b / 0.1)', $colors->successLow());
$this->assertSame('rgb(from var(--bs-success) r g b / 0.33)', $colors->successMedium());
$this->assertSame('rgb(from var(--bs-success) r g b / 0.67)', $colors->successHigh());
$this->assertSame('rgb(from var(--bs-warning) r g b / 0.1)', $colors->warning());
$this->assertSame('rgb(from var(--bs-danger) r g b / 0.1)', $colors->danger());
$this->assertSame('#dff0d8', $colors->successLow());
$this->assertSame('#c3e3b5', $colors->successMedium());
$this->assertSame('#99cb84', $colors->successHigh());
$this->assertSame('#fcf8e3', $colors->warning());
$this->assertSame('#f2dede', $colors->danger());
}

public function testCanBeCreatedFromCustomValues(): void
Expand Down

0 comments on commit 3ab35d1

Please sign in to comment.