Github Education
  • Github學生免費服務推薦
  • name.com免費網域申請
  • SendGrid - Email Service
  • Configcat - Global config setting
  • Transloadit - File conversion to cloud storage
  • i18n 管理平台 - lingohub
  • Push Notifications - PushBots
  • BrowserStack
  • Page
  • Ai
    • Stable diffusion
    • Changing Images Backgrounds
  • Copy of Crypto currency games
    • Gods Unchained
  • Digital Ocean
    • How to create cloud instance and access it on Digital Ocean
    • Deploy nodeJs on DigitalOcean droplet using docker
    • Deploy Redis to your local
  • Heroku
    • Heroku Cli
    • How to deploy Hello world to Heroku using docker
    • How to deploy NodeJS application to Heroku using docker
  • APIs
    • Google Geocoding API
    • FourSquare
    • Building APIs with Swagger
  • Util
    • Google Cloud Storage - Object storage
    • Google Search Console
    • Google Sign-in with Angular Front End
    • Google Sign-in with Nodejs Backend
    • Github Package
  • 推薦課程
  • Currently interested in
  • Useful info
  • Become a Front End Web Developer | Udacity
    • 2. CSS, Website Layout, Website Components
      • Lesson 2: CSS
      • Lesson 3: Flexbox
      • Lesson 4: CSS Grid
      • Lesson 5: Creating Responsive Layouts
      • How to use Adobe Design tokens - Spectrum
    • 3. Javascript & The DOM
      • Lesson 1: Syntax
      • Lesson 2: The Document Object Model
      • Lesson 3: Creating Content with JavaScript
      • Lesson 4: Working with Browser Events
  • Some tips
    • Github Blame View
  • Free
    • Openshift(WIP)
Powered by GitBook
On this page
  • My Sample
  • Get Started with Spectrum CSS
  • Tutorial: add a Spectrum button
  • How to add Card component
  • 1. Install the corresponding component
  • 2. Import card css
  • 3. Add component

Was this helpful?

  1. Become a Front End Web Developer | Udacity
  2. 2. CSS, Website Layout, Website Components

How to use Adobe Design tokens - Spectrum

PreviousLesson 5: Creating Responsive LayoutsNext3. Javascript & The DOM

Last updated 5 years ago

Was this helpful?

Official link:

My Sample

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

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

3. Adding Spectrum CSS

<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

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

5. Final html

<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>

You need to import the package in order to use the component and include in the css file declaration.

1. Install the corresponding component

npm install @spectrum-css/card@2.0.0

2. Import card css

@import "./node_modules/@spectrum-css/card/dist/index-vars.css";
<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>

Get Started with Spectrum CSS
How to add Card component
3. Add component
https://spectrum.adobe.com/