Oddbean new post about | logout
 #tinyCSStip

#KnowYourDefaults: default direction for a `linear-gradient()` is 180deg (12 o'clock to 6 o'clock).

❌ DON'T
`linear-gradient(to bottom, gold, purple)`

✅ DO
`linear-gradient(gold, purple)`

Both produce the same visual result, but 2nd is easier to read & process, not to mention fewer bytes.

#CSS #CSSgradient #coding #frontend #webDev #webDevelopment

https://files.mastodon.social/media_attachments/files/111/135/598/658/894/248/original/0460ad44f6587194.png 
 @fcf4f651 Not sure if it is easier to understand. Like with all shorthands: yes, easier to read, but only easier to understand if you really know how it works. Since I work in education I almost never use shorthand.