Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

refactor: optimize html styles access (#3939)

Bogdan Chadkinc7e88531d7be
diff --git a/apps/builder/app/builder/features/style-panel/shared/style-info.ts b/apps/builder/app/builder/features/style-panel/shared/style-info.ts
index a3aa8aa876..5b47cf9f90 100644
--- a/apps/builder/app/builder/features/style-panel/shared/style-info.ts
+++ b/apps/builder/app/builder/features/style-panel/shared/style-info.ts
@@ -688,26 +688,6 @@ const useStyleInfoByInstanceAndStyleSource = (
styleSourceSelector,
]);
- const htmlStyle = useMemo(() => {
- const instanceId = instanceSelector?.[0];
- if (instanceId === undefined) {
- return;
- }
- const tagName = instanceToTag?.get(instanceId);
- if (tagName === undefined) {
- return;
- }
- const styles = html[tagName];
- if (styles === undefined) {
- return;
- }
- const style: Style = {};
- for (const styleDecl of styles) {
- style[styleDecl.property] = styleDecl.value;
- }
- return style;
- }, [instanceSelector, instanceToTag]);
-
const allPropertyNames = useMemo(() => {
const [selectedInstanceId] = instanceSelector ?? [];
const all: Set<StyleProperty> = new Set(propertyNames);
@@ -724,13 +704,16 @@ const useStyleInfoByInstanceAndStyleSource = (
const styleInfoData = useMemo(() => {
const styleInfoData: StyleInfo = {};
+ const instanceId = instanceSelector?.[0];
+ const tagName = instanceToTag?.get(instanceId ?? "");
for (const property of allPropertyNames) {
- // temporary solution until we start computing all styles from data
- const htmlValue = htmlStyle?.[property];
const defaultValue = CUSTOM_DEFAULT_VALUES[property] ??
properties[property as keyof typeof properties]?.initial ?? {
type: "guaranteedInvalid",
};
+ const htmlValue = tagName
+ ? html.get(`${tagName}:${property as string}`)
+ : undefined;
const preset = presetStyle?.[property];
const inherited = inheritedInfo[property];
const cascaded = cascadedInfo[property];
@@ -797,7 +780,8 @@ const useStyleInfoByInstanceAndStyleSource = (
}
return styleInfoData;
}, [
- htmlStyle,
+ instanceSelector,
+ instanceToTag,
presetStyle,
inheritedInfo,
cascadedInfo,
diff --git a/apps/builder/app/shared/style-object-model.ts b/apps/builder/app/shared/style-object-model.ts
index 50db1950e1..4bac028782 100644
--- a/apps/builder/app/shared/style-object-model.ts
+++ b/apps/builder/app/shared/style-object-model.ts
@@ -164,14 +164,12 @@ const getCascadedValue = ({
const declaredValues: DeclaredValue[] = [];
// browser styles
- const htmlStyles = tag ? html[tag] : undefined;
- if (htmlStyles) {
- for (const styleDecl of htmlStyles) {
- if (styleDecl.property !== property) {
- continue;
- }
+ if (tag) {
+ const key = `${tag}:${property}` as const;
+ const browserValue = html.get(key);
+ if (browserValue) {
const specificity: Specificity = [browserLayer, 0, 0, 0];
- declaredValues.push({ specificity, value: styleDecl.value });
+ declaredValues.push({ specificity, value: browserValue });
}
}
diff --git a/packages/css-data/bin/html.css.ts b/packages/css-data/bin/html.css.ts
index 78116800a9..c7e0bd11fa 100644
--- a/packages/css-data/bin/html.css.ts
+++ b/packages/css-data/bin/html.css.ts
@@ -4,20 +4,15 @@ import { parseCss } from "../src/parse-css";
const css = readFileSync("./src/html.css", "utf8");
const parsed = parseCss(css);
-const result: Record<
- string,
- Array<{ property: string; value: StyleValue }>
-> = {};
+const result: [string, StyleValue][] = [];
for (const styleDecl of parsed) {
- result[styleDecl.selector] ??= [];
- result[styleDecl.selector].push({
- property: styleDecl.property,
- value: styleDecl.value,
- });
+ result.push([`${styleDecl.selector}:${styleDecl.property}`, styleDecl.value]);
}
+let code = "";
+code += `import type { htmlTags as HtmlTags } from "html-tags";\n`;
+code += `import type { StyleValue } from "@webstudio-is/css-engine";\n\n`;
+const map = "new Map<`${HtmlTags}:${string}`, StyleValue>";
+code += `export const html = ${map}(${JSON.stringify(result)})`;
mkdirSync("./src/__generated__", { recursive: true });
-writeFileSync(
- "./src/__generated__/html.ts",
- `export const html = ${JSON.stringify(result)}`
-);
+writeFileSync("./src/__generated__/html.ts", code);
diff --git a/packages/css-data/src/__generated__/html.ts b/packages/css-data/src/__generated__/html.ts
index 2518099a11..82d70c4ea3 100644
--- a/packages/css-data/src/__generated__/html.ts
+++ b/packages/css-data/src/__generated__/html.ts
@@ -1,680 +1,319 @@
-export const html = {
- article: [
- { property: "display", value: { type: "keyword", value: "block" } },
- ],
- aside: [{ property: "display", value: { type: "keyword", value: "block" } }],
- details: [
- { property: "display", value: { type: "keyword", value: "block" } },
- ],
- div: [{ property: "display", value: { type: "keyword", value: "block" } }],
- dt: [{ property: "display", value: { type: "keyword", value: "block" } }],
- figcaption: [
- { property: "display", value: { type: "keyword", value: "block" } },
- ],
- footer: [{ property: "display", value: { type: "keyword", value: "block" } }],
- form: [{ property: "display", value: { type: "keyword", value: "block" } }],
- header: [{ property: "display", value: { type: "keyword", value: "block" } }],
- hgroup: [{ property: "display", value: { type: "keyword", value: "block" } }],
- html: [{ property: "display", value: { type: "keyword", value: "block" } }],
- main: [{ property: "display", value: { type: "keyword", value: "block" } }],
- nav: [{ property: "display", value: { type: "keyword", value: "block" } }],
- section: [
- { property: "display", value: { type: "keyword", value: "block" } },
- ],
- summary: [
- { property: "display", value: { type: "keyword", value: "block" } },
- ],
- body: [
- { property: "display", value: { type: "keyword", value: "block" } },
- { property: "marginTop", value: { type: "unit", unit: "px", value: 8 } },
- { property: "marginRight", value: { type: "unit", unit: "px", value: 8 } },
- { property: "marginBottom", value: { type: "unit", unit: "px", value: 8 } },
- { property: "marginLeft", value: { type: "unit", unit: "px", value: 8 } },
- ],
- p: [
- { property: "display", value: { type: "keyword", value: "block" } },
- { property: "marginTop", value: { type: "unit", unit: "em", value: 1 } },
- { property: "marginBottom", value: { type: "unit", unit: "em", value: 1 } },
- ],
- dl: [
- { property: "display", value: { type: "keyword", value: "block" } },
- { property: "marginTop", value: { type: "unit", unit: "em", value: 1 } },
- { property: "marginBottom", value: { type: "unit", unit: "em", value: 1 } },
- ],
- dd: [
- { property: "display", value: { type: "keyword", value: "block" } },
- { property: "marginLeft", value: { type: "unit", unit: "px", value: 40 } },
- ],
- blockquote: [
- { property: "display", value: { type: "keyword", value: "block" } },
- { property: "marginTop", value: { type: "unit", unit: "em", value: 1 } },
- { property: "marginRight", value: { type: "unit", unit: "px", value: 40 } },
- { property: "marginBottom", value: { type: "unit", unit: "em", value: 1 } },
- { property: "marginLeft", value: { type: "unit", unit: "px", value: 40 } },
- ],
- figure: [
- { property: "display", value: { type: "keyword", value: "block" } },
- { property: "marginTop", value: { type: "unit", unit: "em", value: 1 } },
- { property: "marginRight", value: { type: "unit", unit: "px", value: 40 } },
- { property: "marginBottom", value: { type: "unit", unit: "em", value: 1 } },
- { property: "marginLeft", value: { type: "unit", unit: "px", value: 40 } },
- ],
- address: [
- { property: "display", value: { type: "keyword", value: "block" } },
- { property: "fontStyle", value: { type: "keyword", value: "italic" } },
- ],
- h1: [
- { property: "display", value: { type: "keyword", value: "block" } },
- { property: "fontWeight", value: { type: "keyword", value: "bold" } },
- { property: "fontSize", value: { type: "unit", unit: "em", value: 2 } },
- { property: "marginTop", value: { type: "unit", unit: "em", value: 0.67 } },
- {
- property: "marginBottom",
- value: { type: "unit", unit: "em", value: 0.67 },
- },
- ],
- h2: [
- { property: "display", value: { type: "keyword", value: "block" } },
- { property: "fontWeight", value: { type: "keyword", value: "bold" } },
- { property: "fontSize", value: { type: "unit", unit: "em", value: 1.5 } },
- { property: "marginTop", value: { type: "unit", unit: "em", value: 0.83 } },
- {
- property: "marginBottom",
- value: { type: "unit", unit: "em", value: 0.83 },
- },
- ],
- h3: [
- { property: "display", value: { type: "keyword", value: "block" } },
- { property: "fontWeight", value: { type: "keyword", value: "bold" } },
- { property: "fontSize", value: { type: "unit", unit: "em", value: 1.17 } },
- { property: "marginTop", value: { type: "unit", unit: "em", value: 1 } },
- { property: "marginBottom", value: { type: "unit", unit: "em", value: 1 } },
- ],
- h4: [
- { property: "display", value: { type: "keyword", value: "block" } },
- { property: "fontWeight", value: { type: "keyword", value: "bold" } },
- { property: "marginTop", value: { type: "unit", unit: "em", value: 1.33 } },
- {
- property: "marginBottom",
- value: { type: "unit", unit: "em", value: 1.33 },
- },
- ],
- h5: [
- { property: "display", value: { type: "keyword", value: "block" } },
- { property: "fontWeight", value: { type: "keyword", value: "bold" } },
- { property: "fontSize", value: { type: "unit", unit: "em", value: 0.83 } },
- { property: "marginTop", value: { type: "unit", unit: "em", value: 1.67 } },
- {
- property: "marginBottom",
- value: { type: "unit", unit: "em", value: 1.67 },
- },
- ],
- h6: [
- { property: "display", value: { type: "keyword", value: "block" } },
- { property: "fontWeight", value: { type: "keyword", value: "bold" } },
- { property: "fontSize", value: { type: "unit", unit: "em", value: 0.67 } },
- { property: "marginTop", value: { type: "unit", unit: "em", value: 2.33 } },
- {
- property: "marginBottom",
- value: { type: "unit", unit: "em", value: 2.33 },
- },
- ],
- pre: [
- { property: "display", value: { type: "keyword", value: "block" } },
- {
- property: "whiteSpaceCollapse",
- value: { type: "keyword", value: "preserve" },
- },
- { property: "textWrapMode", value: { type: "keyword", value: "nowrap" } },
- { property: "marginTop", value: { type: "unit", unit: "em", value: 1 } },
- { property: "marginBottom", value: { type: "unit", unit: "em", value: 1 } },
- ],
- table: [
- { property: "display", value: { type: "keyword", value: "table" } },
- {
- property: "borderSpacing",
- value: { type: "unit", unit: "px", value: 2 },
- },
- {
- property: "borderCollapse",
- value: { type: "keyword", value: "separate" },
- },
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
- {
- property: "textIndent",
- value: { type: "unit", unit: "number", value: 0 },
- },
- ],
- caption: [
- { property: "display", value: { type: "keyword", value: "table-caption" } },
- { property: "textAlign", value: { type: "keyword", value: "center" } },
- ],
- tr: [
- { property: "display", value: { type: "keyword", value: "table-row" } },
- { property: "verticalAlign", value: { type: "keyword", value: "inherit" } },
- ],
- col: [
- { property: "display", value: { type: "keyword", value: "table-column" } },
- ],
- colgroup: [
- {
- property: "display",
- value: { type: "keyword", value: "table-column-group" },
- },
- ],
- tbody: [
- {
- property: "display",
- value: { type: "keyword", value: "table-row-group" },
- },
- { property: "verticalAlign", value: { type: "keyword", value: "middle" } },
- ],
- thead: [
- {
- property: "display",
- value: { type: "keyword", value: "table-header-group" },
- },
- { property: "verticalAlign", value: { type: "keyword", value: "middle" } },
- ],
- tfoot: [
- {
- property: "display",
- value: { type: "keyword", value: "table-footer-group" },
- },
- { property: "verticalAlign", value: { type: "keyword", value: "middle" } },
- ],
- td: [
- { property: "display", value: { type: "keyword", value: "table-cell" } },
- { property: "verticalAlign", value: { type: "keyword", value: "inherit" } },
- { property: "paddingTop", value: { type: "unit", unit: "px", value: 1 } },
- { property: "paddingRight", value: { type: "unit", unit: "px", value: 1 } },
- {
- property: "paddingBottom",
- value: { type: "unit", unit: "px", value: 1 },
- },
- { property: "paddingLeft", value: { type: "unit", unit: "px", value: 1 } },
- ],
- th: [
- { property: "display", value: { type: "keyword", value: "table-cell" } },
- { property: "verticalAlign", value: { type: "keyword", value: "inherit" } },
- { property: "fontWeight", value: { type: "keyword", value: "bold" } },
- { property: "paddingTop", value: { type: "unit", unit: "px", value: 1 } },
- { property: "paddingRight", value: { type: "unit", unit: "px", value: 1 } },
- {
- property: "paddingBottom",
- value: { type: "unit", unit: "px", value: 1 },
- },
- { property: "paddingLeft", value: { type: "unit", unit: "px", value: 1 } },
- ],
- b: [{ property: "fontWeight", value: { type: "keyword", value: "bold" } }],
- strong: [
- { property: "fontWeight", value: { type: "keyword", value: "bold" } },
- ],
- i: [{ property: "fontStyle", value: { type: "keyword", value: "italic" } }],
- cite: [
- { property: "fontStyle", value: { type: "keyword", value: "italic" } },
- ],
- em: [{ property: "fontStyle", value: { type: "keyword", value: "italic" } }],
- var: [{ property: "fontStyle", value: { type: "keyword", value: "italic" } }],
- dfn: [{ property: "fontStyle", value: { type: "keyword", value: "italic" } }],
- code: [
- {
- property: "fontFamily",
- value: { type: "fontFamily", value: ["monospace"] },
- },
- ],
- kbd: [
- {
- property: "fontFamily",
- value: { type: "fontFamily", value: ["monospace"] },
- },
- ],
- samp: [
- {
- property: "fontFamily",
- value: { type: "fontFamily", value: ["monospace"] },
- },
- ],
- mark: [
- {
- property: "backgroundColor",
- value: { type: "keyword", value: "yellow" },
- },
- { property: "color", value: { type: "keyword", value: "black" } },
- ],
- u: [
- {
- property: "textDecorationLine",
- value: { type: "keyword", value: "underline" },
- },
- ],
- ins: [
- {
- property: "textDecorationLine",
- value: { type: "keyword", value: "underline" },
- },
- ],
- s: [
- {
- property: "textDecorationLine",
- value: { type: "keyword", value: "line-through" },
- },
- ],
- del: [
- {
- property: "textDecorationLine",
- value: { type: "keyword", value: "line-through" },
- },
- ],
- sub: [
- { property: "verticalAlign", value: { type: "keyword", value: "sub" } },
- { property: "fontSize", value: { type: "keyword", value: "smaller" } },
- ],
- sup: [
- { property: "verticalAlign", value: { type: "keyword", value: "super" } },
- { property: "fontSize", value: { type: "keyword", value: "smaller" } },
- ],
- a: [
- {
- property: "textDecorationLine",
- value: { type: "keyword", value: "underline" },
- },
- { property: "cursor", value: { type: "keyword", value: "pointer" } },
- { property: "color", value: { type: "rgb", alpha: 1, r: 0, g: 0, b: 238 } },
- ],
- ul: [
- { property: "display", value: { type: "keyword", value: "block" } },
- { property: "listStyleType", value: { type: "keyword", value: "disc" } },
- { property: "marginTop", value: { type: "unit", unit: "em", value: 1 } },
- { property: "marginBottom", value: { type: "unit", unit: "em", value: 1 } },
- { property: "paddingLeft", value: { type: "unit", unit: "px", value: 40 } },
- ],
- ol: [
- { property: "display", value: { type: "keyword", value: "block" } },
- { property: "listStyleType", value: { type: "keyword", value: "decimal" } },
- { property: "marginTop", value: { type: "unit", unit: "em", value: 1 } },
- { property: "marginBottom", value: { type: "unit", unit: "em", value: 1 } },
- { property: "paddingLeft", value: { type: "unit", unit: "px", value: 40 } },
- ],
- li: [
- { property: "display", value: { type: "keyword", value: "list-item" } },
- {
- property: "textAlign",
- value: { type: "keyword", value: "match-parent" },
- },
- ],
- hr: [
- { property: "color", value: { type: "keyword", value: "gray" } },
- {
- property: "borderTopWidth",
- value: { type: "unit", unit: "px", value: 1 },
- },
- {
- property: "borderRightWidth",
- value: { type: "unit", unit: "px", value: 1 },
- },
- {
- property: "borderBottomWidth",
- value: { type: "unit", unit: "px", value: 1 },
- },
- {
- property: "borderLeftWidth",
- value: { type: "unit", unit: "px", value: 1 },
- },
- { property: "borderTopStyle", value: { type: "keyword", value: "solid" } },
- {
- property: "borderRightStyle",
- value: { type: "keyword", value: "solid" },
- },
- {
- property: "borderBottomStyle",
- value: { type: "keyword", value: "solid" },
- },
- { property: "borderLeftStyle", value: { type: "keyword", value: "solid" } },
- { property: "marginTop", value: { type: "unit", unit: "em", value: 0.5 } },
- { property: "marginRight", value: { type: "keyword", value: "auto" } },
- {
- property: "marginBottom",
- value: { type: "unit", unit: "em", value: 0.5 },
- },
- { property: "marginLeft", value: { type: "keyword", value: "auto" } },
- { property: "overflowX", value: { type: "keyword", value: "hidden" } },
- { property: "overflowY", value: { type: "keyword", value: "hidden" } },
- { property: "display", value: { type: "keyword", value: "block" } },
- ],
- legend: [
- { property: "display", value: { type: "keyword", value: "block" } },
- { property: "paddingLeft", value: { type: "unit", unit: "px", value: 2 } },
- { property: "paddingRight", value: { type: "unit", unit: "px", value: 2 } },
- ],
- fieldset: [
- { property: "display", value: { type: "keyword", value: "block" } },
- { property: "marginLeft", value: { type: "unit", unit: "px", value: 2 } },
- { property: "marginRight", value: { type: "unit", unit: "px", value: 2 } },
- {
- property: "paddingTop",
- value: { type: "unit", unit: "em", value: 0.35 },
- },
- {
- property: "paddingRight",
- value: { type: "unit", unit: "em", value: 0.75 },
- },
- {
- property: "paddingBottom",
- value: { type: "unit", unit: "em", value: 0.625 },
- },
- {
- property: "paddingLeft",
- value: { type: "unit", unit: "em", value: 0.75 },
- },
- {
- property: "borderTopWidth",
- value: { type: "unit", unit: "px", value: 2 },
- },
- {
- property: "borderRightWidth",
- value: { type: "unit", unit: "px", value: 2 },
- },
- {
- property: "borderBottomWidth",
- value: { type: "unit", unit: "px", value: 2 },
- },
- {
- property: "borderLeftWidth",
- value: { type: "unit", unit: "px", value: 2 },
- },
- { property: "borderTopStyle", value: { type: "keyword", value: "solid" } },
- {
- property: "borderRightStyle",
- value: { type: "keyword", value: "solid" },
- },
- {
- property: "borderBottomStyle",
- value: { type: "keyword", value: "solid" },
- },
- { property: "borderLeftStyle", value: { type: "keyword", value: "solid" } },
- {
- property: "borderTopColor",
- value: { type: "keyword", value: "lightgray" },
- },
- {
- property: "borderRightColor",
- value: { type: "keyword", value: "lightgray" },
- },
- {
- property: "borderBottomColor",
- value: { type: "keyword", value: "lightgray" },
- },
- {
- property: "borderLeftColor",
- value: { type: "keyword", value: "lightgray" },
- },
- { property: "minWidth", value: { type: "keyword", value: "min-content" } },
- ],
- label: [{ property: "cursor", value: { type: "keyword", value: "default" } }],
- input: [
- { property: "appearance", value: { type: "keyword", value: "auto" } },
- { property: "paddingTop", value: { type: "unit", unit: "px", value: 1 } },
- { property: "paddingRight", value: { type: "unit", unit: "px", value: 1 } },
- {
- property: "paddingBottom",
- value: { type: "unit", unit: "px", value: 1 },
- },
- { property: "paddingLeft", value: { type: "unit", unit: "px", value: 1 } },
- {
- property: "borderTopWidth",
- value: { type: "unit", unit: "px", value: 2 },
- },
- {
- property: "borderRightWidth",
- value: { type: "unit", unit: "px", value: 2 },
- },
- {
- property: "borderBottomWidth",
- value: { type: "unit", unit: "px", value: 2 },
- },
- {
- property: "borderLeftWidth",
- value: { type: "unit", unit: "px", value: 2 },
- },
- { property: "borderTopStyle", value: { type: "keyword", value: "solid" } },
- {
- property: "borderRightStyle",
- value: { type: "keyword", value: "solid" },
- },
- {
- property: "borderBottomStyle",
- value: { type: "keyword", value: "solid" },
- },
- { property: "borderLeftStyle", value: { type: "keyword", value: "solid" } },
- { property: "backgroundColor", value: { type: "keyword", value: "white" } },
- { property: "cursor", value: { type: "keyword", value: "text" } },
- ],
- textarea: [
- { property: "color", value: { type: "keyword", value: "initial" } },
- { property: "letterSpacing", value: { type: "keyword", value: "normal" } },
- { property: "wordSpacing", value: { type: "keyword", value: "normal" } },
- { property: "lineHeight", value: { type: "keyword", value: "normal" } },
- { property: "textTransform", value: { type: "keyword", value: "none" } },
- {
- property: "textIndent",
- value: { type: "unit", unit: "number", value: 0 },
- },
- {
- property: "textShadow",
- value: {
- type: "layers",
- value: [{ type: "tuple", value: [{ type: "keyword", value: "none" }] }],
- },
- },
- { property: "display", value: { type: "keyword", value: "inline-block" } },
- { property: "textAlign", value: { type: "keyword", value: "start" } },
- { property: "appearance", value: { type: "keyword", value: "auto" } },
- { property: "marginTop", value: { type: "unit", unit: "px", value: 1 } },
- { property: "marginBottom", value: { type: "unit", unit: "px", value: 1 } },
- {
- property: "borderTopWidth",
- value: { type: "unit", unit: "px", value: 1 },
- },
- {
- property: "borderRightWidth",
- value: { type: "unit", unit: "px", value: 1 },
- },
- {
- property: "borderBottomWidth",
- value: { type: "unit", unit: "px", value: 1 },
- },
- {
- property: "borderLeftWidth",
- value: { type: "unit", unit: "px", value: 1 },
- },
- { property: "borderTopStyle", value: { type: "keyword", value: "solid" } },
- {
- property: "borderRightStyle",
- value: { type: "keyword", value: "solid" },
- },
- {
- property: "borderBottomStyle",
- value: { type: "keyword", value: "solid" },
- },
- { property: "borderLeftStyle", value: { type: "keyword", value: "solid" } },
- { property: "paddingTop", value: { type: "unit", unit: "px", value: 2 } },
- { property: "paddingRight", value: { type: "unit", unit: "px", value: 2 } },
- {
- property: "paddingBottom",
- value: { type: "unit", unit: "px", value: 2 },
- },
- { property: "paddingLeft", value: { type: "unit", unit: "px", value: 2 } },
- { property: "backgroundColor", value: { type: "keyword", value: "white" } },
- {
- property: "verticalAlign",
- value: { type: "keyword", value: "text-bottom" },
- },
- { property: "cursor", value: { type: "keyword", value: "text" } },
- { property: "resize", value: { type: "keyword", value: "both" } },
- {
- property: "whiteSpaceCollapse",
- value: { type: "keyword", value: "preserve" },
- },
- { property: "textWrapMode", value: { type: "keyword", value: "wrap" } },
- { property: "wordWrap", value: { type: "keyword", value: "break-word" } },
- ],
- select: [
- { property: "color", value: { type: "keyword", value: "initial" } },
- { property: "letterSpacing", value: { type: "keyword", value: "normal" } },
- { property: "wordSpacing", value: { type: "keyword", value: "normal" } },
- { property: "lineHeight", value: { type: "keyword", value: "normal" } },
- { property: "textTransform", value: { type: "keyword", value: "none" } },
- {
- property: "textIndent",
- value: { type: "unit", unit: "number", value: 0 },
- },
- {
- property: "textShadow",
- value: {
- type: "layers",
- value: [{ type: "tuple", value: [{ type: "keyword", value: "none" }] }],
- },
- },
- { property: "display", value: { type: "keyword", value: "inline-block" } },
- { property: "textAlign", value: { type: "keyword", value: "start" } },
- {
- property: "marginTop",
- value: { type: "unit", unit: "number", value: 0 },
- },
- {
- property: "marginRight",
- value: { type: "unit", unit: "number", value: 0 },
- },
- {
- property: "marginBottom",
- value: { type: "unit", unit: "number", value: 0 },
- },
- {
- property: "marginLeft",
- value: { type: "unit", unit: "number", value: 0 },
- },
- { property: "paddingTop", value: { type: "unit", unit: "px", value: 1 } },
- { property: "paddingRight", value: { type: "unit", unit: "px", value: 4 } },
- {
- property: "paddingBottom",
- value: { type: "unit", unit: "px", value: 1 },
- },
- { property: "paddingLeft", value: { type: "unit", unit: "px", value: 4 } },
- {
- property: "borderTopWidth",
- value: { type: "unit", unit: "px", value: 2 },
- },
- {
- property: "borderRightWidth",
- value: { type: "unit", unit: "px", value: 2 },
- },
- {
- property: "borderBottomWidth",
- value: { type: "unit", unit: "px", value: 2 },
- },
- {
- property: "borderLeftWidth",
- value: { type: "unit", unit: "px", value: 2 },
- },
- { property: "borderTopStyle", value: { type: "keyword", value: "solid" } },
- {
- property: "borderRightStyle",
- value: { type: "keyword", value: "solid" },
- },
- {
- property: "borderBottomStyle",
- value: { type: "keyword", value: "solid" },
- },
- { property: "borderLeftStyle", value: { type: "keyword", value: "solid" } },
- { property: "textWrapMode", value: { type: "keyword", value: "nowrap" } },
- { property: "wordWrap", value: { type: "keyword", value: "normal" } },
- { property: "cursor", value: { type: "keyword", value: "default" } },
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
- { property: "userSelect", value: { type: "keyword", value: "none" } },
- { property: "overflowX", value: { type: "keyword", value: "clip" } },
- { property: "overflowY", value: { type: "keyword", value: "clip" } },
- {
- property: "verticalAlign",
- value: { type: "keyword", value: "baseline" },
- },
- { property: "appearance", value: { type: "keyword", value: "auto" } },
- ],
- button: [
- { property: "color", value: { type: "keyword", value: "initial" } },
- { property: "letterSpacing", value: { type: "keyword", value: "normal" } },
- { property: "wordSpacing", value: { type: "keyword", value: "normal" } },
- { property: "lineHeight", value: { type: "keyword", value: "normal" } },
- { property: "textTransform", value: { type: "keyword", value: "none" } },
- {
- property: "textIndent",
- value: { type: "unit", unit: "number", value: 0 },
- },
- {
- property: "textShadow",
- value: {
- type: "layers",
- value: [{ type: "tuple", value: [{ type: "keyword", value: "none" }] }],
- },
- },
- { property: "display", value: { type: "keyword", value: "inline-block" } },
- { property: "appearance", value: { type: "keyword", value: "auto" } },
- { property: "paddingTop", value: { type: "unit", unit: "px", value: 2 } },
- { property: "paddingRight", value: { type: "unit", unit: "px", value: 6 } },
- {
- property: "paddingBottom",
- value: { type: "unit", unit: "px", value: 3 },
- },
- { property: "paddingLeft", value: { type: "unit", unit: "px", value: 6 } },
- {
- property: "borderTopWidth",
- value: { type: "unit", unit: "px", value: 2 },
- },
- {
- property: "borderRightWidth",
- value: { type: "unit", unit: "px", value: 2 },
- },
- {
- property: "borderBottomWidth",
- value: { type: "unit", unit: "px", value: 2 },
- },
- {
- property: "borderLeftWidth",
- value: { type: "unit", unit: "px", value: 2 },
- },
- { property: "borderTopStyle", value: { type: "keyword", value: "solid" } },
- {
- property: "borderRightStyle",
- value: { type: "keyword", value: "solid" },
- },
- {
- property: "borderBottomStyle",
- value: { type: "keyword", value: "solid" },
- },
- { property: "borderLeftStyle", value: { type: "keyword", value: "solid" } },
- { property: "cursor", value: { type: "keyword", value: "default" } },
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
- { property: "userSelect", value: { type: "keyword", value: "none" } },
- { property: "textAlign", value: { type: "keyword", value: "center" } },
- {
- property: "backgroundColor",
- value: { type: "keyword", value: "lightgray" },
- },
- ],
- option: [
- { property: "display", value: { type: "keyword", value: "block" } },
- { property: "float", value: { type: "keyword", value: "none" } },
- { property: "position", value: { type: "keyword", value: "static" } },
- { property: "minHeight", value: { type: "unit", unit: "em", value: 1 } },
- { property: "paddingTop", value: { type: "unit", unit: "px", value: 2 } },
- { property: "paddingRight", value: { type: "unit", unit: "px", value: 2 } },
- {
- property: "paddingBottom",
- value: { type: "unit", unit: "px", value: 2 },
- },
- { property: "paddingLeft", value: { type: "unit", unit: "px", value: 4 } },
- { property: "userSelect", value: { type: "keyword", value: "none" } },
- { property: "textWrapMode", value: { type: "keyword", value: "nowrap" } },
- { property: "wordWrap", value: { type: "keyword", value: "normal" } },
- ],
-};
+import type { htmlTags as HtmlTags } from "html-tags";
+import type { StyleValue } from "@webstudio-is/css-engine";
+
+export const html = new Map<`${HtmlTags}:${string}`, StyleValue>([
+ ["article:display", { type: "keyword", value: "block" }],
+ ["aside:display", { type: "keyword", value: "block" }],
+ ["details:display", { type: "keyword", value: "block" }],
+ ["div:display", { type: "keyword", value: "block" }],
+ ["dt:display", { type: "keyword", value: "block" }],
+ ["figcaption:display", { type: "keyword", value: "block" }],
+ ["footer:display", { type: "keyword", value: "block" }],
+ ["form:display", { type: "keyword", value: "block" }],
+ ["header:display", { type: "keyword", value: "block" }],
+ ["hgroup:display", { type: "keyword", value: "block" }],
+ ["html:display", { type: "keyword", value: "block" }],
+ ["main:display", { type: "keyword", value: "block" }],
+ ["nav:display", { type: "keyword", value: "block" }],
+ ["section:display", { type: "keyword", value: "block" }],
+ ["summary:display", { type: "keyword", value: "block" }],
+ ["body:display", { type: "keyword", value: "block" }],
+ ["body:marginTop", { type: "unit", unit: "px", value: 8 }],
+ ["body:marginRight", { type: "unit", unit: "px", value: 8 }],
+ ["body:marginBottom", { type: "unit", unit: "px", value: 8 }],
+ ["body:marginLeft", { type: "unit", unit: "px", value: 8 }],
+ ["p:display", { type: "keyword", value: "block" }],
+ ["dl:display", { type: "keyword", value: "block" }],
+ ["p:marginTop", { type: "unit", unit: "em", value: 1 }],
+ ["dl:marginTop", { type: "unit", unit: "em", value: 1 }],
+ ["p:marginBottom", { type: "unit", unit: "em", value: 1 }],
+ ["dl:marginBottom", { type: "unit", unit: "em", value: 1 }],
+ ["dd:display", { type: "keyword", value: "block" }],
+ ["dd:marginLeft", { type: "unit", unit: "px", value: 40 }],
+ ["blockquote:display", { type: "keyword", value: "block" }],
+ ["figure:display", { type: "keyword", value: "block" }],
+ ["blockquote:marginTop", { type: "unit", unit: "em", value: 1 }],
+ ["blockquote:marginRight", { type: "unit", unit: "px", value: 40 }],
+ ["blockquote:marginBottom", { type: "unit", unit: "em", value: 1 }],
+ ["blockquote:marginLeft", { type: "unit", unit: "px", value: 40 }],
+ ["figure:marginTop", { type: "unit", unit: "em", value: 1 }],
+ ["figure:marginRight", { type: "unit", unit: "px", value: 40 }],
+ ["figure:marginBottom", { type: "unit", unit: "em", value: 1 }],
+ ["figure:marginLeft", { type: "unit", unit: "px", value: 40 }],
+ ["address:display", { type: "keyword", value: "block" }],
+ ["address:fontStyle", { type: "keyword", value: "italic" }],
+ ["h1:display", { type: "keyword", value: "block" }],
+ ["h1:fontWeight", { type: "keyword", value: "bold" }],
+ ["h1:fontSize", { type: "unit", unit: "em", value: 2 }],
+ ["h1:marginTop", { type: "unit", unit: "em", value: 0.67 }],
+ ["h1:marginBottom", { type: "unit", unit: "em", value: 0.67 }],
+ ["h2:display", { type: "keyword", value: "block" }],
+ ["h2:fontWeight", { type: "keyword", value: "bold" }],
+ ["h2:fontSize", { type: "unit", unit: "em", value: 1.5 }],
+ ["h2:marginTop", { type: "unit", unit: "em", value: 0.83 }],
+ ["h2:marginBottom", { type: "unit", unit: "em", value: 0.83 }],
+ ["h3:display", { type: "keyword", value: "block" }],
+ ["h3:fontWeight", { type: "keyword", value: "bold" }],
+ ["h3:fontSize", { type: "unit", unit: "em", value: 1.17 }],
+ ["h3:marginTop", { type: "unit", unit: "em", value: 1 }],
+ ["h3:marginBottom", { type: "unit", unit: "em", value: 1 }],
+ ["h4:display", { type: "keyword", value: "block" }],
+ ["h4:fontWeight", { type: "keyword", value: "bold" }],
+ ["h4:marginTop", { type: "unit", unit: "em", value: 1.33 }],
+ ["h4:marginBottom", { type: "unit", unit: "em", value: 1.33 }],
+ ["h5:display", { type: "keyword", value: "block" }],
+ ["h5:fontWeight", { type: "keyword", value: "bold" }],
+ ["h5:fontSize", { type: "unit", unit: "em", value: 0.83 }],
+ ["h5:marginTop", { type: "unit", unit: "em", value: 1.67 }],
+ ["h5:marginBottom", { type: "unit", unit: "em", value: 1.67 }],
+ ["h6:display", { type: "keyword", value: "block" }],
+ ["h6:fontWeight", { type: "keyword", value: "bold" }],
+ ["h6:fontSize", { type: "unit", unit: "em", value: 0.67 }],
+ ["h6:marginTop", { type: "unit", unit: "em", value: 2.33 }],
+ ["h6:marginBottom", { type: "unit", unit: "em", value: 2.33 }],
+ ["pre:display", { type: "keyword", value: "block" }],
+ ["pre:whiteSpaceCollapse", { type: "keyword", value: "preserve" }],
+ ["pre:textWrapMode", { type: "keyword", value: "nowrap" }],
+ ["pre:marginTop", { type: "unit", unit: "em", value: 1 }],
+ ["pre:marginBottom", { type: "unit", unit: "em", value: 1 }],
+ ["table:display", { type: "keyword", value: "table" }],
+ ["table:borderSpacing", { type: "unit", unit: "px", value: 2 }],
+ ["table:borderCollapse", { type: "keyword", value: "separate" }],
+ ["table:boxSizing", { type: "keyword", value: "border-box" }],
+ ["table:textIndent", { type: "unit", unit: "number", value: 0 }],
+ ["caption:display", { type: "keyword", value: "table-caption" }],
+ ["caption:textAlign", { type: "keyword", value: "center" }],
+ ["tr:display", { type: "keyword", value: "table-row" }],
+ ["tr:verticalAlign", { type: "keyword", value: "inherit" }],
+ ["col:display", { type: "keyword", value: "table-column" }],
+ ["colgroup:display", { type: "keyword", value: "table-column-group" }],
+ ["tbody:display", { type: "keyword", value: "table-row-group" }],
+ ["tbody:verticalAlign", { type: "keyword", value: "middle" }],
+ ["thead:display", { type: "keyword", value: "table-header-group" }],
+ ["thead:verticalAlign", { type: "keyword", value: "middle" }],
+ ["tfoot:display", { type: "keyword", value: "table-footer-group" }],
+ ["tfoot:verticalAlign", { type: "keyword", value: "middle" }],
+ ["td:display", { type: "keyword", value: "table-cell" }],
+ ["td:verticalAlign", { type: "keyword", value: "inherit" }],
+ ["td:paddingTop", { type: "unit", unit: "px", value: 1 }],
+ ["td:paddingRight", { type: "unit", unit: "px", value: 1 }],
+ ["td:paddingBottom", { type: "unit", unit: "px", value: 1 }],
+ ["td:paddingLeft", { type: "unit", unit: "px", value: 1 }],
+ ["th:display", { type: "keyword", value: "table-cell" }],
+ ["th:verticalAlign", { type: "keyword", value: "inherit" }],
+ ["th:fontWeight", { type: "keyword", value: "bold" }],
+ ["th:paddingTop", { type: "unit", unit: "px", value: 1 }],
+ ["th:paddingRight", { type: "unit", unit: "px", value: 1 }],
+ ["th:paddingBottom", { type: "unit", unit: "px", value: 1 }],
+ ["th:paddingLeft", { type: "unit", unit: "px", value: 1 }],
+ ["b:fontWeight", { type: "keyword", value: "bold" }],
+ ["strong:fontWeight", { type: "keyword", value: "bold" }],
+ ["i:fontStyle", { type: "keyword", value: "italic" }],
+ ["cite:fontStyle", { type: "keyword", value: "italic" }],
+ ["em:fontStyle", { type: "keyword", value: "italic" }],
+ ["var:fontStyle", { type: "keyword", value: "italic" }],
+ ["dfn:fontStyle", { type: "keyword", value: "italic" }],
+ ["code:fontFamily", { type: "fontFamily", value: ["monospace"] }],
+ ["kbd:fontFamily", { type: "fontFamily", value: ["monospace"] }],
+ ["samp:fontFamily", { type: "fontFamily", value: ["monospace"] }],
+ ["mark:backgroundColor", { type: "keyword", value: "yellow" }],
+ ["mark:color", { type: "keyword", value: "black" }],
+ ["u:textDecorationLine", { type: "keyword", value: "underline" }],
+ ["ins:textDecorationLine", { type: "keyword", value: "underline" }],
+ ["s:textDecorationLine", { type: "keyword", value: "line-through" }],
+ ["del:textDecorationLine", { type: "keyword", value: "line-through" }],
+ ["sub:verticalAlign", { type: "keyword", value: "sub" }],
+ ["sub:fontSize", { type: "keyword", value: "smaller" }],
+ ["sup:verticalAlign", { type: "keyword", value: "super" }],
+ ["sup:fontSize", { type: "keyword", value: "smaller" }],
+ ["a:textDecorationLine", { type: "keyword", value: "underline" }],
+ ["a:cursor", { type: "keyword", value: "pointer" }],
+ ["a:color", { type: "rgb", alpha: 1, r: 0, g: 0, b: 238 }],
+ ["ul:display", { type: "keyword", value: "block" }],
+ ["ul:listStyleType", { type: "keyword", value: "disc" }],
+ ["ul:marginTop", { type: "unit", unit: "em", value: 1 }],
+ ["ul:marginBottom", { type: "unit", unit: "em", value: 1 }],
+ ["ul:paddingLeft", { type: "unit", unit: "px", value: 40 }],
+ ["ol:display", { type: "keyword", value: "block" }],
+ ["ol:listStyleType", { type: "keyword", value: "decimal" }],
+ ["ol:marginTop", { type: "unit", unit: "em", value: 1 }],
+ ["ol:marginBottom", { type: "unit", unit: "em", value: 1 }],
+ ["ol:paddingLeft", { type: "unit", unit: "px", value: 40 }],
+ ["li:display", { type: "keyword", value: "list-item" }],
+ ["li:textAlign", { type: "keyword", value: "match-parent" }],
+ ["hr:color", { type: "keyword", value: "gray" }],
+ ["hr:borderTopWidth", { type: "unit", unit: "px", value: 1 }],
+ ["hr:borderRightWidth", { type: "unit", unit: "px", value: 1 }],
+ ["hr:borderBottomWidth", { type: "unit", unit: "px", value: 1 }],
+ ["hr:borderLeftWidth", { type: "unit", unit: "px", value: 1 }],
+ ["hr:borderTopStyle", { type: "keyword", value: "solid" }],
+ ["hr:borderRightStyle", { type: "keyword", value: "solid" }],
+ ["hr:borderBottomStyle", { type: "keyword", value: "solid" }],
+ ["hr:borderLeftStyle", { type: "keyword", value: "solid" }],
+ ["hr:marginTop", { type: "unit", unit: "em", value: 0.5 }],
+ ["hr:marginRight", { type: "keyword", value: "auto" }],
+ ["hr:marginBottom", { type: "unit", unit: "em", value: 0.5 }],
+ ["hr:marginLeft", { type: "keyword", value: "auto" }],
+ ["hr:overflowX", { type: "keyword", value: "hidden" }],
+ ["hr:overflowY", { type: "keyword", value: "hidden" }],
+ ["hr:display", { type: "keyword", value: "block" }],
+ ["legend:display", { type: "keyword", value: "block" }],
+ ["legend:paddingLeft", { type: "unit", unit: "px", value: 2 }],
+ ["legend:paddingRight", { type: "unit", unit: "px", value: 2 }],
+ ["fieldset:display", { type: "keyword", value: "block" }],
+ ["fieldset:marginLeft", { type: "unit", unit: "px", value: 2 }],
+ ["fieldset:marginRight", { type: "unit", unit: "px", value: 2 }],
+ ["fieldset:paddingTop", { type: "unit", unit: "em", value: 0.35 }],
+ ["fieldset:paddingRight", { type: "unit", unit: "em", value: 0.75 }],
+ ["fieldset:paddingBottom", { type: "unit", unit: "em", value: 0.625 }],
+ ["fieldset:paddingLeft", { type: "unit", unit: "em", value: 0.75 }],
+ ["fieldset:borderTopWidth", { type: "unit", unit: "px", value: 2 }],
+ ["fieldset:borderRightWidth", { type: "unit", unit: "px", value: 2 }],
+ ["fieldset:borderBottomWidth", { type: "unit", unit: "px", value: 2 }],
+ ["fieldset:borderLeftWidth", { type: "unit", unit: "px", value: 2 }],
+ ["fieldset:borderTopStyle", { type: "keyword", value: "solid" }],
+ ["fieldset:borderRightStyle", { type: "keyword", value: "solid" }],
+ ["fieldset:borderBottomStyle", { type: "keyword", value: "solid" }],
+ ["fieldset:borderLeftStyle", { type: "keyword", value: "solid" }],
+ ["fieldset:borderTopColor", { type: "keyword", value: "lightgray" }],
+ ["fieldset:borderRightColor", { type: "keyword", value: "lightgray" }],
+ ["fieldset:borderBottomColor", { type: "keyword", value: "lightgray" }],
+ ["fieldset:borderLeftColor", { type: "keyword", value: "lightgray" }],
+ ["fieldset:minWidth", { type: "keyword", value: "min-content" }],
+ ["label:cursor", { type: "keyword", value: "default" }],
+ ["input:appearance", { type: "keyword", value: "auto" }],
+ ["input:paddingTop", { type: "unit", unit: "px", value: 1 }],
+ ["input:paddingRight", { type: "unit", unit: "px", value: 1 }],
+ ["input:paddingBottom", { type: "unit", unit: "px", value: 1 }],
+ ["input:paddingLeft", { type: "unit", unit: "px", value: 1 }],
+ ["input:borderTopWidth", { type: "unit", unit: "px", value: 2 }],
+ ["input:borderRightWidth", { type: "unit", unit: "px", value: 2 }],
+ ["input:borderBottomWidth", { type: "unit", unit: "px", value: 2 }],
+ ["input:borderLeftWidth", { type: "unit", unit: "px", value: 2 }],
+ ["input:borderTopStyle", { type: "keyword", value: "solid" }],
+ ["input:borderRightStyle", { type: "keyword", value: "solid" }],
+ ["input:borderBottomStyle", { type: "keyword", value: "solid" }],
+ ["input:borderLeftStyle", { type: "keyword", value: "solid" }],
+ ["input:backgroundColor", { type: "keyword", value: "white" }],
+ ["input:cursor", { type: "keyword", value: "text" }],
+ ["textarea:color", { type: "keyword", value: "initial" }],
+ ["select:color", { type: "keyword", value: "initial" }],
+ ["button:color", { type: "keyword", value: "initial" }],
+ ["textarea:letterSpacing", { type: "keyword", value: "normal" }],
+ ["select:letterSpacing", { type: "keyword", value: "normal" }],
+ ["button:letterSpacing", { type: "keyword", value: "normal" }],
+ ["textarea:wordSpacing", { type: "keyword", value: "normal" }],
+ ["select:wordSpacing", { type: "keyword", value: "normal" }],
+ ["button:wordSpacing", { type: "keyword", value: "normal" }],
+ ["textarea:lineHeight", { type: "keyword", value: "normal" }],
+ ["select:lineHeight", { type: "keyword", value: "normal" }],
+ ["button:lineHeight", { type: "keyword", value: "normal" }],
+ ["textarea:textTransform", { type: "keyword", value: "none" }],
+ ["select:textTransform", { type: "keyword", value: "none" }],
+ ["button:textTransform", { type: "keyword", value: "none" }],
+ ["textarea:textIndent", { type: "unit", unit: "number", value: 0 }],
+ ["select:textIndent", { type: "unit", unit: "number", value: 0 }],
+ ["button:textIndent", { type: "unit", unit: "number", value: 0 }],
+ [
+ "textarea:textShadow",
+ {
+ type: "layers",
+ value: [{ type: "tuple", value: [{ type: "keyword", value: "none" }] }],
+ },
+ ],
+ [
+ "select:textShadow",
+ {
+ type: "layers",
+ value: [{ type: "tuple", value: [{ type: "keyword", value: "none" }] }],
+ },
+ ],
+ [
+ "button:textShadow",
+ {
+ type: "layers",
+ value: [{ type: "tuple", value: [{ type: "keyword", value: "none" }] }],
+ },
+ ],
+ ["textarea:display", { type: "keyword", value: "inline-block" }],
+ ["select:display", { type: "keyword", value: "inline-block" }],
+ ["button:display", { type: "keyword", value: "inline-block" }],
+ ["textarea:textAlign", { type: "keyword", value: "start" }],
+ ["textarea:appearance", { type: "keyword", value: "auto" }],
+ ["textarea:marginTop", { type: "unit", unit: "px", value: 1 }],
+ ["textarea:marginBottom", { type: "unit", unit: "px", value: 1 }],
+ ["textarea:borderTopWidth", { type: "unit", unit: "px", value: 1 }],
+ ["textarea:borderRightWidth", { type: "unit", unit: "px", value: 1 }],
+ ["textarea:borderBottomWidth", { type: "unit", unit: "px", value: 1 }],
+ ["textarea:borderLeftWidth", { type: "unit", unit: "px", value: 1 }],
+ ["textarea:borderTopStyle", { type: "keyword", value: "solid" }],
+ ["textarea:borderRightStyle", { type: "keyword", value: "solid" }],
+ ["textarea:borderBottomStyle", { type: "keyword", value: "solid" }],
+ ["textarea:borderLeftStyle", { type: "keyword", value: "solid" }],
+ ["textarea:paddingTop", { type: "unit", unit: "px", value: 2 }],
+ ["textarea:paddingRight", { type: "unit", unit: "px", value: 2 }],
+ ["textarea:paddingBottom", { type: "unit", unit: "px", value: 2 }],
+ ["textarea:paddingLeft", { type: "unit", unit: "px", value: 2 }],
+ ["textarea:backgroundColor", { type: "keyword", value: "white" }],
+ ["textarea:verticalAlign", { type: "keyword", value: "text-bottom" }],
+ ["textarea:cursor", { type: "keyword", value: "text" }],
+ ["textarea:resize", { type: "keyword", value: "both" }],
+ ["textarea:whiteSpaceCollapse", { type: "keyword", value: "preserve" }],
+ ["textarea:textWrapMode", { type: "keyword", value: "wrap" }],
+ ["textarea:wordWrap", { type: "keyword", value: "break-word" }],
+ ["select:textAlign", { type: "keyword", value: "start" }],
+ ["select:marginTop", { type: "unit", unit: "number", value: 0 }],
+ ["select:marginRight", { type: "unit", unit: "number", value: 0 }],
+ ["select:marginBottom", { type: "unit", unit: "number", value: 0 }],
+ ["select:marginLeft", { type: "unit", unit: "number", value: 0 }],
+ ["select:paddingTop", { type: "unit", unit: "px", value: 1 }],
+ ["select:paddingRight", { type: "unit", unit: "px", value: 4 }],
+ ["select:paddingBottom", { type: "unit", unit: "px", value: 1 }],
+ ["select:paddingLeft", { type: "unit", unit: "px", value: 4 }],
+ ["select:borderTopWidth", { type: "unit", unit: "px", value: 2 }],
+ ["select:borderRightWidth", { type: "unit", unit: "px", value: 2 }],
+ ["select:borderBottomWidth", { type: "unit", unit: "px", value: 2 }],
+ ["select:borderLeftWidth", { type: "unit", unit: "px", value: 2 }],
+ ["select:borderTopStyle", { type: "keyword", value: "solid" }],
+ ["select:borderRightStyle", { type: "keyword", value: "solid" }],
+ ["select:borderBottomStyle", { type: "keyword", value: "solid" }],
+ ["select:borderLeftStyle", { type: "keyword", value: "solid" }],
+ ["select:textWrapMode", { type: "keyword", value: "nowrap" }],
+ ["select:wordWrap", { type: "keyword", value: "normal" }],
+ ["select:cursor", { type: "keyword", value: "default" }],
+ ["select:boxSizing", { type: "keyword", value: "border-box" }],
+ ["select:userSelect", { type: "keyword", value: "none" }],
+ ["select:overflowX", { type: "keyword", value: "clip" }],
+ ["select:overflowY", { type: "keyword", value: "clip" }],
+ ["select:verticalAlign", { type: "keyword", value: "baseline" }],
+ ["select:appearance", { type: "keyword", value: "auto" }],
+ ["option:display", { type: "keyword", value: "block" }],
+ ["option:float", { type: "keyword", value: "none" }],
+ ["option:position", { type: "keyword", value: "static" }],
+ ["option:minHeight", { type: "unit", unit: "em", value: 1 }],
+ ["option:paddingTop", { type: "unit", unit: "px", value: 2 }],
+ ["option:paddingRight", { type: "unit", unit: "px", value: 2 }],
+ ["option:paddingBottom", { type: "unit", unit: "px", value: 2 }],
+ ["option:paddingLeft", { type: "unit", unit: "px", value: 4 }],
+ ["option:userSelect", { type: "keyword", value: "none" }],
+ ["option:textWrapMode", { type: "keyword", value: "nowrap" }],
+ ["option:wordWrap", { type: "keyword", value: "normal" }],
+ ["button:appearance", { type: "keyword", value: "auto" }],
+ ["button:paddingTop", { type: "unit", unit: "px", value: 2 }],
+ ["button:paddingRight", { type: "unit", unit: "px", value: 6 }],
+ ["button:paddingBottom", { type: "unit", unit: "px", value: 3 }],
+ ["button:paddingLeft", { type: "unit", unit: "px", value: 6 }],
+ ["button:borderTopWidth", { type: "unit", unit: "px", value: 2 }],
+ ["button:borderRightWidth", { type: "unit", unit: "px", value: 2 }],
+ ["button:borderBottomWidth", { type: "unit", unit: "px", value: 2 }],
+ ["button:borderLeftWidth", { type: "unit", unit: "px", value: 2 }],
+ ["button:borderTopStyle", { type: "keyword", value: "solid" }],
+ ["button:borderRightStyle", { type: "keyword", value: "solid" }],
+ ["button:borderBottomStyle", { type: "keyword", value: "solid" }],
+ ["button:borderLeftStyle", { type: "keyword", value: "solid" }],
+ ["button:cursor", { type: "keyword", value: "default" }],
+ ["button:boxSizing", { type: "keyword", value: "border-box" }],
+ ["button:userSelect", { type: "keyword", value: "none" }],
+ ["button:textAlign", { type: "keyword", value: "center" }],
+ ["button:backgroundColor", { type: "keyword", value: "lightgray" }],
+]);
diff --git a/packages/css-data/src/index.ts b/packages/css-data/src/index.ts
index 7d3d6c29f6..254cb94c97 100644
--- a/packages/css-data/src/index.ts
+++ b/packages/css-data/src/index.ts
@@ -1,14 +1,6 @@
import type { WritableDeep } from "type-fest";
-import type { htmlTags as HtmlTags } from "html-tags";
-import type { StyleProperty, StyleValue } from "@webstudio-is/css-engine";
-import { html as htmlJson } from "./__generated__/html";
-
-type Html = {
- [tag in HtmlTags]?: Array<{ property: StyleProperty; value: StyleValue }>;
-};
-undefined as unknown as keyof typeof htmlJson satisfies HtmlTags;
-export const html = htmlJson as Html;
+export { html } from "./__generated__/html";
export * from "./__generated__/keyword-values";
export * from "./__generated__/units";
export {