add initial marp implementation with sample content and build configuration
This commit is contained in:
26
node_modules/@marp-team/marpit/lib/postcss/root/replace.js
generated
vendored
Normal file
26
node_modules/@marp-team/marpit/lib/postcss/root/replace.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.rootReplace = exports.default = void 0;
|
||||
var _postcss_plugin = _interopRequireDefault(require("../../helpers/postcss_plugin"));
|
||||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
||||
/** @module */
|
||||
|
||||
/**
|
||||
* Marpit PostCSS root replace plugin.
|
||||
*
|
||||
* Replace `:root` pseudo-class selector into `section`. It can add custom
|
||||
* pseudo class through `pseudoClass` option to make distinguishable from
|
||||
* `section` selector.
|
||||
*
|
||||
* @function rootReplace
|
||||
*/
|
||||
const rootReplace = exports.rootReplace = (0, _postcss_plugin.default)('marpit-postcss-root-replace', ({
|
||||
pseudoClass
|
||||
} = {}) => css => css.walkRules(rule => {
|
||||
// Replace `:root` pseudo-class selectors into `section`
|
||||
rule.selectors = rule.selectors.map(selector => selector.replace(/(^|[\s>+~(])(?:section)?:root\b/g, (_, s) => `${s}section${pseudoClass || ''}`));
|
||||
}));
|
||||
var _default = exports.default = rootReplace;
|
||||
Reference in New Issue
Block a user