Break the box nicely
Imagine you have some text on your page and you want to highlight it. So, you add a nice rounded border and a background color. But what happens when the text wraps to multiple lines?
Read vibeGood Vibes Only is owned by me, Jessica, and I work as a freelance front-end developer. I write about things I’ve experimented with and thoughts I like to share, focusing on creativity and CSS.
I have a love for CSS because it’s what makes the web look interesting and fun!
Imagine you have some text on your page and you want to highlight it. So, you add a nice rounded border and a background color. But what happens when the text wraps to multiple lines?
Read vibeOne year goes by so quickly. I know I sound like an old lady saying that, but it’s true. Last week I was back at the conference CSS Day for the third year in a row. This year’s lineup made me even more excited for the weeks ahead.
Read vibeToday’s treat, a cheat sheet. You know the no
(!) expression, you use it all the time to check for falsy values. But what about the no-no
(!!)? This is the one that turns value into a Boolean value.
Last week, I had to look it up for a specific case and thought to myself, “This won’t be the last time I need this.” So here it is, served on a silver plate, the !! cheat sheet.
Value | !!value |
---|---|
true | true |
false | false |
1 | true |
0 | false |
-1 | true |
"" | false |
"good vibes" | true |
null | false |
undefined | false |
NaN | false |
{} | true |
[] | true |
This is really useful when you want a clean true or false, and not just something truthy or falsy.
A friend of mine showed me a quote that I really liked the other week.
Good vibes, great minds!