F
F
faleaksey2019-08-15 13:25:39
Less
faleaksey, 2019-08-15 13:25:39

How to override less styles in create react app?

Hello! At the beginning, I did the following:
1) npx create-react-app test
2) cd test
3) npm run eject
4) Additionally installed less and less-loader
5) Installed the antd library
Next, I need to customize its theme (antd) and for this I I connect the less library file to the main index of the project file and all the windows are loaded! Further below, I connect the file where I want to redefine the variables with colors, but the redefinition does not occur, how can I fix it? I used this antd/customize-theme tutorial and so far I can only customize the theme from the webpack config:import 'antd/dist/antd.less';
import './custom-colors.less';
5d55331c0a0af951081466.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Petr Muhurov, 2019-08-15
@faleaksey

you need to include less in your less file

@import "~antd/dist/antd.less";
// твои переменные для переопределения
// или импорт файла с твоими переменными/стилями

and already import this file into the index

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question