Theme

Theme

Marpit theme class.

Constructor

new Theme(name, css)

Create a Theme instance.

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

Source:
Parameters:
Name Type Description
name string

The name of theme.

css string

The content of CSS.

Members

css :string

The content of theme CSS.

Source:
Type:
  • string

height :string

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

Source:
Type:
  • string

(readonly) heightPixel :number

The converted height into pixel.

Source:
Type:
  • number

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

Parsed @import rules.

Source:
Type:

meta :Object

Parsed metadata from CSS comments.

Source:
Type:
  • Object

name :string

The name of theme.

Source:
Type:
  • string

width :string

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

Source:
Type:
  • string

(readonly) widthPixel :number

The converted width into pixel.

Source:
Type:
  • number

Methods

(static) fromCSS(cssString)

Create a Theme instance from Marpit theme CSS.

Source:
Parameters:
Name Type Description
cssString string

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