designtokens

package
v0.9.16 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Copyright © 2025 Benny Powers <web@bennypowers.com>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MergeDesignTokensToModule added in v0.1.12

func MergeDesignTokensToModule(module *M.Module, designTokens types.DesignTokens)

func NewLoader added in v0.4.6

func NewLoader() types.DesignTokensLoader

NewLoader creates a new design tokens loader

Types

type DesignTokens

type DesignTokens struct {
	// contains filtered or unexported fields
}

DesignTokens provides access to design tokens by name.

func LoadDesignTokens

func LoadDesignTokens(ctx types.WorkspaceContext) (*DesignTokens, error)

LoadDesignTokens loads tokens from a path or Deno-style specifier and returns a DesignTokens struct. The prefix is prepended to all token names on load. Configuration is loaded from: 1. CEM config (generate.designTokens.prefix, generate.designTokens.spec) - highest priority 2. Asimonim config (.config/design-tokens.{yaml,json}) - fallback for prefix/groupMarkers

func (*DesignTokens) Get

func (dt *DesignTokens) Get(name string) (*token.Token, bool)

Get returns the Token for the given name, prepending the prefix if it's not present.

type Loader added in v0.4.6

type Loader struct{}

Loader implements the types.DesignTokensLoader interface

func (*Loader) Load added in v0.4.6

Load implements types.DesignTokensLoader.Load

Jump to

Keyboard shortcuts

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