E
E
Egor2017-05-22 07:48:10
css
Egor, 2017-05-22 07:48:10

Is using important in a new React project normal?

Joined the newly formed React development team. They started a new project (on react naturally) from scratch about 2-3 weeks ago. Actually I look at the code and I see about 15-20 uses of !important in CSS. To be more precise, SCSS.
Actually the question is: is this generally normal or was this code written by a curmudgeon?
And the second question.
How normal is it to start a new React project with SCSS and BEM notation in 2K17? Incomprehensible because this is not pure BEM, but some kind of free naming of classes through hyphens. It is not easier to at least take css-modules into webpack, so that he would prescribe the names of the classes himself. Or generally use inline styles. Or something exotic and fun like styled-components?
I have practically no development experience in a team, and large projects can also be said. Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nik, 2017-05-22
@KoiLVeD

Unfortunately, this was written by a krivoruchka) important is used only in extreme cases, when something urgently needs to be fixed, but there is no time to understand someone else's code. and no other excuses)
React + scss is perfectly fine, and it’s better to use css-moduls of course, you won’t have to bother with BEM.

K
KnightForce, 2017-05-22
@KnightForce

Your path in Webpack lies in order not to get lost in dependencies and produce final files without a ton of connected modules.)
There is such a thing in css that the class is lower in priority than id.
#id .class will be higher than just
.class - and the longer the chain, the greater the precedence.)
Try a bigger chain.)
Because important is a hard hint.)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question