mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-11-09 14:03:33 +09:00
Css-data now responsible for generated data and parsers which requires heavy dependencies like csstree and openai. Here moved style schema into css-engine which makes is responsible for own input representation. So now schema and serialization are co-located in single package. Cli install size ```diff du -ck node_modules - 42680 + 35516 ```
58 lines
1.3 KiB
TypeScript
58 lines
1.3 KiB
TypeScript
import type { StyleValue } from "@webstudio-is/css-engine";
|
|
import { popularityIndex } from "./popularity-index";
|
|
|
|
// Data type used before we generate a the constants.
|
|
type RawPropertyData = {
|
|
unitGroups: string[];
|
|
inherited: boolean;
|
|
initial: StyleValue;
|
|
popularity: number;
|
|
appliesTo: string;
|
|
};
|
|
|
|
export const propertiesData: { [property: string]: RawPropertyData } = {};
|
|
export const keywordValues: { [property: string]: Array<string> } = {};
|
|
|
|
const getPopularityIndex = (property: string) =>
|
|
popularityIndex.find((data) => data.property === property)?.dayPercentage ??
|
|
0;
|
|
|
|
propertiesData.WebkitFontSmoothing = {
|
|
unitGroups: [],
|
|
inherited: true,
|
|
initial: {
|
|
type: "keyword",
|
|
value: "auto",
|
|
},
|
|
popularity: getPopularityIndex("webkit-font-smoothing"),
|
|
appliesTo: "allElements",
|
|
};
|
|
keywordValues.WebkitFontSmoothing = [
|
|
"auto",
|
|
"none",
|
|
"antialiased",
|
|
"subpixel-antialiased",
|
|
];
|
|
|
|
propertiesData.MozOsxFontSmoothing = {
|
|
unitGroups: [],
|
|
inherited: true,
|
|
initial: {
|
|
type: "keyword",
|
|
value: "auto",
|
|
},
|
|
popularity: getPopularityIndex("moz-osx-font-smoothing"),
|
|
appliesTo: "allElements",
|
|
};
|
|
keywordValues.MozOsxFontSmoothing = ["auto", "grayscale"];
|
|
|
|
keywordValues.listStyleType = [
|
|
"disc",
|
|
"circle",
|
|
"square",
|
|
"decimal",
|
|
"georgian",
|
|
"trad-chinese-informal",
|
|
"kannada",
|
|
];
|