Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

experimental: add more hints about css variables #4282

Merged
merged 1 commit into from
Oct 14, 2024
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 @@ -10,6 +10,7 @@ import {
ScrollArea,
SmallIconButton,
styled,
Text,
theme,
toast,
Tooltip,
Expand All @@ -26,7 +27,11 @@ import {
WsComponentMeta,
} from "@webstudio-is/react-sdk";
import { ROOT_INSTANCE_ID, type Instance } from "@webstudio-is/sdk";
import { EyeconClosedIcon, EyeconOpenIcon } from "@webstudio-is/icons";
import {
EyeconClosedIcon,
EyeconOpenIcon,
InfoCircleIcon,
} from "@webstudio-is/icons";
import {
$dragAndDropState,
$editingItemSelector,
Expand Down Expand Up @@ -476,6 +481,21 @@ export const NavigatorTree = () => {
onClick: () => $selectedInstanceSelector.set([ROOT_INSTANCE_ID]),
onFocus: () => $selectedInstanceSelector.set([ROOT_INSTANCE_ID]),
}}
action={
<Tooltip
variant="wrapped"
side="bottom"
disableHoverableContent={true}
content={
<Text>
Variables defined on Global Root are available on every
instance on every page.
</Text>
}
>
<InfoCircleIcon />
</Tooltip>
}
>
<TreeNodeLabel prefix={<MetaIcon icon={rootMeta.icon} />}>
{rootMeta.label}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ const AdvancedSearch = ({
itemToString={(item) => item?.label ?? ""}
getItemProps={() => ({ text: "sentence" })}
getDescription={(item) => {
let description = `Unknown CSS property.`;
let description = `Create CSS variable.`;
if (item && item.value in propertyDescriptions) {
description =
propertyDescriptions[
Expand Down Expand Up @@ -201,7 +201,7 @@ const AdvancedPropertyLabel = ({ property }: { property: StyleProperty }) => {
}}
content={
<PropertyInfo
title={label}
title={property.startsWith("--") ? "CSS Variable" : label}
description={description}
styles={[styleDecl]}
onReset={() => {
Expand Down