lumeland / lume

🔥 Static site generator for Deno 🦕
https://lume.land
MIT License
1.83k stars 83 forks source link

TypeError in Tailwind example #366

Closed GJZwiers closed 1 year ago

GJZwiers commented 1 year ago

Version

v1.15.1

Platform

Windows

What steps will reproduce the bug?

deno run -Ar https://deno.land/x/lume/init.ts

Then, update _config.ts with info from docs:

import lume from "lume/mod.ts";
import tailwindcss from "lume/plugins/tailwindcss.ts";
import postcss from "lume/plugins/postcss.ts";

const site = lume();

site.use(tailwindcss({
    // Extract the classes from HTML and JSX files
    extensions: [".html", ".jsx"],

    // Additional config, like the theme colors and fonts
    config: {
      theme: {
        colors: {
          blue: "#1fb6ff",
          purple: "#7e5bef",
          pink: "#ff49db",
        },
        fontFamily: {
          sans: ["Graphik", "sans-serif"],
          serif: ["Merriweather", "serif"],
        },
      },
    },
  }));
site.use(postcss());

export default site;

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior?

The types in the example should be valid.

What do you see instead?

A TypeError in VS Code Intellisense:

Argument of type '{ extensions: string[]; config: { theme: { colors: { blue: string; purple: string; pink: string; }; fontFamily: { sans: string[]; serif: string[]; }; }; }; }' is not assignable to parameter of type 'Partial<Options>'.
  Object literal may only specify known properties, and 'config' does not exist in type 'Partial<Options>'.deno-ts(2345)

Additional information

The problem can be fixed by changingconfig tooptions.

oscarotero commented 1 year ago

This is a mistake in the documentation site. The correct variable name is options.

oscarotero commented 1 year ago

Fixed in lume.land. Close this.