If you want to share values across multiple files, you can create a theme file and import it in your components.
For static-analysis reasons, theme files must follow these rules:
.styles.ts (or .styles.js, or .styles.mjs, etc.)export const colors = {
primary: 'blue',
secondary: 'green',
};
export const spacing = {
small: '8px',
medium: '16px',
large: '32px',
};import { colors, spacing } from '../theme.styles';
export function MyComponent() {
return (
<div css={{ color: colors.primary, padding: spacing.medium }}>
Hello, world!
</div>
)
};