From b1e2c8fd5cb5dfa46bc440a12eafaf56cd844b1c Mon Sep 17 00:00:00 2001 From: Philipp Tanlak Date: Mon, 24 Nov 2025 20:54:57 +0100 Subject: Docs --- node_modules/autoprefixer/lib/hacks/grid-area.js | 34 ++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 node_modules/autoprefixer/lib/hacks/grid-area.js (limited to 'node_modules/autoprefixer/lib/hacks/grid-area.js') diff --git a/node_modules/autoprefixer/lib/hacks/grid-area.js b/node_modules/autoprefixer/lib/hacks/grid-area.js new file mode 100644 index 0000000..0a2d86c --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/grid-area.js @@ -0,0 +1,34 @@ +let Declaration = require('../declaration') +let utils = require('./grid-utils') + +class GridArea extends Declaration { + /** + * Translate grid-area to separate -ms- prefixed properties + */ + insert(decl, prefix, prefixes, result) { + if (prefix !== '-ms-') return super.insert(decl, prefix, prefixes) + + let values = utils.parse(decl) + + let [rowStart, rowSpan] = utils.translate(values, 0, 2) + let [columnStart, columnSpan] = utils.translate(values, 1, 3) + + ;[ + ['grid-row', rowStart], + ['grid-row-span', rowSpan], + ['grid-column', columnStart], + ['grid-column-span', columnSpan] + ].forEach(([prop, value]) => { + utils.insertDecl(decl, prop, value) + }) + + utils.warnTemplateSelectorNotFound(decl, result) + utils.warnIfGridRowColumnExists(decl, result) + + return undefined + } +} + +GridArea.names = ['grid-area'] + +module.exports = GridArea -- cgit v1.2.3