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

Updating Figma content to include variables #653

Merged
merged 5 commits into from
Nov 8, 2023
Merged

Conversation

lukasoppermann
Copy link
Contributor

@lukasoppermann lukasoppermann commented Nov 3, 2023

The updated page: https://primer-b6c3695719-26441320.drafts.github.io/guides/figma/getting-started#styles-and-variables

This PR replaces old content about figma styles with everything to know about our variables.


Primer Web provides *light mode* and *dark mode* using figma `variables`. This means you don't need a plugin to change between modes. Simply select any `frame` that uses `variables` or components with `variables`. Select the mode from the dropdown <svg class="svg" xmlns="http://www.w3.org/2000/svg" width="14" height="12" viewBox="0 0 14 12"><path fill="#000" fill-opacity="1" fill-rule="evenodd" d="m5 1.381-4 2.31v4.618l4 2.31 4-2.31V3.691L5 1.38zm5 1.732L5 .227 0 3.113v5.774l5 2.887 5-2.887V3.113zm3 5.196-5 2.887 1 .578 5-2.887V3.113L9 .227 8 .804l5 2.887v4.618zM6 6c0 .552-.448 1-1 1-.552 0-1-.448-1-1 0-.552.448-1 1-1 .552 0 1 .448 1 1z"></path></svg> in the *layer* section in the right sidebar

<ImageBox caption="Switching the variable mode changes all nested items">
Copy link
Contributor

Choose a reason for hiding this comment

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

I love little snippets. 😍

The GIF's quality isn't great, but it might be hard to fix unless we change it to a video. We should see what the team thinks, but I think we've talked about using videos instead of GIFs because they're easier for everyone to use.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 for using a video instead of a GIF here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How can I add an autoplaying video?

Copy link
Contributor

Choose a reason for hiding this comment

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

There's a component called CustomVideoPlayer. It accepts all the same props as the HTML tag, so you can pass autoplay.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great, thanks, used that now. It does not support muted though, right?

</ImageBox>

### Video introduction to primer web variables and modes / themes (github internal)
<a href="https://github.rewatch.com/video/qvryg0cscoowmpyx-figma-primer-web-update-to-figma-variables"><img src="https://thumbnails.rewatch.com/thumbs/qvryg0cscoowmpyx?fm=jpg&p=true&q=100" /></a>
Copy link
Contributor

Choose a reason for hiding this comment

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

Note: Remember that this is only for internal use. As I mentioned before, we need to make it clear that it's for internal purposes. If we decide to make the Figma library public in the future, maybe we could download the video and host it on a public URL?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is publicly available forever already. 😉

Copy link
Contributor

@mperrotti mperrotti left a comment

Choose a reason for hiding this comment

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

These are helpful, but I'm a little confused by the heavy use of backticks to put text in <code> tags.

content/guides/figma/getting-started.mdx Outdated Show resolved Hide resolved

To quickly find a style you can use the search box. E.g. use `accent` to bring up all accent colors.
### Understanding styles
Figma libraries like `Primer Web` provide styles for you to use. In contrast to local styles, styles from a library don't show up in the sidebar. However once you open a selection to choose a `text style` or `shadow` you will see the styles from team libraries as well.
Copy link
Contributor

Choose a reason for hiding this comment

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

Non-blocking nitpick: I'm not sure we want "Primer Web", "text style", or "shadow" in a <code> tag. I think this is intended for things like variable names.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey, so for Primer Web, yes.

For text and shadow styles I am wondering if this is correct as they are specific Figma things. Similar to a variable or a property. WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess that's ok. I personally wouldn't do it that way, but I don't think anybody will be confused 🙂

content/guides/figma/getting-started.mdx Outdated Show resolved Hide resolved
/>
</ImageBox>

<a href="https://help.figma.com/hc/en-us/articles/360039238753-Styles-in-Figma">Learn more about Figma styles <LinkExternalIcon /></a>
#### Scope
Variables in Figma are *"scoped"*, meaning they can only be used in specific situations. Currently Figma offers the following scopes for color variables: `Frame fill`, `Shape fill`, `Text fill` , `Stroke`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Non-blocking nitpick: I'm not sure we need "Frame fill", "Shape fill", etc in <code> blocks. Those just refer to Figma tools.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as above. I do feel it is nice to somehow highlight that those are actual scope values. But maybe a code block is not correct, and we should use a different visual style?

Out of interest, why do you feel code blocks are problematic here?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's just a matter of personal preference. It makes me thinks these are things we have in Primer code. If nobody else gets hung up on these, I think it's totally fine.


Primer Web provides *light mode* and *dark mode* using figma `variables`. This means you don't need a plugin to change between modes. Simply select any `frame` that uses `variables` or components with `variables`. Select the mode from the dropdown <svg class="svg" xmlns="http://www.w3.org/2000/svg" width="14" height="12" viewBox="0 0 14 12"><path fill="#000" fill-opacity="1" fill-rule="evenodd" d="m5 1.381-4 2.31v4.618l4 2.31 4-2.31V3.691L5 1.38zm5 1.732L5 .227 0 3.113v5.774l5 2.887 5-2.887V3.113zm3 5.196-5 2.887 1 .578 5-2.887V3.113L9 .227 8 .804l5 2.887v4.618zM6 6c0 .552-.448 1-1 1-.552 0-1-.448-1-1 0-.552.448-1 1-1 .552 0 1 .448 1 1z"></path></svg> in the *layer* section in the right sidebar

<ImageBox caption="Switching the variable mode changes all nested items">
Copy link
Contributor

Choose a reason for hiding this comment

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

+1 for using a video instead of a GIF here

content/guides/figma/getting-started.mdx Outdated Show resolved Hide resolved
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.

4 participants