Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/parsers/atrules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,14 @@ export const parseKeyFrames = (css: Root): void => {
return;
}

const rootFlipped = postcss.parse(atRuleFlippedString);
/* the source could be undefined in certain cases but not during the tests */
/* istanbul ignore next */
const rootFlipped = postcss.parse(
atRuleFlippedString,
{
from: atRule.source?.input?.from
}
);
const atRuleFlipped = rootFlipped.first as AtRule;

const atRuleParams = atRule.params;
Expand Down
9 changes: 8 additions & 1 deletion src/parsers/rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,14 @@ export const parseRules = (
controlDirective.option
) {
const sourceDirectiveValue = getSourceDirectiveValue(controlDirectives);
const root = postcss.parse(controlDirective.option);
/* the source could be undefined in certain cases but not during the tests */
/* istanbul ignore next */
const root = postcss.parse(
controlDirective.option,
{
from: container.source?.input?.from
}
);
if (mode !== Mode.diff) {
root.walkRules((rule: Rule): void => {
addSelectorPrefixes(
Expand Down