versusreality: a blog about coding & stuff.

  • Light or Dark? How to Add Theming to Your React App with JSS and TypeScript

    Light or Dark? How to Add Theming to Your React App with JSS and TypeScript

    As light and dark themes seem to become a mandatory feature, it’s a perfect opportunity to set up theming and to showcase another important React feature: Contexts. In this post, we will explore how to set up custom themes to a Typescript React JS application using JSS. This article assumes you already set up a…

  • Styling React Components Made Easy with JSS: A Comprehensive Guide

    Styling React Components Made Easy with JSS: A Comprehensive Guide

    JSS (or “JavaScript Style Sheets”) is a CSS-in-JS library that allows you to write styles in JavaScript and apply them to your React components. In this article, we’ll explore how JSS can be integrated and used with React JS, including steps on how to install JSS and set it up properly. Installing JSS To get…

  • useBooleanState: A Easy, yet Powerful Custom Hook You Will Love

    useBooleanState: A Easy, yet Powerful Custom Hook You Will Love

    React JS is a popular JavaScript library that allows developers to build complex and interactive user interfaces for web applications. One of the most useful features of React is its hooks system, which enables developers to reuse stateful logic across components. In this article, we will introduce a new custom hook called “useBooleanState”, which simplifies…

  • The Art of Centering: Four Ways to Position a Div with CSS

    The Art of Centering: Four Ways to Position a Div with CSS

    Centering a div vertically and horizontally on a web page is a common task in web design. However, achieving the perfect alignment can be a frustrating experience. In this article, we explore four different techniques for centering a div with CSS. Whether you’re a beginner or an experienced developer, you’re sure to find a technique…

  • C# HSB – RGB vv conversion

    C# HSB – RGB vv conversion

    The Phillips hue lamp can display colors out of two colorsystems: HSB/HSV and CIE 1931 xyY, while xyY consists of two values from 0-1 with floating point that display a point on the color systems color palette. This color system is very hard to display in a canvas cause of the proportions of the xy…