Had to build a new blog and some tools to be able to publish this post with the format I wanted. It took some time but it's finally ready!
📢 the updated DIY guide to build React from scratch
✨ pomb.us/build-your-own-react
A `console` Cheat Sheet: levelup.gitconnected.com/con… (An illustrated tour of the most popular `console` methods for debugging code from the dev tools.)
#tinyCSStrick: to set `width` to the *absolute value of the difference between two custom properties*, use both width and min-width:
min-width: calc((var(--b) - var(--a)));
width: calc((var(--a) - var(--b)));
Example:
codepen.io/thebabydino/pen/o…
ALT Screenshot of code and result. The first example has --a: 50% and --b: 70%. The width formula gives us 20%. The min-width formula gives us -20% and is ignored, defaulting to 0.Computed width is 20% of the parent's width. The second example has --a: 80% and --b: 30%. The width formula gives us -50% and is ignored, defaulting to 0. The min-width formula gives us 50%. Computed width is 50% of the parent's width.
freezing objects is really important, because it allow us to have a high-integrity object that cannot be confused or corrupted and the only way to access the date is trought the methods
#javascript
type fn1 = <T, U>(x: T, y: U) => number;
type fn2<T, U> = (x: T, y: U) => number;
what fn1 has that fn2 doesn't?
my brain is melting!
#javascript#typescript#react#deno#node