1

Sider component of Ant Design provides property width for setting width in js/JSX. However this width overrides any width specified in css via ant-layout-sider selector. Hence, I was wondering how can I specify width within css instead of js? I know about the !important rule in css, but I try to avoid it, hence I was wondering if there are alternative solutions?

arslancharyev31
  • 1,801
  • 3
  • 21
  • 39

1 Answers1

0

There is nothing wrong with using !important, it was original created as an override.

back in the 19-something, browsers each had their own stylesheets and web authors had this feature for css created, meaning that any attribute with !important would override the browser existing css code, moving on to 2019, it is still a common and acceptable practice.

on another note.

why don't you try using SASS instead of CSS, it is more dynamic and has a lot more options, you can mix and match css and sass files together.

refs:

Dean Van Greunen
  • 5,060
  • 2
  • 14
  • 28