UNPKG

@marp-team/marpit

Version:

The skinny framework for creating slide deck from Markdown

37 lines (31 loc) 912 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _postcss = _interopRequireDefault(require("postcss")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** @module */ /** * Marpit PostCSS section size plugin. * * Parse width and height declartaion on section selector. * * @alias module:postcss/section_size */ const plugin = _postcss.default.plugin('marpit-postcss-section-size', () => (css, ret) => { ret.marpitSectionSize = ret.marpitSectionSize || {}; css.walkRules(rule => { if (rule.selectors.includes('section')) { rule.walkDecls(/^(width|height)$/, decl => { const { prop } = decl; const value = decl.value.trim(); ret.marpitSectionSize[prop] = value; }); } }); }); var _default = plugin; exports.default = _default;