Theme

Source: theme.js:40

Marpit theme class.


Static Methods

fromCSS(cssString: string, opts?: Object)

Create a Theme instance from Marpit theme CSS.

Alias: Theme.fromCSS

Parameters

  • cssString (string) — The string of Marpit theme CSS. It requires @theme meta comment.
  • opts (Object, optional)
    • opts.metaType (Object, optional) — An object for defined types for metadata.
    • opts.cssNesting (Object, optional) — Enable support for CSS nesting.

Instance Fields

name: string

The name of theme.

css: string

The content of theme CSS.

meta: Object

Parsed metadata from CSS comments.

importRules: Array.<module:postcss/import/parse~ImportMeta>

Parsed @import rules.

width: string

Slide width. It requires the absolute unit supported in CSS.

height: string

Slide height. It requires the absolute unit supported in CSS.

widthPixel: number

readonly
theme.js:135

The converted width into pixel.

Alias: Theme#widthPixel

heightPixel: number

readonly
theme.js:146

The converted height into pixel.

Alias: Theme#heightPixel