Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change CSS attributes in React?

Tags:

reactjs

I've imported a few different components in my React project, and most of them have .css files with preset style settings. For the most part, I've been manually changing the CSS files to suit my needs. Is there a way to change the CSS directly from React? That is, is there similar to jquery where i can find the corresponding classes and change the attributes?

like image 775
vgoklani Avatar asked Jan 25 '16 21:01

vgoklani


1 Answers

For small changes here and there you can use React Inline Styles.

If you want to modify more things, you can create css/less/scss files that are local to your components and override the styles of imported components there. Here's a good example. Make sure to check the webpack configs that make that work.

like image 162
Dmitry Shvedov Avatar answered Oct 15 '22 12:10

Dmitry Shvedov