Open lucasbordeau opened 1 week ago
Remove CSS Modules:
.module.css
files in twenty-front
and twenty-ui
.Install Linaria:
npm install @linaria/core @linaria/react
Configure Linaria:
{
"presets": ["@babel/preset-env", "@babel/preset-react"],
"plugins": ["@linaria"]
}
Convert CSS Modules to Linaria:
Example conversion:
// Before (CSS Module)
import styles from './Button.module.css';
const Button = () => (
<button className={styles.button}>Click me</button>
);
// After (Linaria)
import { styled } from '@linaria/react';
const Button = styled.button`
background-color: blue;
color: white;
padding: 10px;
`;
const MyButton = () => (
<Button>Click me</Button>
);
Update Imports and Styles:
twenty-front
and twenty-ui
are updated to use Linaria for styling.Refactor Theme Assets:
/packages/twenty-front/src/modules/ui/theme/assets
to use Linaria for styling.css
and styled
functions.Update Storybook Stories:
/packages/twenty-front/src/modules/ui/input/components/__stories__
and other directories are updated to reflect the changes from CSS modules to Linaria.Commit Changes:
refactor: replace CSS modules with Linaria in twenty-front and twenty-ui
./packages/twenty-front/src/index.css /packages/twenty-front/src/modules/ui/theme/assets /packages/twenty-front/src/modules/ui/input/components/stories /packages/twenty-front/src/modules/ui/navigation/link /packages/twenty-front/src/modules/ui/display/color /packages/twenty-front/src/modules/ui/display/tag /packages/twenty-front/src/modules/ui/layout /packages/twenty-front/src/modules/ui/navigation /packages/twenty-front/src/modules/ui/navigation/link/components /packages/twenty-front/src/modules/ui/display/color/components
Scope & Context
CSS Modules in twenty-front and twenty-ui due to tests during performance optimization.
Technical inputs
Remove CSS modules and associated logic in twenty-front and twenty-ui and replace by Linaria.