Hi all,
I can’t seem to be able to retrieve the token values, nor it does any difference on my forge app (JSM)
.
I do have the theme enabled on my CustomUI’s main.tsx
file:
import { view } from '@forge/bridge';
**view.theme.enable();**
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
);
In one of my App components i’ve got the following:
import { token, getTokenValue } from '@atlaskit/tokens';
....
useEffect(() => {
console.log('**color1=', getTokenValue('color.background.accent.orange.subtle'));
console.log('**color1=', token('color.background.accent.orange.subtle'));
console.log('**color2=', getTokenValue('color.text.selected'));
console.log('**color2=', token('color.text.selected'));
}, []);
Output:
itemComponent.tsx:38 **color1=
itemComponent.tsx:39 **color1= var(--ds-background-accent-orange-subtle)
itemComponent.tsx:40 **color2=
itemComponent.tsx:41 **color2= var(--ds-text-selected)
As per the log, I’m not able to retrieve the values of the tokens. This is a forge app sitting in JSM. Could it be that there’s some sort of issue with themes and JSM? Or I’m missing something besides enabling the theme via the view
module?
Any idea why is this not working?
Best,
David