Search
Position Sticky and Table Headers
13.7.2019
You can't position: sticky; a <thead>. Nor a <tr>. But you can sticky a <th>, which means you can make sticky headers inside a regular ol' <table>. This is tricky stuff, because if you didn't know this weird quirk, it would be hard to blame you. It makes way more...
Restricting a (pseudo) element to its parent’s border-box
2.7.2019
Have you ever wanted to ensure that nothing of a (pseudo) element gets displayed outside its parent's border-box? In case you're having trouble picturing what that looks like, let's say we wanted to get the following result with minimal markup and avoiding brittle CSS.
The desired result.
This...
Making width and flexible items play nice together
1.7.2019
The short answer: flex-shrink and flex-basis are probably what you’re lookin’ for.
The long answer
Let’s say you want to align an image and some text next to each other with like this:
Now let's say you reach for flexbox to make it happen. Setting the parent element to display: flex; is a good...
10 React Challenges (Beginner): Use Context to Pass Data
14.6.2019
Data in React applications is usually passed to components, via props. By using props, data is sent from parent to child components.
Passing da
10 React Challenges (Beginner): Recreate Layout with Components
5.6.2019
Components are the building blocks of React Applications, and each is a JavaScript function. These components comprise of Parent and Child components.
Data is passed from parent to child thr
CEO of Burger King’s Parent Company Looks for Long Term Growth in China as Slowdown Hits
16.5.2019
China is the world’s second-largest economy and over the past decade, some of the biggest companies in the world have flocked to the nation in order to meet the insatiable demand for all sort of products and fast food was business certainly one of them. Burger King remains one of the best known...
CSS Algorithms
6.3.2019
I wouldn't say the term "CSS algorithm" has widespread usage yet, but I think Lara Schenck might be onto something. She defines it as:
a well-defined declaration or set of declarations that produces a specific styling output
So a CSS algorithm isn't really a component where there is some parent...
Dealing with overflow and position: sticky;
25.2.2019
Any overflow value other than visible and no height is the enemy of child elements with position: sticky;. It's like that element is ready to stick when the parent scrolls, but it never does because the height is unconstrained. Adding a fixed height can solve the issue, but that's not always...
Stuff you can do with CSS pointer events
27.7.2018
Martijn Cuppens (the same fella with the very weird div!) has some more irresistible CSS trickery. Three of the examples are about making a child element trigger an event on a parent element (almost like the magic that is :focus-within).
Here's how I reasoned it out to myself:
You know how if...
Responsive Knockout Text With Looping Video
3.5.2018
Here’s an idea! Let’s make an an HTML <video> play inside the shape of some letters. Like "Knockout Text" except instead of an image behind, it’s video. A live demo will explain more clearly:
See the Pen basic pen by Giulio Mainardi (@mgiulio) on CodePen.
A key objective here is to develop...