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 @@ -39,7 +39,7 @@ export const sections = new Map<
["filter", filter],
["backdropFilters", backdropFilter],
["transitions", transitions],
["transfrom", transforms],
["transforms", transforms],
["outline", outline],
["advanced", advanced],
]);
24 changes: 20 additions & 4 deletions apps/builder/app/builder/features/style-panel/style-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ import {
} from "~/builder/shared/client-settings";
import { sections } from "./sections";
import { StyleSourcesSection } from "./style-source-section";
import { $instanceTags, useParentComputedStyleDecl } from "./shared/model";
import {
$instanceTags,
useComputedStyleDecl,
useParentComputedStyleDecl,
} from "./shared/model";

const $selectedInstanceTag = computed(
[$selectedInstance, $instanceTags],
Expand Down Expand Up @@ -123,8 +127,10 @@ export const StylePanel = ({
const { stylePanelMode } = useStore($settings);
const selectedInstanceRenderState = useStore($selectedInstanceRenderState);
const tag = useStore($selectedInstanceTag);
const display = useParentComputedStyleDecl("display");
const displayValue = toValue(display.computedValue);
const display = toValue(useComputedStyleDecl("display").computedValue);
const parentDisplay = toValue(
useParentComputedStyleDecl("display").computedValue
);

// If selected instance is not rendered on the canvas,
// style panel will not work, because it needs the element in DOM in order to work.
Expand All @@ -147,7 +153,7 @@ export const StylePanel = ({
continue;
}
// show flex child UI only when parent is flex or inline-flex
if (category === "flexChild" && displayValue.includes("flex") === false) {
if (category === "flexChild" && parentDisplay.includes("flex") === false) {
continue;
}
// allow customizing list item type only for list and list item
Expand All @@ -159,6 +165,16 @@ export const StylePanel = ({
) {
continue;
}
// non-replaced inline boxes cannot be transformed
// https://drafts.csswg.org/css-transforms-1/#css-values
if (
category === "transforms" &&
(display === "inline" ||
display === "table-column" ||
display === "table-column-group")
) {
continue;
}
all.push(<Section key={category} />);
}

Expand Down