Skip to content

Commit 0e71255

Browse files
authored
experimental: add more hints about css variables (#4282)
Ref #3399 Added a few hints ![Screenshot 2024-10-14 at 16 12 07](https://github.com/user-attachments/assets/4a7cf0f8-9cd1-408a-9c16-6cb6c8d77970) ![Screenshot 2024-10-14 at 16 08 04](https://github.com/user-attachments/assets/7d4be8b3-596a-4d07-9761-0677f1acd40b) ![Screenshot 2024-10-14 at 16 07 56](https://github.com/user-attachments/assets/73facdda-724c-4ef8-935e-69cbd0775d6c)
1 parent 11f5450 commit 0e71255

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

apps/builder/app/builder/features/sidebar-left/panels/navigator/navigator-tree.tsx

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
ScrollArea,
1111
SmallIconButton,
1212
styled,
13+
Text,
1314
theme,
1415
toast,
1516
Tooltip,
@@ -26,7 +27,11 @@ import {
2627
WsComponentMeta,
2728
} from "@webstudio-is/react-sdk";
2829
import { ROOT_INSTANCE_ID, type Instance } from "@webstudio-is/sdk";
29-
import { EyeconClosedIcon, EyeconOpenIcon } from "@webstudio-is/icons";
30+
import {
31+
EyeconClosedIcon,
32+
EyeconOpenIcon,
33+
InfoCircleIcon,
34+
} from "@webstudio-is/icons";
3035
import {
3136
$dragAndDropState,
3237
$editingItemSelector,
@@ -476,6 +481,21 @@ export const NavigatorTree = () => {
476481
onClick: () => $selectedInstanceSelector.set([ROOT_INSTANCE_ID]),
477482
onFocus: () => $selectedInstanceSelector.set([ROOT_INSTANCE_ID]),
478483
}}
484+
action={
485+
<Tooltip
486+
variant="wrapped"
487+
side="bottom"
488+
disableHoverableContent={true}
489+
content={
490+
<Text>
491+
Variables defined on Global Root are available on every
492+
instance on every page.
493+
</Text>
494+
}
495+
>
496+
<InfoCircleIcon />
497+
</Tooltip>
498+
}
479499
>
480500
<TreeNodeLabel prefix={<MetaIcon icon={rootMeta.icon} />}>
481501
{rootMeta.label}

apps/builder/app/builder/features/style-panel/sections/advanced/advanced.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ const AdvancedSearch = ({
157157
itemToString={(item) => item?.label ?? ""}
158158
getItemProps={() => ({ text: "sentence" })}
159159
getDescription={(item) => {
160-
let description = `Unknown CSS property.`;
160+
let description = `Create CSS variable.`;
161161
if (item && item.value in propertyDescriptions) {
162162
description =
163163
propertyDescriptions[
@@ -201,7 +201,7 @@ const AdvancedPropertyLabel = ({ property }: { property: StyleProperty }) => {
201201
}}
202202
content={
203203
<PropertyInfo
204-
title={label}
204+
title={property.startsWith("--") ? "CSS Variable" : label}
205205
description={description}
206206
styles={[styleDecl]}
207207
onReset={() => {

0 commit comments

Comments
 (0)