# How to use Adobe Design tokens - Spectrum

![](/files/-M5ZTL3bhUQ6JPTue5zF)

Official link：<https://spectrum.adobe.com/>

## My Sample

![](/files/-M5ov-9fmyu9WYGuo1la)

## [Get Started with Spectrum CSS](https://opensource.adobe.com/spectrum-css/get-started/)

### Tutorial: add a Spectrum button

#### 1. Installing Spectrum CSS

```
$ npm install @spectrum-css/vars @spectrum-css/button @spectrum-css/page
```

#### 2. Setting up global variables

```markup
<html class="spectrum spectrum--medium spectrum--light">
```

#### 3. Adding Spectrum CSS

```markup
<head>
  <link rel="stylesheet" href="node_modules/@spectrum-css/vars/dist/spectrum-global.css">
  <link rel="stylesheet" href="node_modules/@spectrum-css/vars/dist/spectrum-medium.css">
  <link rel="stylesheet" href="node_modules/@spectrum-css/vars/dist/spectrum-light.css">
  <link rel="stylesheet" href="node_modules/@spectrum-css/page/dist/index-vars.css">
  <link rel="stylesheet" href="node_modules/@spectrum-css/button/dist/index-vars.css">
</head>
```

#### 4. Add button

```markup
<button class="spectrum-Button spectrum-Button--cta">
  <span class="spectrum-Button-label">Button</span>
</button>
```

#### 5. Final html

```markup
<html class="spectrum spectrum--light spectrum--medium">
  <head>
    <link rel="stylesheet" href="node_modules/@spectrum-css/vars/dist/spectrum-global.css">
    <link rel="stylesheet" href="node_modules/@spectrum-css/vars/dist/spectrum-medium.css">
    <link rel="stylesheet" href="node_modules/@spectrum-css/vars/dist/spectrum-light.css">
    <link rel="stylesheet" href="node_modules/@spectrum-css/page/dist/index-vars.css">
    <link rel="stylesheet" href="node_modules/@spectrum-css/button/dist/index-vars.css">
  </head>
  <body>
    <button class="spectrum-Button spectrum-Button--cta">
      <span class="spectrum-Button-label">Button</span>
    </button>
  </body>
</html>
```

![](/files/-M5ZV-8Jl4ZMoY8sibUz)

## [How to add Card component](https://opensource.adobe.com/spectrum-css/components/card/)

{% hint style="info" %}
You need to import the package in order to use the component and include in the css file declaration.
{% endhint %}

### 1. Install the corresponding component

```markup
npm install @spectrum-css/card@2.0.0
```

### 2. Import card css

```css
@import "./node_modules/@spectrum-css/card/dist/index-vars.css";
```

### [3. Add component](https://opensource.adobe.com/spectrum-css/components/card/)

```markup
<div class="content-card">
    <a href="subpage/post.html">
        <div class="spectrum-Card" tabindex="0" role="figure">
            <div class="spectrum-Card-coverPhoto"
                 style="background-image: url(img/download.jpeg)"></div>
            <div class="spectrum-Card-body">
                <div class="spectrum-Card-header">
                    <div class="spectrum-Card-title">Blog Post 1</div>
                </div>
                <div class="spectrum-Card-description">
                    <p>
                        Consulted he eagerness unfeeling deficient existence of.
                        Calling nothing end fertile for venture way boy.
                        Esteem spirit temper too say adieus who direct esteem.
                    </p>
                    <p>
                        It esteems luckily mr or picture placing drawing no.
                        Apartments frequently or motionless on reasonable projecting expression.
                        Way mrs end gave tall walk fact bed.
                    </p>
                </div>
            </div>
        </div>
    </a>
</div>
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://owen31302.gitbook.io/github-education/become-a-front-end-web-developer-or-udacity-3.-javascript-and-the-dom/2.-css-website-layout-website-components/how-to-use-adobe-design-tokens-spectrum.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
