Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const OffsetInput = ({
intermediateValue={intermediateValue}
styleSource="default"
/* same as offset has 0 - 100% */
property={"font-stretch"}
property={"opacity"}
value={
value !== undefined
? { type: "unit", value: roundOffset(value), unit: "%" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe("Parse intermediate or invalid value without math evaluation", () => {
});

test("fallback to % if px is not supported", () => {
const result = parseIntermediateOrInvalidValue("font-stretch", {
const result = parseIntermediateOrInvalidValue("opacity", {
type: "intermediate",
value: "10",
});
Expand Down
34 changes: 11 additions & 23 deletions packages/css-data/bin/mdn-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,25 +235,18 @@ const writeToFile = (fileName: string, constant: string, data: unknown) => {
};

const supportedExperimentalProperties = [
"appearance",
"aspect-ratio",
"field-sizing",
"text-size-adjust",
"-webkit-line-clamp",
"background-position-x",
"background-position-y",
"-webkit-tap-highlight-color",
"-webkit-overflow-scrolling",
"transition-behavior",
"offset-position",
// https://github.com/mdn/data/pull/759
// offset-anchor is standard according to mdn.
// But the mdn_url is missing from its config which is skipping othe starndard check.
"offset-anchor",
];

// Properties we don't support in this form.
const unsupportedProperties = [
"--*",
"-webkit-text-fill-color",
"-webkit-text-stroke-color",
"-webkit-text-stroke-width",
// shorthand properties
"all",
"font-synthesis",
Expand All @@ -262,6 +255,12 @@ const unsupportedProperties = [
"white-space",
"text-wrap",
"background-position",
"border-block-style",
"border-block-width",
"border-block-color",
"border-inline-style",
"border-inline-width",
"border-inline-color",
];

type FilteredProperties = { [property: string]: Value };
Expand Down Expand Up @@ -334,7 +333,7 @@ const getPropertiesData = (
const unitGroups = new Set<string>();
walkSyntax(config.syntax, (node) => {
if (node.type === "Type") {
if (node.name === "integer" || node.name === "number") {
if (node.name === "number-token" || node.name === "number") {
unitGroups.add("number");
return;
}
Expand Down Expand Up @@ -374,10 +373,6 @@ const pseudoElements = Object.keys(selectors)

const getKeywordValues = (filteredProperties: FilteredProperties) => {
const result = { ...customData.keywordValues };
// Non-standard properties are just missing in mdn data
const nonStandardValues = {
"background-clip": ["text"],
};
// https://www.w3.org/TR/css-values/#common-keywords
const commonKeywords = ["initial", "inherit", "unset"];

Expand All @@ -393,13 +388,6 @@ const getKeywordValues = (filteredProperties: FilteredProperties) => {
}
});

if (property in nonStandardValues) {
for (const nonStandartKeyword of nonStandardValues[
property as keyof typeof nonStandardValues
]) {
keywords.add(nonStandartKeyword);
}
}
for (const commonKeyword of commonKeywords) {
// Delete to add commonKeyword at the end of the set
keywords.delete(commonKeyword);
Expand Down
2 changes: 1 addition & 1 deletion packages/css-data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@types/css-tree": "^2.3.1",
"@webstudio-is/tsconfig": "workspace:*",
"html-tags": "^4.0.0",
"mdn-data": "2.8.0",
"mdn-data": "2.23.0",
"vitest": "^3.1.2",
"zod": "^3.24.2"
},
Expand Down
42 changes: 28 additions & 14 deletions packages/css-data/src/__generated__/animatable-properties.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading