Cool tricks with CSS.
Don't use Margin
Don't use MarginMargin breaks component encapsulation because components impacteverything surrounding them and external to them. It also makesreusability difficult and impacts external components. The stackcomponent, similar to other spacer components, is useful for addingarbitrary spaces internal to and external from different components.THese help define discrete units for space as well which can bestandardized across the application.
CSS can do a lot more than we use it for: it cancount,for one.
Do not blindly copy paste
source In thiscode segment, it's trivial to hide the truth of the text that's beingcopied, thus resulting in a blind paste into terminal being malicious:
One way the author recommends safe pasting is via this command:
alias prepaste='builtin fc -e "vim -c %d -c \"set paste\""'
This opens the line pasted in vim before sending it to the browser,encouraging you to preview and edit it.
transform() operations occur outside of the flexbox algorithm, so thingscan be displayed with flexbox then instantly transformed to their properposition as desired. This also allows us to place an element entirelyout of the document flow! (adding a 'close' button, for example).