mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-11-09 14:03:33 +09:00
experimental: add more hints about css variables (#4282)
Ref https://github.com/webstudio-is/webstudio/issues/3399 Added a few hints   
This commit is contained in:
1 parent
11f5450b9a
commit
0e7125511b
2 files changed
+23
-3
No files matched your search
@@ -10,6 +10,7 @@ import {
|
||||
ScrollArea,
|
||||
SmallIconButton,
|
||||
styled,
|
||||
Text,
|
||||
theme,
|
||||
toast,
|
||||
Tooltip,
|
||||
@@ -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,
|
||||
@@ -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}
|
||||
|
||||
@@ -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[
|
||||
@@ -201,7 +201,7 @@ const AdvancedPropertyLabel = ({ property }: { property: StyleProperty }) => {
|
||||
}}
|
||||
content={
|
||||
<PropertyInfo
|
||||
title={label}
|
||||
title={property.startsWith("--") ? "CSS Variable" : label}
|
||||
description={description}
|
||||
styles={[styleDecl]}
|
||||
onReset={() => {
|
||||
|
||||
Reference in new issue
Block a user