0.2.2 • Published 2 years ago

next-themeizer v0.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Next themeizer

Package for adding "Themeizer" ecosystem interaction configuration to your next.js application.

Installation

Using npm:

$ npm install next-themeizer

Using yarn:

$ yarn add next-themeizer

Configuration

OptionRequiredTypeDescription
urltruestringapi url to load and read colors
headersfalseJSON objectan object of headers required for reading from api
revalidatefalsenumberperiod in which to fetch styles (in minutes)

Add configuration to environment variables.

For example, via .env files:

// .env.local
THEMEIZER_OPTIONS={"url":"https://example.com/api/themes","revalidate":0.1,"headers":{"token":"example-token"}}

Add themeizer to your app config:

Base:

const withThemeizer = require('next-themeizer').default;

module.exports = withThemeizer({
    // next.js config
});

With next-compose-plugins:

const withThemeizer = require('next-themeizer').default;
const withPlugins = require('next-compose-plugins');

module.exports = withPlugins([
    [withThemeizer]
], nextConfig);

Usage

More about usage on main package page.

Themeizer ecosystem

  • Figma plugin "Themeizer" - plugin for changing themes in design and publishing them in the cloud;
  • themeizer - package for embedding themes from "Themeizer" Figma plugin at the server level or at build stage;
  • next-themeizer - package for adding "Themeizer" ecosystem interaction configuration to your next.js application;
  • themeizer-cli - a package to automatically replace published colors (as well as linear and radial gradients) in style files with a css variable;
  • stylelint-themeizer - stylelint plugin for "Themeizer" ecosystem.

License

MIT