Theme

Marpit theme class.

Create a Theme instance.

You should use Theme.fromCSS unless there is some particular reason.

Members

css :string

The content of theme CSS.

Type:
  • string

height :string

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

Type:
  • string

(readonly) heightPixel :number

The converted height into pixel.

Type:
  • number

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

Parsed @import rules.

meta :Object

Parsed metadata from CSS comments.

Type:
  • Object

name :string

The name of theme.

Type:
  • string

width :string

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

Type:
  • string

(readonly) widthPixel :number

The converted width into pixel.

Type:
  • number

Methods

(static) fromCSS(cssString, optsopt)

Create a Theme instance from Marpit theme CSS.

Parameters:
NameTypeAttributesDescription
cssStringstring

The string of Marpit theme CSS. It requires @theme meta comment.

optsObject<optional>
Properties
NameTypeAttributesDescription
metaTypeObject<optional>

An object for defined types for metadata.

cssNestingObject<optional>

Enable support for CSS nesting.