Sha256: 3693215cdbe71fc48cb4013692fae9bec996b9b3c8a8a4e098cba897581e5cca
Contents?: true
Size: 961 Bytes
Versions: 24
Compression:
Stored size: 961 Bytes
Contents
'use strict'; /** @typedef {import('postcss').Rule} Rule */ /** @typedef {import('postcss').AtRule} AtRule */ /** * @param {Rule | AtRule} statement * @param {{ * noRawBefore?: boolean * }} options * * @returns {string} */ module.exports = function (statement, options = {}) { let result = ''; /** @type {Rule | undefined} */ let rule; /*?: postcss$rule*/ /** @type {AtRule | undefined} */ let atRule; /*?: postcss$atRule*/ if (statement.type === 'rule') { rule = statement; } if (statement.type === 'atrule') { atRule = statement; } if (!rule && !atRule) { return result; } const before = statement.raws.before || ''; if (!options.noRawBefore) { result += before; } if (rule) { result += rule.selector; } if (atRule) { result += `@${atRule.name}${atRule.raws.afterName || ''}${atRule.params}`; } const between = statement.raws.between; if (between !== undefined) { result += between; } return result; };
Version data entries
24 entries across 24 versions & 1 rubygems