173 TILs and counting...

Stacking context affects z-index

In CSS, the stacking context can impact which elements display on top of each in addition to the z-index. So if you end up in a situation where cranking up the z-index doesn鈥檛 seem to work, the stacking context is likely the issue. I technically learned this a while ago but completely forgot about it until I was just reminded about it by a coworker dealing with this issue. Josh Comeau explains it well in his post on stacking contexts.

GetUnderlyingType

In c# Nullable.GetUnderlyingType(type)will return null if the type is not Nullable<T>. For some reason this is not what I expected.

Use core.hooksPath for shared hooks

Sometime around 2019, git added the core.hooksPath config setting to change the directory where git will look for hooks. This is handy for commiting shared hooks into a repo so you no longer need workarounds like a script to copy them into the default $GIT_DIR/hooks folder or creating symlinks or relying on tools like Husky. This post is a good example of how you can use it.