|
| 1 | +// this module should not rely on "template" and other unpublished packages |
| 2 | +import type { StyleProperty, Unit } from "@webstudio-is/css-engine"; |
| 3 | +import type { EmbedTemplateStyleDecl } from "@webstudio-is/react-sdk"; |
| 4 | + |
| 5 | +const unit = (property: StyleProperty, value: number, unit: Unit) => ({ |
| 6 | + property, |
| 7 | + value: { type: "unit", unit, value } as const, |
| 8 | +}); |
| 9 | + |
| 10 | +const keyword = (property: StyleProperty, value: string) => ({ |
| 11 | + property, |
| 12 | + value: { type: "keyword", value } as const, |
| 13 | +}); |
| 14 | + |
| 15 | +const rgb = (property: StyleProperty, r: number, g: number, b: number) => ({ |
| 16 | + property, |
| 17 | + value: { type: "rgb", alpha: 1, r, g, b } as const, |
| 18 | +}); |
| 19 | + |
| 20 | +export const buttonReset: EmbedTemplateStyleDecl[] = [ |
| 21 | + { |
| 22 | + property: "backgroundColor", |
| 23 | + value: { type: "keyword", value: "transparent" }, |
| 24 | + }, |
| 25 | + { |
| 26 | + property: "backgroundImage", |
| 27 | + value: { type: "keyword", value: "none" }, |
| 28 | + }, |
| 29 | + |
| 30 | + unit("borderTopWidth", 0, "px"), |
| 31 | + unit("borderRightWidth", 0, "px"), |
| 32 | + unit("borderBottomWidth", 0, "px"), |
| 33 | + unit("borderLeftWidth", 0, "px"), |
| 34 | + keyword("borderTopStyle", "solid"), |
| 35 | + keyword("borderRightStyle", "solid"), |
| 36 | + keyword("borderBottomStyle", "solid"), |
| 37 | + keyword("borderLeftStyle", "solid"), |
| 38 | + rgb("borderTopColor", 226, 232, 240), |
| 39 | + rgb("borderRightColor", 226, 232, 240), |
| 40 | + rgb("borderBottomColor", 226, 232, 240), |
| 41 | + rgb("borderLeftColor", 226, 232, 240), |
| 42 | + |
| 43 | + unit("paddingTop", 0, "px"), |
| 44 | + unit("paddingRight", 0, "px"), |
| 45 | + unit("paddingBottom", 0, "px"), |
| 46 | + unit("paddingLeft", 0, "px"), |
| 47 | +]; |
0 commit comments