Less Support for isolation component
How would i use less file in isolation for component in refine antd component?
5 Replies
Hi @dreamer9067. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
I'm sorry, but according to the information provided, Ant Design has removed
less
and now uses and recommends CSS-in-JS
instead. You would need to manually migrate your .less
files to CSS-in-JS
. You can refer to the Ant Design's documentation for less migration (https://ant.design/docs/react/migration-v5#less-migration) for more details.
Please note that customized or swizzled components and .less
files cannot be migrated automatically. You need to migrate them manually.
Here is the source for your reference: Ant Design Migration Guide (https://refine.dev/docs/api-reference/antd/migration-guide/v4-to-v5)
----------------------
Note: you can ask me a follow up question by @ mentioning me again
:speech_balloon:
----------------------<@560876002046377984> kapa.ai is still learning and improving, please let us how it did by reacting below
noble-goldOP•2y ago
@kapa.ai how will i use variables??
Let me check the knowledge base for you. One moment! :books:
----------------------
In the context of Ant Design and Refine, you can use variables in your custom theme. When you create a Refine app with Ant Design, you can choose to use a customized theme. During the setup, you can select "Yes (Custom Variables)" when asked if you want a customized theme. This will allow you to use variables in your theme.
Here's an example of how you might set up your app:
And then select the following options:
After this, you can use variables in your custom theme. For more details, you can refer to the source (https://refine.dev/blog/how-to-add-darkmode-in-ant-design).
----------------------
Note: you can ask me a follow up question by @ mentioning me again
:speech_balloon:
----------------------<@560876002046377984> kapa.ai is still learning and improving, please let us how it did by reacting below