vite-plugin-stylex
vite-plugin-stylex copied to clipboard
Variables not Working
Hi,
It is impossible to use variables because when using variables raises the error:
[plugin:vite-plugin-stylex] /index.stylex.js: Only static values are allowed inside of a stylex.create() call.
My tokens.stylex.js
:
import * as stylex from '@stylexjs/stylex';
export const colors = stylex.defineVars({
primary: { default: '#F8B420' }
});
Using the colors.primary
variable:
import * as stylex from '@stylexjs/stylex';
import { colors } from '../../styles/tokens.stylex';
const styles = stylex.create({
content: {
color: colors.primary,
}
});
export default styles;