Skip to content

Commit

Permalink
Integrate Input#document
Browse files Browse the repository at this point in the history
  • Loading branch information
romainmenke committed Jan 15, 2025
1 parent 0028a87 commit 366b060
Show file tree
Hide file tree
Showing 2 changed files with 1,743 additions and 6,694 deletions.
8 changes: 6 additions & 2 deletions lib/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ const { parseJs } = require('./parseJs');
module.exports = function parse(css, opts) {
let inputCode = typeof css === 'string' ? css : css.toString();

let options = opts ?? {};

options.document = inputCode;

let document = new postcss.Document({
source: {
input: new postcss.Input(inputCode, opts),
input: new postcss.Input(inputCode, options),
start: { offset: 0, line: 1, column: 1 },
},
});
Expand All @@ -27,7 +31,7 @@ module.exports = function parse(css, opts) {
/** @type {postcss.Root} */
let parsedNode;

let input = new postcss.Input(node.css, opts);
let input = new postcss.Input(node.css, options);

let interpolationsRanges = node.interpolationRanges.map((range) => {
return {
Expand Down
Loading

0 comments on commit 366b060

Please sign in to comment.