diff --git a/app/lib/frontend/templates/views/pkg/versions/version_row.dart b/app/lib/frontend/templates/views/pkg/versions/version_row.dart
index bbde27638c..e7387f86ad 100644
--- a/app/lib/frontend/templates/views/pkg/versions/version_row.dart
+++ b/app/lib/frontend/templates/views/pkg/versions/version_row.dart
@@ -60,7 +60,7 @@ d.Node versionRowNode(
rel: 'nofollow',
title: 'Download $package ${version.version} archive',
child: d.img(
- classes: ['version-table-icon', 'filter-invert-on-dark'],
+ classes: ['pub-monochrome-icon', 'filter-invert-on-dark'],
image: d.Image(
src: staticUrls.downloadIcon,
alt: 'Download $package ${version.version} archive',
@@ -91,7 +91,7 @@ d.Node _documentationCell(
rel: 'nofollow',
title: 'Go to the documentation of $package ${version.version}',
child: d.img(
- classes: ['version-table-icon', 'filter-invert-on-dark'],
+ classes: ['pub-monochrome-icon', 'filter-invert-on-dark'],
image: d.Image(
src: staticUrls.documentationIcon,
alt: 'Go to the documentation of $package ${version.version}',
@@ -106,7 +106,7 @@ d.Node _documentationCell(
rel: 'nofollow',
title: 'Check the analysis logs for $package ${version.version}',
child: d.img(
- classes: ['version-table-icon', 'filter-invert-on-dark'],
+ classes: ['pub-monochrome-icon', 'filter-invert-on-dark'],
image: d.Image(
src: staticUrls.documentationFailedIcon,
alt: 'Check the analysis logs for $package ${version.version}',
diff --git a/app/test/frontend/golden/pkg_versions_page.html b/app/test/frontend/golden/pkg_versions_page.html
index 6a13304796..fd156baf35 100644
--- a/app/test/frontend/golden/pkg_versions_page.html
+++ b/app/test/frontend/golden/pkg_versions_page.html
@@ -249,12 +249,12 @@
Stable versions of oxygen
-
+
|
-
+
|
@@ -271,12 +271,12 @@ Stable versions of oxygen
-
+
|
-
+
|
@@ -316,12 +316,12 @@ Prerelease versions of oxygen
-
+
|
-
+
|
diff --git a/app/test/task/testdata/goldens/packages/oxygen/versions.html b/app/test/task/testdata/goldens/packages/oxygen/versions.html
index e3790873c6..42fb6fb2f1 100644
--- a/app/test/task/testdata/goldens/packages/oxygen/versions.html
+++ b/app/test/task/testdata/goldens/packages/oxygen/versions.html
@@ -235,12 +235,12 @@ Stable versions of oxygen
-
+
|
-
+
|
@@ -257,12 +257,12 @@ Stable versions of oxygen
-
+
|
-
+
|
diff --git a/pkg/web_css/lib/src/_base.scss b/pkg/web_css/lib/src/_base.scss
index 75ab1d4d08..a82805e7c7 100644
--- a/pkg/web_css/lib/src/_base.scss
+++ b/pkg/web_css/lib/src/_base.scss
@@ -89,6 +89,22 @@ button {
}
}
+// The class annotates an image icon with either black or white pixels on
+// a transparent base layer.
+// The default display with the muted opacity will move the icon's color
+// towards the gray spectrum, and on hovering it will show high contrast.
+//
+// Note: The `filter: brightness()` used below with the `a` element does
+// not work with monochrome images, as the linear transformation
+// will keep the pixels with rgb(0,0,0) the same.
+.pub-monochrome-icon {
+ opacity: 0.6;
+
+ a:hover & {
+ opacity: 1;
+ }
+}
+
a {
text-decoration: none;
color: var(--pub-link-text-color);
@@ -103,10 +119,8 @@ a {
}
.light-theme & {
- opacity: 1;
-
&:hover {
- opacity: 0.8;
+ filter: brightness(80%);
}
}
diff --git a/pkg/web_css/lib/src/_pkg.scss b/pkg/web_css/lib/src/_pkg.scss
index a92798a28f..131b1c29e1 100644
--- a/pkg/web_css/lib/src/_pkg.scss
+++ b/pkg/web_css/lib/src/_pkg.scss
@@ -115,10 +115,6 @@
font-size: 24px;
}
}
-
- .version-table-icon {
- opacity: 0.7;
- }
}
.changelog-entry {