Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Token not found #1

Open
zangetsu02 opened this issue May 19, 2024 · 0 comments
Open

Token not found #1

zangetsu02 opened this issue May 19, 2024 · 0 comments

Comments

@zangetsu02
Copy link

Hi,

I am trying to develop a Nuxt theme, and I'm having trouble with this extension as it cannot read the tokens I have defined.

image

tokens.config.ts

import { defineTheme } from '@pinceau/theme'

export default defineTheme({
  nuxtDocsMaker: {
    $schema: {
      title: 'All the configurable tokens from Nuxt Docs Maker.',
      tags: [
        '@studio-icon carbon:blog'
      ]
    },
    header: {
      height: '64px',
    },
    font: {
      primary: 'Nunito, "Nunito Fallback: Arial", sans-serif, ui-sans-serif, system-ui, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji; ',
    },
    border: '#262626',
    color: {
      black: '#171717',
      white: '#FFFFFF',
      primary: {
        50: '#EAF6F2',
        100: '#D2ECE2',
        200: '#A8DBC6',
        300: '#7DC9A9',
        400: '#58B98F',
        500: '#539F80', // Base color
        600: '#44816A',
        700: '#356253',
        800: '#26443D',
        900: '#172824',
      },

    },

    space: {
      0: '0px',
      1: '0.25rem',
      2: '0.5rem',
      3: '0.75rem',
      4: '1rem',
      5: '1.25rem',
      6: '1.5rem',
      7: '1.75rem',
      8: '2rem',
      9: '2.25rem',
      10: '2.5rem',
      11: '2.75rem',
      12: '3rem',
      14: '3.5rem',
      16: '4rem',
      20: '5rem',
      24: '6rem',
      28: '7rem',
      32: '8rem',
      36: '9rem',
      40: '10rem',
      44: '11rem',
      48: '12rem',
      52: '13rem',
      56: '14rem',
      60: '15rem',
      64: '16rem',
      72: '18rem',
      80: '20rem',
      96: '24rem',
      px: '1px',
      rem: {
        125: '0.125rem',
        375: '0.375rem',
        625: '0.625rem',
        875: '0.875rem',
      },
    },
  },

})

Nuxt config

import { createResolver } from '@nuxt/kit'

const { resolve } = createResolver(import.meta.url)

// https://v3.nuxtjs.org/api/configuration/nuxt.config
export default defineNuxtConfig({
  pages: true,
  modules: [
    // https://nuxt.studio
    '@nuxthq/studio',
    // https://content.nuxtjs.org
    '@nuxt/content',
    // https://pinceau.dev
    'pinceau/nuxt',
    '@nuxt/eslint',
  ],
  eslint: {
    config: {
      standalone: false,
    },
  },
  components: [
    { path: resolve('./components'), global: true },
    { path: resolve('./components/app'), global: true },
    { path: resolve('./components/content'), global: true },
  ],
  content: {
    documentDriven: true,
  },
  pinceau: {
    studio: true,
  },
  typescript: {
    includeWorkspace: true,
  },
  nitro: {
    prerender: {
      ignore: ['/__pinceau_tokens_config.json', '/__pinceau_tokens_schema.json'],
    },
  },
})

package.json

{
  "name": "my-theme",
  "type": "module",
  "version": "0.0.1",
  "main": "./nuxt.config.ts",
  "files": [
    "app.vue",
    "components",
    "layouts",
    "nuxt.config.ts",
    "tokens.config"
  ],
  "scripts": {
    "dev": "nuxi dev .starters/default",
    "build": "nuxi build .starters/default",
    "generate": "nuxi generate .starters/default",
    "preview": "nuxi preview .starters/default",
    "prepare": "nuxi prepare && nuxi prepare .starters/default",
    "lint": "eslint .",
    "lint:fix": "eslint . --fix"
  },
  "dependencies": {
    "@nuxt/content": "^2.6.0",
    "@nuxthq/studio": "^0.13.2",
    "@pinceau/nuxt": "^1.0.0-beta.29",
    "pinceau": "^0.20.1"
  },
  "devDependencies": {
    "@antfu/eslint-config": "^2.18.1",
    "@nuxt/eslint": "^0.3.12",
    "eslint": "^9.3.0",
    "eslint-plugin-format": "^0.1.1",
    "nuxt": "^3.5.2",
    "typescript": "^5.1.3"
  },
  "pnpm": {
    "peerDependencyRules": {
      "allowedVersions": {
        "axios": "0.25.0",
        "vite": "*"
      },
      "ignoreMissing": [
        "postcss",
        "postcss-*",
        "webpack",
        "axios",
        "vite"
      ]
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant