figo

package module
v0.3.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2025 License: MIT Imports: 11 Imported by: 0

README

Figo

Figma Golang utility lib. This is a tool to help creating HTML and CSS from Figma designs. It does not generate clean HTML or CSS, user input/changes are still necessary for building the desired frontend.

Tokens

Create css variables based on figma tokens. Figma variables can't be converted to css tokens without enterprise account to be able to use the REST API for Variables.

CSS

Export components styles to help frontends creation, it can have repetition depending of how components are built in Figma, use the export as a helper or a guide to accelerate development.

HTML

Export components HTML to help frontends creation, the HTML generated gives a base structure for the component created in Figma.

Run tests
go test github.com/vpaulo/figo/figma

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Figma added in v0.0.2

type Figma struct {
	FILE_KEY string
	API_KEY  string
	Prefix   string // Prefix for components tag
}

func (*Figma) ComponentCSS added in v0.3.0

func (f *Figma) ComponentCSS(component fg.Element) (string, error)

func (*Figma) ComponentHTML added in v0.3.0

func (f *Figma) ComponentHTML(component fg.Element) (string, error)

func (*Figma) GenerateComponentCSS added in v0.3.1

func (f *Figma) GenerateComponentCSS(component fg.Element) (string, error)

func (*Figma) GenerateComponentHTML added in v0.3.1

func (f *Figma) GenerateComponentHTML(component fg.Element) (string, error)

func (*Figma) GenerateComponentsCSS added in v0.3.0

func (f *Figma) GenerateComponentsCSS(components map[string]fg.Element) (string, error)

func (*Figma) GenerateComponentsHTML added in v0.3.0

func (f *Figma) GenerateComponentsHTML(components map[string]fg.Element) (string, error)

func (*Figma) GenerateTokensCSS added in v0.1.0

func (f *Figma) GenerateTokensCSS(tokens map[string]figma.Token) (string, error)

func (*Figma) GetData added in v0.0.2

func (f *Figma) GetData() (figma.File, error)

func (*Figma) GetDataFromFile added in v0.1.0

func (f *Figma) GetDataFromFile(path string) (figma.File, error)

func (*Figma) GetVariablesData added in v0.2.0

func (f *Figma) GetVariablesData() (figma.Variables, error)

func (*Figma) GetVariablesFromFile added in v0.2.0

func (f *Figma) GetVariablesFromFile(path string) (figma.Variables, error)

func (*Figma) Pages added in v0.0.2

func (f *Figma) Pages(file figma.File) []figma.Node

func (*Figma) ParseComponents added in v0.3.0

func (f *Figma) ParseComponents(file figma.File, tokens map[string]figma.Token) map[string]fg.Element

func (*Figma) ParseTokens added in v0.1.0

func (f *Figma) ParseTokens(file figma.File) map[string]figma.Token

func (*Figma) ParseVariables added in v0.2.0

func (f *Figma) ParseVariables(variables figma.Variables) map[string]figma.Token

Directories

Path Synopsis
load_from_api command
load_from_files command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL