Skip to content

Commit

Permalink
update snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
mellyeliu committed Dec 17, 2024
1 parent c0e6684 commit 60cb435
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -301,15 +301,15 @@ describe('@stylexjs/babel-plugin', () => {
},
});
`,
{ ...defaultOpts, debug: true },
{ debug: true, ...defaultOpts },
).code,
).toMatchInlineSnapshot(`
"import stylex from 'stylex';
export const buttonTheme = {
bgColor: "var(--bgColor-xgck17p)",
bgColorDisabled: "var(--bgColorDisabled-xpegid5)",
cornerRadius: "var(--cornerRadius-xrqfjmn)",
fgColor: "var(--fgColor-x4y59db)",
bgColor: "var(--xgck17p)",
bgColorDisabled: "var(--xpegid5)",
cornerRadius: "var(--xrqfjmn)",
fgColor: "var(--x4y59db)",
__themeName__: "x568ih9"
};"
`);
Expand Down
12 changes: 7 additions & 5 deletions packages/babel-plugin/src/utils/evaluate-path.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,13 @@ function evaluateThemeRef(

const debug = state.traversalState.options.debug;

const varName = debug
? key +
state.traversalState.options.classNamePrefix +
utils.hash(strToHash)
: state.traversalState.options.classNamePrefix + utils.hash(strToHash);
const varName =
debug === true
? key +
'-' +
state.traversalState.options.classNamePrefix +
utils.hash(strToHash)
: state.traversalState.options.classNamePrefix + utils.hash(strToHash);

if (key === '__themeName__') {
return varName;
Expand Down

0 comments on commit 60cb435

Please sign in to comment.