Loading...
Loading...
Automate Figma UI design. Use this skill when users need to create design drafts, generate components, export resources, or automate design workflows.
npx skill4agent add aaaaqwq/claude-code-skills figma-ui-designconst colors = {
// 品牌色
primary: {
50: '#E3F2FD',
100: '#BBDEFB',
500: '#2196F3', // 主色
700: '#1976D2',
900: '#0D47A1'
},
// 功能色
success: '#4CAF50',
warning: '#FF9800',
error: '#F44336',
info: '#2196F3',
// 中性色
gray: {
50: '#FAFAFA',
100: '#F5F5F5',
500: '#9E9E9E',
900: '#212121'
}
};const typography = {
fontFamily: {
sans: 'Inter, system-ui, sans-serif',
mono: 'Fira Code, monospace'
},
fontSize: {
xs: '12px',
sm: '14px',
base: '16px',
lg: '18px',
xl: '20px',
'2xl': '24px',
'3xl': '30px',
'4xl': '36px'
},
fontWeight: {
normal: 400,
medium: 500,
semibold: 600,
bold: 700
},
lineHeight: {
tight: 1.25,
normal: 1.5,
relaxed: 1.75
}
};const spacing = {
0: '0',
1: '4px',
2: '8px',
3: '12px',
4: '16px',
5: '20px',
6: '24px',
8: '32px',
10: '40px',
12: '48px',
16: '64px',
20: '80px'
};const response = await fetch(
'https://api.figma.com/v1/files/FILE_KEY',
{
headers: {
'X-Figma-Token': 'YOUR_TOKEN'
}
}
);
const data = await response.json();const response = await fetch(
'https://api.figma.com/v1/images/FILE_KEY?ids=NODE_ID&format=png&scale=2',
{
headers: {
'X-Figma-Token': 'YOUR_TOKEN'
}
}
);
const { images } = await response.json();const response = await fetch(
'https://api.figma.com/v1/files/FILE_KEY/styles',
{
headers: {
'X-Figma-Token': 'YOUR_TOKEN'
}
}
);
const { meta } = await response.json();// 从 Figma 设计生成的按钮组件
import React from 'react';
import styled from 'styled-components';
const StyledButton = styled.button`
padding: 12px 24px;
background: #2196F3;
color: white;
border: none;
border-radius: 8px;
font-size: 16px;
font-weight: 600;
cursor: pointer;
transition: all 0.2s;
&:hover {
background: #1976D2;
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}
&:active {
transform: translateY(0);
}
&:disabled {
background: #BDBDBD;
cursor: not-allowed;
}
`;
export const Button = ({ children, ...props }) => {
return <StyledButton {...props}>{children}</StyledButton>;
};:root {
/* Colors */
--color-primary: #2196F3;
--color-primary-dark: #1976D2;
--color-success: #4CAF50;
--color-error: #F44336;
/* Typography */
--font-sans: Inter, system-ui, sans-serif;
--font-size-base: 16px;
--font-weight-normal: 400;
--font-weight-bold: 700;
/* Spacing */
--spacing-1: 4px;
--spacing-2: 8px;
--spacing-4: 16px;
--spacing-8: 32px;
/* Border Radius */
--radius-sm: 4px;
--radius-md: 8px;
--radius-lg: 16px;
/* Shadows */
--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
--shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
--shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}