netoum

netoum

Designex - Mix tasks for installing and invoking designex via the stand-alone designex cli

Designex is a cli tool that helps you get started with Design tokens.

Get easily started with design tokens using Designex CLI. Features a wide range of templates, pre-built configurations, and live reloading for seamless design system integration.

The Elixir library allows you to run Design CLI without the need for Nodejs similar to Tailwind Elixir

  • :rocket: Quick Start - Run Designex Setup to setup ready-to-use token templates and get your project running in seconds.
  • :hammer: Easy Build - Use Designex Build to convert your tokens into platform-ready formats.
  • :eyes: Live Updates - Use Designex Build Watch to see changes instantly while you work.

The elixir librairy is available on:


Examples with Phoenix, Tailwind v3 and v4.

Design CLI documention:

The Cli is build with Oclif. A great and efficient Cli framework, check it out.

Templates:

Depending on the template selected it will use the following dependencies:

Tailwind v4

This templates follows the latest setup of [Tailwind v4] (https://tailwindcss.com).
It will generate Tailwind v4 CSS files to import into your main css assets.

You can choose from style dictionary or tokens studio format.
If you are using the free version of Tokens Studio you must select single file.

  • tailwind/v4/tokens-studio/single
  • tailwind/v4/tokens-studio/multi
  • tailwind/v4/style-dictionary

Tailwind v3

This templates follows the legacy setup of [Tailwind v3] (https://tailwindcss.com).
It will generate Tailwind v3 JS files to import into your Tailwind Config file.
You can choose from tokens studio single and multi format.
If you are using the free version of Tokens Studio you must select single file.

  • tailwind/v3/tokens-studio/single
  • tailwind/v3/tokens-studio/multi

Shadcn

This templates follows the latest setup of [Shadcn] (Introduction - shadcn/ui).
It will generate Tailwind v3 JS files to import into your Tailwind Config file.
You must also add the generate CSS files for the default and dark mode.
The colors are converted to hsl as advised by Shadcn
You can choose from style dictionary or tokens studio format.
If you are using the free version of Tokens Studio you must select single file.

  • shadcn/tokens-studio/single
  • shadcn/tokens-studio/multi
  • shadcn/style-dictionary
// Tailwind Config
  theme: {
    extend: {
      textColor: require("./build/shadcn/textColor.js"),
      colors: require("./build/shadcn/colors.js"),
      backgroundColor: require("./build/shadcn/backgroundColor.js")
    }

Shadcn Css

// CSS Import


@import "../build/css/shadcn.css";
@import "../build/css/shadcn/modes/light.css";

Material

This templates is an export of the Material 3 Design Kit Figma file and the Material Theme Builder Figma Plugin
You can choose from style dictionary or tokens studio format.
If you are using the free version of Tokens Studio you must select single file.

  • material/tokens-studio/single
  • material/tokens-studio/multi
  • material/style-dictionary

Mozilla

This templates is an export of the legacy Mozilla Design Tokens
You can choose from tokens studio single and multi format.
If you are using the free version of Tokens Studio you must select single file.

  • mozilla/tokens-studio/single
  • mozilla/tokens-studio/multi

Most Liked

mindok

mindok

Thanks! I had the same question.

I think there are quite a few grey-hairs in the Elixir community (myself included) who prefer doing almost anything else over tinkering with CSS, so it’s worth taking the time to explain the problem context and the problem your library solves.

Welcome to the community BTW, and thanks for your work on this library.

Exadra37

Exadra37

I should have made my question a little more specific and clear.

To be clear my question was made to make you realise that your topic doesn’t address users that have no clue what are design tokens, thus no idea what this is useful for. I know we can google it, but as someone that worked before as a Developer Advocate I would recommend you to be more specific in your promotion of your package to help increase it’s adoption among people unaware of what are design tokens.

dimitarvp

dimitarvp

…what even are “design tokens”?

netoum

netoum

@Exadra37 @dimitarvp Thank you for your questions and advises.
We assumed that Design Tokens were well know from the developer and designer community however even the most experimented of us lack knowledge about it.

What Are Design Tokens?

Design tokens are the smallest building blocks of a design system, storing design decisions such as colors, typography, spacing, shadows, and more in a structured, reusable format. They ensure consistency across different platforms and can be dynamically updated.

Core Idea of Design Tokens

  • Platform-Agnostic: Instead of hardcoding values in CSS, Swift, or Android XML, design tokens store values in a structured format like JSON.
  • Scalability: Tokens allow design changes to be applied globally across a system.
  • Automation & Theming: Design tokens enable dynamic themes and dark/light mode transitions.
  • Bridging Design & Code: They create a single source of truth between designers and developers.

History & Evolution of Design Tokens

  1. Early Days (Pre-2014)
  • Before tokens, design values were manually managed in stylesheets or hardcoded in codebases.
  • Design systems existed but were often static and difficult to maintain.
  1. Salesforce & Lightning Design System (2014-2016)
  • Salesforce popularized the term “design tokens” in their Lightning Design System (2014).
  • The goal was to create a consistent experience across platforms (Web, iOS, Android).
  • Tokens were first stored in SCSS variables, later transitioning to JSON for platform-agnostic usage.
  1. Adoption by the Industry (2017-2019)
  • Companies like Adobe, IBM, Google, Microsoft adopted tokens in their design systems.
  • Style Dictionary (by Amazon) was released, offering a way to export tokens into different formats (CSS, Android, iOS, JSON).
  • The rise of Figma & design automation tools further accelerated adoption.
  1. Figma Tokens & Automation (2020-Present)
  • Figma Tokens Plugin introduced a way to manage tokens directly inside Figma, enabling live sync between design tools and codebases.
  • Tokens Studio (formerly Figma Tokens) extended this to support multi-theme, aliases, and mode-based design tokens.
  • Open Source Standardization: W3C, Token CSS, and Design Token Community Groups are working on defining a standard.

How Are Design Tokens Used?

  • In Design Tools: Defined in tools like Figma, Sketch, or Adobe XD.
  • In Code: Exported via JSON, transformed using tools like Style Dictionary into platform-specific formats.
  • For Theming: Different themes (light/dark, brand variations) can be handled dynamically.

Example of Design Tokens (JSON Format)

{
  "color": {
    "primary": { "value": "#ff5733", "type": "color" },
    "background": { "value": "#ffffff", "type": "color" }
  },
  "typography": {
    "fontSize": { "value": "16px", "type": "size" }
  },
  "spacing": {
    "small": { "value": "8px", "type": "size" }
  }
}

This JSON can be transformed into:

  • CSS Variables: --color-primary: #ff5733;
  • iOS Variables: "primary": UIColor(red: 1.0, green: 0.34, blue: 0.2, alpha: 1.0)
  • Android XML: <color name="primary">#ff5733</color>

Conclusion

Design tokens help streamline the connection between design and development, ensuring consistency and scalability. Their adoption continues to grow, with tools and frameworks evolving to support them natively.

Readings

Here are some import links
Style Dictionary
W3C Design Tokens Specification
Tokens Studio (Figma Plugin)

We hope this brings more clarity and understanding of Design Tokens.

Exadra37

Exadra37

What is DesignX?

Where Next?

Popular in Libraries Top

Crowdhailer
Raxx is an alternative to Plug and is inspired by projects such as Rack(Ruby) and Ring(Clojure). 1.0-rc.1 is now available. To use it re...
New
treble37
Just looking for a little feedback on a tiny helper library I built - Sometimes I find the need to convert maps with atom keys to maps...
New
jakub-zawislak
Hi everyone, I’m coming from the Symfony (PHP) framework. I like Phoenix, but it has a one thing that was build much better in the Symfo...
New
blatyo
https://www.conduitframework.com/ The best overview for how things are tied together is this presentation. Modules and functions are pre...
New
asiniy
Hey there! I wrote a download elixir package which does exactly what its name about - an easy way to download files. I saw solutions ...
New
MRdotB
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New
martinthenth
Hello everybody :wave: Recently, some of my colleagues talked about database ids and uuids and their problems, and I remembered the pain...
New
tmbb
PhoenixWS - Websockets over Phoenix Channels Source code on Github here: https://github.com/tmbb/phoenix_ws Phoenix channels are a great...
New
Qqwy
While not as prevalent as in imperative languages, arrays (collections with efficient random element access) are still very useful in Eli...
New
KallDrexx
For a good number of months I've been working on creating a very basic RTMP live video streaming server. Now that I have a very, very ba...
New

Other popular topics Top

yurko
Here are few pieces of (common) Linux knowledge that we use for reasonably small one server apps. We use Ubuntu but this should work for ...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 45766 226
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 49522 488
New
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New

Sub Categories:

We're in Beta

About us Mission Statement