Skip to content

Conversation

@szecket
Copy link
Contributor

@szecket szecket commented May 2, 2025

No description provided.

@szecket szecket requested review from NigelBreslaw and tronical May 2, 2025 03:07
@szecket szecket force-pushed the szecket/push-xmylpukmutxp branch 4 times, most recently from 6cd26fb to caad4a3 Compare May 2, 2025 19:05
import { Tabs, TabItem } from '@astrojs/starlight/components';
import LangRefLink from '/src/components/LangRefLink.astro';

## Setting up the Figma Inspector
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps before setting up, there could be an intro section that briefly explains what the problem space is and what our solution roughly entails?

After that, a section that explains how to set up the inspector makes sense.

First of all, find and enable the "Figma to Slint" plugin in the Figma Plugin Manager.
The inspector currently has 2 functions. One is to inspect individual Figma objects for their properties, and the other is to export the variables defined in Figma so they are useable in Slint directly.

## Key Features of Variable Export
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks a little like a "marketing brochure" to me. I suggest to break this down into sections, perhaps with groups?

For example, how we map figma variable types to Slint types is IMO best represented using a table, instead of just one sentence.

We have a similar scenario with the Rust code that we generated from Slint files, and besides an overview explanation, we also provide an example of how the generated code looks like (in structure, not content). Perhaps the same could be used here. ("Suppose the following variables in figma , we generate the following Slint code")

## Naming Conventions & Sanitization

- **Hierarchy:** Figma uses / in variable names (e.g., `radius/small`, `font/body/weight`) to create nested Slint structs.
- **Sanitization:** Collection names, variable names (path segments), and mode names are automatically sanitized:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this section would benefit from examples (after listing the rules).

- **Single File:** Combines all collections into a single `design-tokens.slint` file. This is also the fallback if dependency cycles are detected.
- **README Generation:** Creates a `README.md` file alongside the export, summarizing exported collections, renamed variables, detected circular references, and warnings.

## Usage
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section would greatly benefit from screenshots, I think. We're in the Guide part of our documentation, a visual guide with screenshots would probably work wonders and be a little advertisement :)

@szecket szecket force-pushed the szecket/push-xmylpukmutxp branch from 57bd755 to e1222e2 Compare May 20, 2025 16:06
@szecket szecket force-pushed the szecket/push-xmylpukmutxp branch from a95e2b4 to df90da8 Compare May 20, 2025 17:06
@szecket szecket force-pushed the szecket/push-xmylpukmutxp branch from b2a9229 to 9911bd5 Compare May 20, 2025 17:42
@szecket szecket requested a review from tronical May 20, 2025 18:01
- Names starting with a digit are prefixed with `_` or `m_`.
- Any variable named exactly `mode` at the root of a collection is renamed to `mode-var` in the Slint output to avoid conflicts with the generated scheme `mode` property.

#### Example
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation looks off here :)

Suggested change
#### Example
#### Example

import { ExportType, useInspectorStore } from "./utils/store";
import DialogFrame from "./components/DialogFrame.js";
import { Text, Button, Checkbox, DropdownMenu } from "figma-kit";
import { Button, Checkbox, DropdownMenu, Text } from "figma-kit";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes in this file look unrelated

@szecket szecket merged commit 5df8438 into slint-ui:master May 20, 2025
40 checks passed
@szecket szecket deleted the szecket/push-xmylpukmutxp branch June 3, 2025 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants