0.1.13 • Published 8 months ago

@playbooks/theme v0.1.13

Weekly downloads
-
License
ISC
Repository
-
Last release
8 months ago

Overview

This is the default theme for Playbooks projects. It is designed to be used in conjunction with the @playbooks/ui library.

Prerequisites

  • Node
  • @playbooks/ui
  • tailwind v4

Installation

npm install @playbooks/theme

Usage

Import this project in your _app.tsx file and then pass to the InterfaceProvider context as shown.

# _app.tsx

import { AppProps } from 'next/app';
import * as theme from '@playbooks/theme';
import '@playbooks/ui/styles.css';
import { InterfaceProvider } from '@playbooks/ui/context';

const App = ({ Component, pageProps }: AppProps) => {

	// Render
	return (
		<InterfaceProvider meta={meta} theme={theme}>
      <Component ssr={pageProps} {...contexts} />
		</InterfaceProvider>
	);
};

export default App;

Then, make sure to base stylesheet to look like the following:

@import 'tailwindcss';
@import '@playbooks/ui/styles.css';

@source "../../node_modules/@playbooks/theme*.js";
@source "../../node_modules/@playbooks/ui*.js";

@theme {
	--font-primary: Plus Jakarta Sans, sans-serif;
	--font-secondary: Inter, sans-serif;
	--font-accent: Courier, monospace;
}

@theme inline {
  --color-primary: var(--color-blue-500);
  --color-secondary: var(--color-cyan-500);
  --color-accent: var(--color-indigo-500);
}

Development

This project is designed for development using the yalc library.

  • npm run dev
  • switch to project
  • npx yalc add @playbooks/theme
  • You may need to restart your application server
  • After that, this library will hot reload into the consuming application

Scripts

We've included a couple of helpful scripts for faster development.

  • npm run deploy -- 'commit message'
  • npm run publish -- 'commit message' [major|minor|patch]

Husky

  • Husky configuration is setup to lint and format the repo on every commit
  • Edit the .husky/pre-commit file to change your settings

Author

Notes

To see this library in action, checkout the following projects:

0.1.13

8 months ago

0.1.12

8 months ago

0.1.11

8 months ago

0.1.10

8 months ago

0.1.9

8 months ago

0.1.8

8 months ago

0.1.7

8 months ago

0.1.6

8 months ago

0.1.5

8 months ago

0.1.4

8 months ago

0.1.3

8 months ago

0.1.2

8 months ago

0.1.1

8 months ago

0.1.0

8 months ago

0.0.10

8 months ago

0.0.9

8 months ago

0.0.8

8 months ago

0.0.7

8 months ago

0.0.6

8 months ago

0.0.5

8 months ago

0.0.4

8 months ago

0.0.3

8 months ago