2.1.0 • Published 7 months ago

@swup/theme v2.1.0

Weekly downloads
355
License
MIT
Repository
github
Last release
7 months ago

Swup Base Theme

Base class for creating swup themes.

Creating a Theme

To create a new theme, use the official swup theme template. It comes with detailed instructions and the required tooling.

Usage

Import the base class and extend your theme from it.

import Theme from '@swup/theme';

export default class ThemeName extends Theme {
  name = 'ThemeName';
  mount() {}
  unmount() {}
}

Development

The official swup command-line interface has commands to help with bundling and linting themes.

npm install --save-dev @swup/cli

Bundling

Bundle the theme for production using microbundle, creating ESM and UMD builds.

# Bundle and transpile code for distribution
swup package:bundle

# Bundle code in watch mode
swup package:dev

Linting & formatting

Lint the theme code using prettier and swup's recommended rules.

# Lint code
swup package:lint

# Fix and format any lint errors
swup package:format

Package info

Check that the themes's package.json file contains the required information for microbundle: input, output, export map, amd name, etc.

# Check package info
swup package:check
2.1.0

7 months ago

2.0.0

10 months ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago