Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(baseline): asterisk support for baseline #12415

Merged
merged 3 commits into from
Jan 9, 2025
Merged
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
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
Loading