Skip to content

Commit

Permalink
Update figma plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Thunear committed Jun 10, 2024
1 parent 1a3f169 commit 49586a6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
6 changes: 4 additions & 2 deletions plugins/figma-sync/manifest.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"name": "Designsystemet (beta)",
"id": "1222852692367737510",
"id": "1382044395533039221",
"api": "1.0.0",
"main": "dist/plugin.js",
"ui": "dist/index.html",
"capabilities": [],
"enableProposedApi": false,
"editorType": ["figma"]
"editorType": ["figma"],
"documentAccess": "dynamic-page",
"networkAccess": { "allowedDomains": ["none"] }
}
2 changes: 1 addition & 1 deletion plugins/figma-sync/src/plugin/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */

figma.showUI(__html__, { width: 600, height: 575 });
figma.showUI(__html__, { width: 590, height: 575 });

function hexToRgb(hex: string) {
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
Expand Down
2 changes: 1 addition & 1 deletion plugins/figma-sync/src/ui/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ body {

.paragraph {
margin-bottom: 20px;
max-width: 85%;
max-width: 98%;
}

.modes {
Expand Down
16 changes: 11 additions & 5 deletions plugins/figma-sync/src/ui/pages/PageOne/PageOne.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
Textarea,
Button,
Link,
Spinner,
} from '@digdir/designsystemet-react';
import React, { useState } from 'react';

Expand Down Expand Up @@ -58,7 +57,7 @@ function PageOne() {
}

if (!isJsonValid(jsonText) || !isJsonCorrect(jsonText)) {
setErrorText('Ugyldig JSON, prøv å kopier og lim inn på nytt.');
setErrorText('Ugyldig JSON, prøv og kopier og lim inn på nytt.');
setJsonText('');
return;
}
Expand Down Expand Up @@ -92,15 +91,22 @@ function PageOne() {
size='sm'
className='paragraph'
>
Oppdater fargene i Core UI Kit via designsystemet sin temagenerator.
Gå inn på{' '}
Oppdater{' '}
<Link
target='_blank'
href='https://www.figma.com/community/file/1322138390374166141/designsystemet-core-ui-kit'
>
Designsystemet - Core UI Kit
</Link>{' '}
community filen med ditt eget fargetema. Gå til{' '}
<Link
target='_blank'
href='https://theme.designsystemet.no/'
>
theme.designsystemet.no
</Link>{' '}
og lag temaet ditt, velg mode og lim inn JSON i feltet under.
og lag temaet ditt, velg light- eller dark mode og lim inn JSON koden
i feltet under.
</Paragraph>

<ToggleGroup
Expand Down

0 comments on commit 49586a6

Please sign in to comment.