Giter Club home page Giter Club logo

Comments (1)

greptile-apps avatar greptile-apps commented on August 18, 2024

Steps to Remove CSS Modules and Replace with Linaria

  1. Remove CSS Modules:

    • Delete all .module.css files in twenty-front and twenty-ui.
    • Remove any imports of CSS modules in JavaScript/TypeScript files.
  2. Install Linaria:

    • Add Linaria to your project dependencies:
      npm install @linaria/core @linaria/react
  3. Configure Linaria:

    • Update your Babel configuration to include Linaria plugin:
      {
        "presets": ["@babel/preset-env", "@babel/preset-react"],
        "plugins": ["@linaria"]
      }
  4. Convert CSS Modules to Linaria:

    • Replace CSS module usage with Linaria styled components.
    • 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>
      );
  5. Update Imports and Styles:

    • Ensure all components in twenty-front and twenty-ui are updated to use Linaria for styling.
    • Check for any remaining CSS module references and replace them with Linaria styled components.
  6. Refactor Theme Assets:

    • Update any theme-related assets in /packages/twenty-front/src/modules/ui/theme/assets to use Linaria for styling.
    • Ensure variables and styles are defined using Linaria's css and styled functions.
  7. Update Storybook Stories:

    • Ensure all Storybook stories in /packages/twenty-front/src/modules/ui/input/components/__stories__ and other directories are updated to reflect the changes from CSS modules to Linaria.
  8. Commit Changes:

    • Commit the changes with a meaningful commit message, e.g., refactor: replace CSS modules with Linaria in twenty-front and twenty-ui.

References

/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

Ask Greptile

from twenty.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.