Skip to content

Add Baseline status to hovercards #428

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

Merged
merged 18 commits into from
Apr 3, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
re-add browsers, adjust baseline schema
  • Loading branch information
rviscomi committed Mar 20, 2025
commit b505746e998d0c317c89f7d919f073deb7bb2efd
57 changes: 57 additions & 0 deletions docs/customData.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,63 @@
"patternErrorMessage": "Browser item must follow the format of `${browser}${version}`. `browser` is one of:\n- E: Edge\n- FF: Firefox\n- S: Safari\n- C: Chrome\n- IE: Internet Explorer\n- O: Opera"
}
},
"baseline": {
"type": "object",
"description": "Baseline information for the feature",
"properties": {
"status": {
"type": "string",
"description": "Baseline status",
"enum": ["high", "low", "false"]
},
"support": {
"type": "object",
"description": "Supported browsers",
"properties": {
"chrome": {
"type": "string",
"description": "Chrome version"
},
"chrome_android": {
"type": "string",
"description": "Chrome Android version"
},
"edge": {
"type": "string",
"description": "Edge version"
},
"safari": {
"type": "string",
"description": "Safari version"
},
"safari_ios": {
"type": "string",
"description": "Safari iOS version"
},
"firefox": {
"type": "string",
"description": "Firefox version"
},
"firefox_android": {
"type": "string",
"description": "Firefox Android version"
}
}
},
"baseline_low_date": {
"type": "string",
"description": "Date when the feature became newly supported in all major browsers",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$",
"patternErrorMessage": "Date must be in the format of `YYYY-MM-DD`"
},
"baseline_high_date": {
"type": "string",
"description": "Date when the feature became widely supported in all major browsers",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$",
"patternErrorMessage": "Date must be in the format of `YYYY-MM-DD`"
}
}
},
"references": {
"type": "array",
"description": "A list of references for the property shown in completion and hover",
Expand Down
19 changes: 12 additions & 7 deletions src/cssLanguageTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ export interface IReference {
export interface IPropertyData {
name: string;
description?: string | MarkupContent;
baselineStatus?: BaselineStatus;
browsers?: string[];
baseline?: BaselineStatus;
restrictions?: string[];
status?: EntryStatus;
syntax?: string;
Expand All @@ -200,29 +201,33 @@ export interface IPropertyData {
export interface IAtDirectiveData {
name: string;
description?: string | MarkupContent;
baselineStatus?: BaselineStatus;
browsers?: string[];
baseline?: BaselineStatus;
status?: EntryStatus;
references?: IReference[];
}
export interface IPseudoClassData {
name: string;
description?: string | MarkupContent;
baselineStatus?: BaselineStatus;
browsers?: string[];
baseline?: BaselineStatus;
status?: EntryStatus;
references?: IReference[];
}
export interface IPseudoElementData {
name: string;
description?: string | MarkupContent;
baselineStatus?: BaselineStatus;
browsers?: string[];
baseline?: BaselineStatus;
status?: EntryStatus;
references?: IReference[];
}

export interface IValueData {
name: string;
description?: string | MarkupContent;
baselineStatus?: BaselineStatus;
browsers?: string[];
baseline?: BaselineStatus;
status?: EntryStatus;
references?: IReference[];
}
Expand All @@ -243,13 +248,13 @@ export interface ICSSDataProvider {
}

export interface BaselineStatus {
baseline: Baseline;
status: Baseline;
support?: BaselineSupport;
baseline_low_date?: string;
baseline_high_date?: string;
}

export type Baseline = false | 'low' | 'high';
export type Baseline = 'false' | 'low' | 'high';

export interface BaselineSupport {
'chrome'?: string;
Expand Down
Loading