Files
Oleg Isonen 04188dbbf4 feat: CSS Grid UI (#5614)
## Description

1. What is this PR about (link the issue and add a short description)

## Steps for reproduction

1. click button
2. expect xyz

## Code Review

- [ ] hi @kof, I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview

## Before requesting a review

- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
0000)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2026-03-08 10:52:21 +01:00

141 lines
3.1 KiB
TypeScript

import type { StyleValue } from "@webstudio-is/css-engine";
// Data type used before we generate a the constants.
type RawPropertyData = {
unitGroups: Array<string>;
inherited: boolean;
initial: StyleValue;
mdnUrl?: string;
};
export const propertiesData: { [property: string]: RawPropertyData } = {};
export const keywordValues: { [property: string]: Array<string> } = {};
propertiesData["-webkit-font-smoothing"] = {
unitGroups: [],
inherited: true,
initial: {
type: "keyword",
value: "auto",
},
mdnUrl: "https://developer.mozilla.org/en-US/docs/Web/CSS/font-smooth",
};
keywordValues["-webkit-font-smoothing"] = [
"auto",
"none",
"antialiased",
"subpixel-antialiased",
];
propertiesData["-moz-osx-font-smoothing"] = {
unitGroups: [],
inherited: true,
initial: {
type: "keyword",
value: "auto",
},
mdnUrl: "https://developer.mozilla.org/en-US/docs/Web/CSS/font-smooth",
};
keywordValues["-moz-osx-font-smoothing"] = ["auto", "grayscale"];
propertiesData["-webkit-box-orient"] = {
unitGroups: [],
inherited: false,
initial: { type: "keyword", value: "horizontal" },
mdnUrl: "https://developer.mozilla.org/en-US/docs/Web/CSS/box-orient",
};
keywordValues["-webkit-box-orient"] = ["horizontal", "vertical"];
propertiesData["view-timeline-name"] = {
unitGroups: [],
inherited: false,
initial: {
type: "keyword",
value: "none",
},
mdnUrl: "https://developer.mozilla.org/en-US/docs/Web/CSS/view-timeline-name",
};
keywordValues["view-timeline-name"] = [];
propertiesData["scroll-timeline-name"] = {
unitGroups: [],
inherited: false,
initial: {
type: "keyword",
value: "none",
},
mdnUrl:
"https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-timeline-name",
};
keywordValues["scroll-timeline-name"] = [];
propertiesData["view-timeline-inset"] = {
unitGroups: ["length", "percentage"],
inherited: false,
initial: {
type: "keyword",
value: "auto",
},
mdnUrl:
"https://developer.mozilla.org/en-US/docs/Web/CSS/view-timeline-inset",
};
keywordValues["view-timeline-inset"] = [];
// Add combined values for grid-auto-flow that mdn-data doesn't include
keywordValues["grid-auto-flow"] = [
"row",
"column",
"dense",
"row dense",
"column dense",
"initial",
"inherit",
"unset",
];
keywordValues["list-style-type"] = [
"disc",
"circle",
"square",
"decimal",
"georgian",
"trad-chinese-informal",
"kannada",
"none",
"initial",
"inherit",
"unset",
];
export const customLonghandPropertyNames = [
"boxShadowOffsetX",
"boxShadowOffsetY",
"boxShadowBlurRadius",
"boxShadowSpreadRadius",
"boxShadowColor",
"boxShadowPosition",
"textShadowOffsetX",
"textShadowOffsetY",
"textShadowBlurRadius",
"textShadowColor",
"dropShadowOffsetX",
"dropShadowOffsetY",
"dropShadowBlurRadius",
"dropShadowColor",
"translateX",
"translateY",
"translateZ",
"rotateX",
"rotateY",
"rotateZ",
"scaleX",
"scaleY",
"scaleZ",
"skewX",
"skewY",
"transformOriginX",
"transformOriginY",
"transformOriginZ",
"perspectiveOriginX",
"perspectiveOriginY",
] as const;