Giter Site home page Giter Site logo

material-tokens's Introduction

Material Tokens

Material Design now supports the Design System Package (DSP) for importing and exporting Material Design Tokens within the Material Theme Builder. DSP can be used in designer and developer workflow tools and Material Component libraries. Let’s dive into how you can use Material Tokens (DSP) within the VSCode extension to generate code.

Getting Started

Make sure you have the latest version of VSCode installed on your machine. VSCode is free to download and is open source.

Download VSCode

After VSCode is installed, navigate to the marketplace on the extensions tab and search for Adobe.

alt_text

Download Adobe XD VSCode extension

Click on install and you may have to reopen or reload VSCode. After the extension is successfully installed, you can open Adobe XD by searching for Adobe in the command palette or clicking the “XD” icon in the bottom right.

alt_text

After the plugin opens it should look like the following screenshot.

alt_text

Opening a DSP

Download a customized DSP from the Material Theme Builder or default Material Theme values from this repo and save it to your computer.

Open up the folder in VSCode by either dragging it onto the open window or selecting “Open Folder”.

alt_text

Open the Adobe XD plugin and select “Edit Package” on the bottom left, then select “Select Folder”. There should be a notification on the bottom left that should say “Existing package found…” and click on “Open”.

alt_text

Exploring the DSP

With the DSP opened in the plugin you should see the following screenshot.

alt_text

The Material Tokens (DSP) is made up of a few sections (Light, Dark, Default, Palette, Typography).

Generating Code

After inspecting the DSP you can generate code in the form of tokens to be used in your application.

Select “Start Editing” and then “Finish Editing” to trigger code generation. If it is the first time you are doing it there will be a notification to install Style Dictionary.

alt_text

Select “Install” then you will see another notification asking to export tokens.

alt_text

Select “Export tokens” then you will see a notification asking you to open the folder.

alt_text

Opening the folder you will see the following sub directories.

alt_text

This directory is located in the current directory under a newly generated folder “dist”.

alt_text

Opening up the “variables.css” for example you will see the following flat list of tokens used to theme your application.

alt_text

The “android/colors.xml” should look similar.

alt_text

Using the Material Tokens (DSP) will ensure your styles are shared throughout your designer and developer workflow. Learn more about Material Design Tokens.

material-tokens's People

Contributors

patelutkarsh avatar rodydavis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

material-tokens's Issues

css/elevation.css is incorrect

elevation classes has incorrect values, for example:

.elevation-0 {
  box-shadow: var(--md-sys-elevation-level0);
}

will not work because there is no --md-sys-elevation-level0 defined in the repo.

It makes all the elevation settings to be broken.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.