Responsive type scales with composable CSS utilities
:root { --min-size: 16; --max-size: 16; --viewport-min: 320; --viewport-max: 2400; --container-min: 320; --container-max: 2400; } .h1, .h2, .h3, .h4 { --font-size: calc(var(--min-size) * 1px +...
View ArticleHiding empty elements with CSS :empty and :has()
.item { border-radius: 3px; background-color: #A2CBFA; border: 1px solid #4390E1; box-sizing: border-box; padding: 10px; font-size: 14px; font-weight: 600; color: #fff; flex-grow: 1; flex-basis: 50%;...
View ArticleSelecting previous siblings with CSS :has()
.item { border-radius: 3px; background-color: #A2CBFA; border: 1px solid #4390E1; box-sizing: border-box; width: 20px; height: 20px; margin: 0 20px 20px; box-shadow: 0 2px 2px rgba(0,90,250,0.05), 0...
View ArticleA brief introduction to A/B-testing
A/B-testing is a guiding compass for making product decisions. More technically, it’s a method for quantifying the impact of product variations. The process can’t tell us if one variation is...
View ArticleChaining styles with a JavaScript Proxy
.post-chain-wrapper { border-radius: 50%; padding: 25px; background-color: #000; height: 44px; width: 44px; margin: 0 auto; } .post-chain-svg { max-height: 100%; } One of the delights of working with...
View ArticleSmoother & sharper shadows with layered box-shadows
DefaultSmooth .blog-traditional-shadow-box { background-color: #fff; line-height: 76px; border-radius: 3px; color: #333; margin-right: 15px; display: inline-block; width: 100px; height: 80px;...
View ArticleCheat sheet for moving from jQuery to vanilla JavaScript
.blog-banner-jquery { width: 200px; height: 100px; position: relative; z-index: 3; } .blog-banner-jquery-hole { background-color: rgba(0,0,0,0.3); width: 90px; height: 90px; border-radius: 50%;...
View ArticleBreaking to a new row with flexbox
.flexbox-break-banner-logo { margin-top: 20px; width: 100px; height: 100px; display: inline-block; position: relative; } .flexbox-break-box { background-color: #fff; width: 100%; height: 100%;...
View ArticleCSS masonry with flexbox, :nth-child(), and order
.masonry-banner-logo { width: 100px; height: 100px; display: inline-block; position: relative; } .masonry-box { background-color: #fff; width: 100%; height: 100%; position: absolute; top: 0; left: 0;...
View ArticleCommon CSS Flexbox Layout Patterns with Example Code
.flexbox-banner-logo { width: 100px; height: 100px; display: inline-block; position: relative; } .flexbox-box { background-color: #fff; width: 100%; height: 100%; position: absolute; top: 0; left: 0;...
View ArticleMeaningful Motion with Action-Driven Animation
Do thing?CancelDo it .post-ada-container { width: 100px; height: 80px; position: relative; display: inline-block; color: #000; } .post-ada-window { border-radius: 3px; background-color: #fff;...
View ArticleData visualization with Chart.js: An introduction
You can tell powerful stories with data. If you want to visualize data in a blog post, on your site, or in a presentation, there are a few libraries out there that can help you achieve stunning results...
View Article10 Chart.js example charts to get you started
@media all and (max-width: 900px) { .chartjs-banner-10x { width: 120px; height: 106px; } } Chart.js is a powerful data visualization library, but I know from experience that it can be tricky to just...
View ArticleMoving along a curved path in CSS with layered animation
.mnc-demo-container { height: 100px; width: 100px; position: relative; margin-right: auto; margin-left: auto; } .mnc-demo-grid { overflow: hidden; border: 2px solid rgba(0,0,0,0.2); height: 100%;...
View ArticleHow to animate box-shadow with silky smooth performance
.box-shadow-demo { display: inline-block; background-color: #fff; width: 90px; height: 90px; border-radius: 5px; box-shadow: 0 1px 2px rgba(0,0,0,0.2); position: relative; border-radius: 5px;...
View ArticleGoogle Web Font Inspiration with TypeSource
If you’ve been looking through Google’s directory of Web Fonts in search for fonts to use in your next project, you might have felt your inspiration quickly drain. It can be difficult to imagine how a...
View ArticleCopy Lorem Ipsum from your Menu Bar with Loremify
Kalle Persson and I just built and released a small utility app for OS X. Loremify is a free mac app to quickly copy Lorem Ipsum to your clipboard. It lets you wrap the dummy text in html or markdown,...
View ArticleBreaking to a new row with flexbox
.flexbox-break-banner-logo { margin-top: 20px; width: 100px; height: 100px; display: inline-block; position: relative; } .flexbox-break-box { background-color: #fff; width: 100%; height: 100%;...
View ArticleCSS masonry with flexbox, :nth-child(), and order
.masonry-banner-logo { width: 100px; height: 100px; display: inline-block; position: relative; } .masonry-box { background-color: #fff; width: 100%; height: 100%; position: absolute; top: 0; left: 0;...
View ArticleCommon CSS Flexbox Layout Patterns with Example Code
.flexbox-banner-logo { width: 100px; height: 100px; display: inline-block; position: relative; } .flexbox-box { background-color: #fff; width: 100%; height: 100%; position: absolute; top: 0; left: 0;...
View Article