Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions components/baseline-indicator/icons/status/pending-removal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions components/baseline-indicator/server.css
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@

@mixin light-dark --baseline-img, url("./icons/status/obsolete.svg"),
url("./icons/status/obsolete-dark.svg");

&.to-be-removed {
--baseline-bg: #fceeee;
--baseline-engine-bg: #f3dddd;
--baseline-pill-bg: #b3261e;
--baseline-pill-color: #f1f3f4;

@mixin light-dark --baseline-img,
url("./icons/status/pending-removal.svg"),
url("./icons/status/pending-removal-dark.svg");
}
}

&[open] {
Expand Down
19 changes: 14 additions & 5 deletions components/baseline-indicator/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
const level = status.feature.discouraged
? "discouraged"
: status.baseline || "not";
const removalDate = status.feature.discouraged?.removal_date;

Check failure on line 77 in components/baseline-indicator/server.js

View workflow job for this annotation

GitHub Actions / lint

Property 'removal_date' does not exist on type 'Discouraged'.

const feedbackLink = `${SURVEY_URL}?page=${encodeURIComponent(context.url)}&level=${level}`;

Expand Down Expand Up @@ -126,7 +127,7 @@
};

return html`<details
class="baseline-indicator ${level}"
class="baseline-indicator ${level} ${removalDate ? "to-be-removed" : ""}"
data-glean-toggle-open="baseline_toggle_open"
?open=${level === "discouraged"}
>
Expand Down Expand Up @@ -159,7 +160,9 @@
</div>
${level === "low"
? html`<div class="pill">${context.l10n`Newly available`}</div>`
: nothing}
: level === "discouraged" && removalDate
? html`<div class="pill">${context.l10n`To be removed`}</div>`
: nothing}
<div class="browsers">
${ENGINES.map(
({ name, browsers }) =>
Expand Down Expand Up @@ -211,9 +214,15 @@
? html`<p>* ${context.l10n("baseline-asterisk")}</p>`
: nothing}`
: level === "discouraged"
? html`<p>
${context.l10n`Avoid using this feature in new projects. This feature may be a candidate for removal from web standards or browsers.`}
</p>`
? removalDate
? html`<p>
${context.l10n`This feature is pending removal from browsers. Using it now may lead to broken functionality in future updates.`}
</p>`
: html`<p>
${context.l10n`Avoid using this feature in new projects.`}
${status.feature.discouraged?.reason || nothing}

Check failure on line 223 in components/baseline-indicator/server.js

View workflow job for this annotation

GitHub Actions / lint

Property 'reason' does not exist on type 'Discouraged'.
${context.l10n`This feature may be a candidate for removal from web standards or browsers.`}
</p>`
: html`<p>${context.l10n("baseline-not-extra")}</p>`}
<ul>
<li>
Expand Down
Loading