Overwriting Styles in Material Ui Css

This was a tricky problem that I took a while to wrap my head around and implement. Basically, I needed to change the font and background-color of a material UI button, when I hover over it. The standard documentation was mainly to use className to change - which did nothing to the selected property. Because the specificity is lower. Using external CSS also fails due to lower specificity. After fiddling around, I realized that this is the only way: ...

September 7, 2021 · 1 min · Lei

Css Variables

Whilst I was scrolling through Reddit, I noticed this line in the css file for the super slick input field above: 1 2 3 4 5 6 7 :root { --main-blue: #90caf9; --main-white: #fff; --main-grey: rgba(255, 255, 255, 0.23); --main-dark-grey: #121212; --main-ease: cubic-bezier(.65,.05,.36,1); } And so I googled what on earth is the :root selector, and what on earth are the –main-blue syntax. What I learned was incredibly useful. ...

August 23, 2021 · 2 min · Lei

Express: Auto Server Refresh Feature

One problem with the simple Express server is that you have to restart the application every time there is a change to the source code to see the changes implemented. By installing nodemon, you have an “auto-refresh upon source code save” feature. Step 0: Go to Express project root. Step 1: Install nodemon npm install --save-dev nodemon Step 2: Add the following line: "dev": "nodemon index.js" to package.json 1 2 3 4 5 "scripts": { "start": "node index.js", "dev": "nodemon index.js", "test": "echo \"Error..."" }

August 16, 2021 · 1 min · Lei

Steps for creating an Express Server

It is really simple creating an express API server. All you have to do is basically requiring express, creating/importing the JSON data, setting up a route, setting up a listening port, and bam there is API access to your data. Steps for creating an Express API server: Step 1: Importing Express, assigning it to app variable 1 2 const express = require('express') const app = express() Step 2: Creating JSON data ...

August 16, 2021 · 1 min · Lei

Express App.listen

What I’ve found is that if I don’t add the following code to my index.js file, I am not able to run the localhost: 1 2 3 app.listen(PORT, () => { console.log(`Server running on port ${PORT}`) }) The code still runs when you do npm start, but upon end of code, it simply terminates, whereas if you do app.listen, you could inspect the output at a port.

August 16, 2021 · 1 min · Lei

Steps for creating an NPM server

Step 1: npm init in project folder Step 2: Add "start": "node index.js" in package.json, like so: 1 2 3 4 5 6 { "scripts": { "start": "node index.js", "test": "echo \"Error: no test specified\" && exit 1" }, }

August 16, 2021 · 1 min · Lei