Skip to content

Commit

Permalink
feat: adapt to pre-processed styles (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
romgrk authored Sep 19, 2024
1 parent 40da08b commit 3cfa69c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/pigment-css-react/src/processors/styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ export class StyledProcessor extends BaseProcessor {
themeImportIdentifier?: string,
) {
const { themeArgs = {} } = this.options as IOptions;
const styleObj = typeof styleObjOrFn === 'function' ? styleObjOrFn(themeArgs) : styleObjOrFn;
let styleObj = typeof styleObjOrFn === 'function' ? styleObjOrFn(themeArgs) : styleObjOrFn;
if (!styleObj) {
return '';
}
Expand All @@ -619,7 +619,11 @@ export class StyledProcessor extends BaseProcessor {
})),
);
}
delete styleObj.variants;
if (styleObj.isProcessed) {
styleObj = styleObj.style;
} else {
delete styleObj.variants;
}
const res = cssFnValueToVariable({
styleObj,
expressionValue: styleArg,
Expand Down

0 comments on commit 3cfa69c

Please sign in to comment.