Skip to content

Commit

Permalink
feat(baseline): asterisk support for baseline (#12415)
Browse files Browse the repository at this point in the history
* feat(baseline): asterisk support for baseline
  • Loading branch information
fiji-flo authored Jan 9, 2025
1 parent 0b5276b commit fc39ed6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion client/src/document/baseline-indicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import "./baseline-indicator.scss";

// web-features doesn't export these types directly so we need to do a little typescript magic:
import type { features } from "web-features";
type SupportStatus = (typeof features)[keyof typeof features]["status"];
type SupportStatus = (typeof features)[keyof typeof features]["status"] & {
asterisk?: boolean;
};
type BrowserIdentifier =
keyof (typeof features)[keyof typeof features]["status"]["support"];

Expand Down Expand Up @@ -123,6 +125,7 @@ export function BaselineIndicator({ status }: { status: SupportStatus }) {
? "Widely available"
: low_date?.getFullYear()}
</span>
{status.asterisk && " *"}
</>
) : (
<span className="not-bold">Limited availability</span>
Expand Down Expand Up @@ -176,6 +179,11 @@ export function BaselineIndicator({ status }: { status: SupportStatus }) {
most widely-used browsers.
</p>
)}
{status.asterisk && (
<p>
* Some parts of this feature may have varying levels of support.
</p>
)}
<ul>
<li>
{/* eslint-disable-next-line react/jsx-no-target-blank */}
Expand Down

0 comments on commit fc39ed6

Please sign in to comment.