Author: Peter van Nes

css-modules theme provider

For a recently started React project I chose for css-modules over Styled Components. It is not so much whether one is better than the other, but which one suits the purpose of your project better. Where CSS Modules is a CSS-preprocessor and Styled Components a Javascript Framework Component. Can’t decide ? I found this a good 11 minute read to make my decision A requirement for this project is that it can easily, preferably dynamically, alter color patterns. Initially, switching from a dark theme to a light theme will suffice. But the possibility to switch between multiple color schemes would be nice. I chose for css-modules, and therefore my DuckDuck.go search for a convenient package began. I found some packages, and solutions. But in summary, I felt the solution should be easier. Also, I would like to be able to insert the theming solution into an existing project without too much effort. So here it goes… Consider the following React component which shows a very fancy text with a apple green background. I would be nice if the background color of the component could be changed dynamically. E.g. by using a css variable for the background and changing the value…

Hello World!

In 2008 i started my blog here. At that time mostly about Siebel, later after acquisition by Oracle about other Oracle products like BI Publisher and Weblogic. In 2013, because I was focussed on Oracle products, I started a new blog: reddipped.com. Nothing is forever, so I started a new path as a front- and backend developer some time ago. My Oracle-oriented blog was therefore not suitable for any new not Oracle related posts. The now dated posts on this blog have therefore been archived and can still be found here. For the rest, I will start again with a clean blog for more contemporary topics.