Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      CodeSOD: Classic WTF: When it’s OK to GOTO

      June 25, 2025

      Overture Maps launches GERS, a system of unique IDs for global geospatial entities

      June 25, 2025

      Agent Mode for Gemini added to Android Studio

      June 24, 2025

      Google’s Agent2Agent protocol finds new home at the Linux Foundation

      June 23, 2025

      Microsoft is reportedly planning yet more major cuts at Xbox — as early as next week

      June 24, 2025

      Microsoft makes Windows 10 security updates FREE for an extra year — but there’s a catch, and you might not like it

      June 24, 2025

      “Deus Ex” just turned 25 years old and it’s still the best PC game of all time — you only need $2 to play it on practically anything

      June 24, 2025

      Where to buy a Meta Quest 3S Xbox Edition — and why it’s a better bargain than the “normal” Meta Quest 3S

      June 24, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      Generate awesome open graph images with Open Graphy

      June 25, 2025
      Recent

      Generate awesome open graph images with Open Graphy

      June 25, 2025

      Defining a Dedicated Query Builder in Laravel 12 With PHP Attributes

      June 25, 2025

      pxlrbt/filament-activity-log

      June 25, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Linux Jargon Buster: What are Secure Boot & Shim Files?

      June 25, 2025
      Recent

      Linux Jargon Buster: What are Secure Boot & Shim Files?

      June 25, 2025

      Fldigi – modem program for most of the digital modes used by radio amateurs

      June 25, 2025

      Lwan is an experimental, scalable, high performance HTTP server

      June 25, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Tech & Work»Integrating Design And Code With Native Design Tokens In Penpot

    Integrating Design And Code With Native Design Tokens In Penpot

    May 8, 2025

    This article is a sponsored by Penpot

    It’s already the fifth time I’m writing to you about Penpot — and what a journey it continues to be! During this time, Penpot’s presence in the design tools scene has grown strong. In a market that recently felt more turbulent than ever, I’ve always appreciated Penpot for their clear mission and values. They’ve built a design tool that not only delivers great features but is also open-source and developed in active dialogue with the community. Rather than relying on closed formats and gated solutions, Penpot embraces open web standards and commonly used technologies — ensuring it works seamlessly across platforms and integrates naturally with code.

    Their latest release is another great example of that approach. It’s also one of the most impactful. Let me introduce you to design tokens in Penpot.

    Design tokens are an essential building block of modern user interface design and engineering. But so far, designers and engineers have been stuck with third-party plugins and cumbersome APIs to collaborate effectively on design tokens and keep them in sync. It’s high time we had tools and processes that handle this better, and Penpot just made it happen.

    About Design Tokens

    Design tokens can be understood as a framework to document and organize your design decisions. They act as a single source of truth for both designers and engineers and include all the design variables, such as colors, typography, spacing, fills, borders, and shadows.

    The concept of design tokens has grown in popularity alongside the rise of design systems and the increasing demand for broader standards and guidelines in user interface design. Design tokens emerged as a solution for managing increasingly complex systems while keeping them structured, scalable, and extensible.

    The goal of using design tokens is not only to make design decisions more intentional and maintainable but also to make it easier to keep them in sync with code. In the case of larger systems, it is often a one-to-many relationship. Design tokens allow you to keep the values agnostic of their application and scale them across various products and environments.

    Design tokens create a semantic layer between the values, the tools used to define them, and the software that implements them.

    On top of maintainability benefits, a common reason to use design tokens is theming. Keeping your design decisions decoupled means that you can easily swap the values across multiple sets. This allows you to change the appearance of the entire interface with applications ranging from simple light and dark mode implementations to more advanced use cases, such as handling multiple brands or creating fully customizable and adjustable UIs.

    Implementation Challenges

    Until recently, there was no standardized format for maintaining design tokens — it remained a largely theoretical concept, implemented differently across teams and tools. Every design tool or frontend framework has its own approach. Syncing code with design tools was also a major pain point, often requiring third-party plugins and unreliable synchronization solutions.

    However, in recent years, W3C, the international organization responsible for developing open standards and protocols for the web, brought to life a dedicated Design Tokens Community Group with the goal of creating an open standard for products and design tools to handle design tokens. Once this standard gets more widely adopted, it will give us hope for a more predictable and standardized approach to design tokens across the industry.

    To make that happen, work has to be done on two ends, both design and development. Penpot is the very first design tool to implement design tokens in adherence to the standard that the W3C is working on. It also solves the problem of third-party dependencies by offering a native API with all the values served in the official, standardized format.

    Design Tokens In Practice

    To better understand design tokens and how to use them in practice, let’s take a look at an example together. Let’s consider the following user interface of a login screen:

    Imagine we want this design to work in light and dark mode, but also to be themable with several accent colors. It could be that we’re using the same authentication system for websites of several associated brands or several products. We could also want to allow the user to customize the interface to their needs.

    If we want to build a design that works for three accent colors, each with light and dark themes, it gives us six variants in total:

    Designing all of them by hand would not only be tedious but also difficult to maintain. Every change you make would have to be repeated in six places. In the case of six variants, that’s not ideal, but it’s still doable. But what if you also want to support multiple layout options or more brands? It could easily scale into hundreds of combinations, at which point designing them manually would easily get out of hand.

    This is where design tokens come to the rescue. They allow you to effectively maintain all the variants and test all the possible combinations, even hundreds of them, while still building a single design without repetitive work.

    You can start by creating a design in one of the variants before starting to think about the tokens. Having a design already in place might make it easier to plan your tokens’ hierarchy and structure accordingly.

    In this case, I created three components: 2 types of buttons and input, and combined them with text layers into several Flex layouts to build out this screen. If you’d like to first learn more about building components and layouts in Penpot, I would recommend you revisit some of my previous articles:

    • Build Design Systems With Penpot Components
    • Penpot’s CSS Grid Layout: Designing With Superpowers
    • Penpot’s Flex Layout: Building CSS Layouts In A Design Tool

    Now that we have the design ready, we can start creating tokens. You can create your first token by heading to the tokens tab of the left sidebar and clicking the plus button in one of the token categories. Let’s start by creating a color.

    In Penpot, you can reference other tokens in token values by wrapping them in curly brackets. So, if you select “slate.1” as your text color, it will reference the “slate.1” value from any other set that is currently active. With the light set active, the text will be black. And with the dark set active, the text will be white.

    This allows us to switch between brands and modes and test all the possible combinations.

    What’s Next?

    I hope you enjoyed following this example. If you’d like to check out the file presented above before creating your own, you can duplicate it here.

    Colors are only one of many types of tokens available in Penpot. You can also use design tokens to maintain values such as spacing, sizing, layout, and so on. The Penpot team is working on gradually expanding the choice of tokens you can use. All are in accordance with the upcoming design tokens standard.

    The benefits of the native approach to design tokens implemented by Penpot go beyond ease of use and standardization. It also makes the tokens more powerful. For example, they already support math operations using the calc() function you might recognize from CSS. It means you can use math to add, multiply, subtract, etc., token values.

    Once you have the design token in Penpot ready, the next step is to bring it over to your code. Already today, you can export the tokens in JSON format, and soon, an API will be available that connects and imports the tokens directly into your codebase. You can follow Penpot on LinkedIn, BlueSky, and other social media to be the first to hear about the next updates. The team behind Penpot is also planning to make its design tokens implementation even more powerful in the near future with support for gradients, composite tokens (tokens that store multiple values), and more.

    To learn more about design tokens and how to use them, check out the following links:

    • Design Token Overview, Penpot website
    • What are design tokens? A complete guide, Penpot Blog
    • Design Tokens, Penpot Docs
    • Design tokens format module, W3C Community Group Draft Report

    Conclusion

    By adding support for native design tokens, Penpot is making real progress on connecting design and code in meaningful ways. Having all your design variables well documented and organized is one thing. Doing that in a scalable and maintainable way that is based on open standards and is easy to connect with code &mdahs; that’s yet another level.

    The practical benefits are huge: better maintainability, less friction, and easier communication across the whole team. If you’re looking to bring more structure to your design system while keeping designers and engineers in sync, Penpot’s design tokens implementation is definitely worth exploring.

    Tried it already? Share your thoughts! The Penpot team is active on social media, or just share your feedback in the comments section below.

    Source: Read More 

    news
    Facebook Twitter Reddit Email Copy Link
    Previous ArticleWhy AI agents need a protocol like MCP to reach their potential
    Next Article Android Studio Meerkat Feature Drop, Neo4j Aura Graph Analytics, and more software development news

    Related Posts

    Tech & Work

    CodeSOD: Classic WTF: When it’s OK to GOTO

    June 25, 2025
    Tech & Work

    Overture Maps launches GERS, a system of unique IDs for global geospatial entities

    June 25, 2025
    Leave A Reply Cancel Reply

    For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

    Continue Reading

    DOOM: The Dark Ages gets a brand new trailer at Wrestlemania 41

    DOOM: The Dark Ages gets a brand new trailer at Wrestlemania 41

    News & Updates

    CVE-2025-4218 – Handrew BrowserPilot GPTSeleniumAgent Code Injection Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Windows 11 KB5058405 23H2 fixes 24H2 upgrade fails, direct download .msu

    Operating Systems

    Can E Ink tablets really reduce stress? This study and my experience say yes

    News & Updates

    Highlights

    CVE-2025-30011 – SAP SRM Java Applet Information Disclosure

    May 13, 2025

    CVE ID : CVE-2025-30011

    Published : May 13, 2025, 1:15 a.m. | 1 hour, 49 minutes ago

    Description : The Live Auction Cockpit in SAP Supplier Relationship Management (SRM) uses a deprecated java applet component within the affected SRM packages which allows an unauthenticated attacker to send an malicious request to the application, which could disclose the internal version details of the affected system. This vulnerability has low impact on confidentiality, with no effect on integrity and availability of the application.

    Severity: 5.3 | MEDIUM

    Visit the link for more details, such as CVSS details, affected products, timeline, and more…

    I recommend this $320 Lenovo tablet over the iPad for most people. Here’s why

    June 12, 2025

    CVE-2025-4309 – PHPGurukul Art Gallery Management System SQL Injection Vulnerability

    May 6, 2025

    CVE-2021-32601 – Apache Struts Deserialization Vulnerability

    April 25, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.