Skip to content

Commit a5e931b

Browse files
authored
docs: move figma component guidance into variables docs (#4918)
1 parent b3ed5a8 commit a5e931b

5 files changed

Lines changed: 16 additions & 74 deletions

File tree

apps/www/app/_utils/redirects.server.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,14 @@ const redirects: Redirect[] = [
198198
from: '/no/fundamentals/figma/get-started',
199199
to: '/no/fundamentals/start-here/preparations#figma',
200200
},
201+
{
202+
from: '/en/fundamentals/figma/new-component',
203+
to: '/en/fundamentals/figma/variables-in-figma',
204+
},
205+
{
206+
from: '/no/fundamentals/figma/new-component',
207+
to: '/no/fundamentals/figma/variables-in-figma',
208+
},
201209

202210
{
203211
from: '/en/fundamentals/figma/get-started',

apps/www/app/content/fundamentals/en/figma/new-component.mdx

Lines changed: 0 additions & 34 deletions
This file was deleted.

apps/www/app/content/fundamentals/en/figma/variables-in-figma.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ icon: PaletteIcon
88
published: true
99
order: 30
1010
---
11+
12+
When you create new components in Figma, connect sizes, spacing and colours to the correct variables. This makes the components work as expected across different sizes, and ensures that colours follow the selected theme and work in both light and dark mode.
13+
1114
## Size Variables
1215

1316
Size variables are used to set both spacing and sizes.
@@ -54,8 +57,6 @@ To set up your own color variables, see the guide "[Design System with Custom Th
5457
### What is main and support?
5558
Main and Support are separate modes in Figma that simulate the functionality of data-color from code. They only exist in Figma and allow you to control which colors components should use, based on context.
5659

57-
In Figma without an enterprise license, you can use 4 colors per mode, meaning 8 colors total distributed between main and support.
58-
5960
Read more about how these are used in [modes in Figma](/en/fundamentals/figma/modes-in-figma)
6061

6162
This gives you two important advantages:
@@ -67,4 +68,4 @@ Instead of creating separate components for blue, red, green, etc., the same com
6768
### Colors in Figma Dev Mode
6869
In Figma Dev Mode, colors are displayed in two ways:
6970
- Main / Support: Used for flexible colors, equivalent to [data-color in code](/en/fundamentals/code/colors). You set a mode like main/border-default, and the component inherits the correct color. This makes it easier to reuse components without creating new variants. The modes are cascading - you can set them on page, frame or element.
70-
- Explicit color: Used when a color should always be the same, regardless of mode. The display in Dev Mode will then show a specific variable, just as in code.
71+
- Explicit color: Used when a color should always be the same, regardless of mode. The display in Dev Mode will then show a specific variable, just as in code.

apps/www/app/content/fundamentals/no/figma/new-component.mdx

Lines changed: 0 additions & 34 deletions
This file was deleted.

apps/www/app/content/fundamentals/no/figma/variables-in-figma.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ published: true
99
order: 30
1010
search_terms: figmavariabler, variables
1111
---
12+
13+
Når du lager nye komponenter i Figma, bør du koble størrelser, avstander og farger til riktige variabler. Da vil komponentene fungere som forventet i ulike størrelser, og fargene vil følge valgt theme og fungere i både light og dark mode.
14+
1215
## Size-variabler
1316

1417
Size-variabler brukes til å sette både avstander og størrelser.
@@ -55,8 +58,6 @@ For å sette opp egne fargevariabler se guiden "[Designsystemet med eget tema](/
5558
### Hva er main og support?
5659
Main og Support er egne modes i Figma som simulerer funksjonaliteten til data-color fra kode. De finnes kun i Figma og lar deg styre hvilke farger komponenter skal bruke, basert på kontekst.
5760

58-
I Figma uten enterprise-lisens kan du bruke 4 farger per mode, altså 8 farger totalt fordelt mellom main og support.
59-
6061
Les mer om hvordan disse brukes i [modes i Figma](/no/fundamentals/figma/modes-in-figma)
6162

6263
Dette gir deg to viktige fordeler:
@@ -68,4 +69,4 @@ I stedet for å lage separate komponenter for blå, rød, grønn osv., kan én o
6869
### Farger i Figma Dev Mode
6970
I Figma Dev Mode vises farger på to måter:
7071
- Main / Support: Brukes for fleksible farger, tilsvarende [data-color i kode](/no/fundamentals/code/colors). Du setter en mode som main/border-default, og komponenten arver riktig farge. Dette gjør det enklere å gjenbruke komponenter uten å lage nye varianter. Modusene er cascading - du kan sette dem på page, frame eller element.
71-
- Eksplisitt farge: Brukes når en farge alltid skal være den samme, uansett mode. Visningen i Dev Mode vil da vise en spesifikk variabel, akkurat som i kode.
72+
- Eksplisitt farge: Brukes når en farge alltid skal være den samme, uansett mode. Visningen i Dev Mode vil da vise en spesifikk variabel, akkurat som i kode.

0 commit comments

Comments
 (0)