Search
Web Standards Meet User-Land: Using CSS-in-JS to Style Custom Elements
15.3.2019
The popularity of CSS-in-JS has mostly come from the React community, and indeed many CSS-in-JS libraries are React-specific. However, Emotion, the most popular library in terms of npm downloads, is framework agnostic.
Using the shadow DOM is common when creating custom elements, but there’s...
Using React Loadable for Code Splitting by Components and Routes
7.3.2019
In a bid to have web applications serve needs for different types of users, it’s likely that more code is required than it would be for one type of user so the app can handle and adapt to different scenarios and use cases, which lead to new features and functionalities. When this happens, it’s...
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...
Extracting Text from Content Using HTML Slot, HTML Template and Shadow DOM
6.3.2019
Chapter names in books, quotes from a speech, keywords in an article, stats on a report — these are all types of content that could be helpful to isolate and turn into a high-level summary of what's important.
For example, have you seen the way Business Insider provides an article's key points...
Why I Write CSS in JavaScript
5.3.2019
I'm never going to tell you that writing your CSS in CSS (or some syntactic preprocessor) is a bad idea. I think you can be perfectly productive and performant without any tooling at all. But, I also think writing CSS in JavaScript is a good idea for component-based styles in codebases that build...
Do CSS Custom Properties Beat Sass Loops?
2.3.2019
I reckon that a lot of our uses of Sass maps can be replaced with CSS Custom properties – but hear me out for a sec.
When designing components we often need to use the same structure of a component but change its background or text color based on a theme. For example, in an alert, we might need...
Responsive Designs and CSS Custom Properties: Building a Flexible Grid System
26.2.2019
Last time, we looked at a few possible approaches for declaring and using CSS custom properties in responsive designs. In this article, we’ll take a closer look at CSS variables and how to use them in reusable components and modules. We will learn how to make our variables optional and set fallback...
Responsive Designs and CSS Custom Properties: Defining Variables and Breakpoints
25.2.2019
CSS custom properties (a.k.a. CSS variables) are becoming more and more popular. They finally reached decent browser support and are slowly making their way into various production environments. The popularity of custom properties shouldn’t come as a surprise, because they can be really helpful...
Building an Online Retail Dashboard in React
5.2.2019
Building an Online Retail Dashboard in React
TOC:
Introduction
Setup
React, Bootstrap and Styled Components
FusionCharts
Google Shee
What Hooks Mean for Vue
4.2.2019
Not to be confused with Lifecycle Hooks, Hooks were introduced in React in v16.7.0-alpha, and a proof of concept was released for Vue a few days after. Even though it was proposed by React, it’s actually an important composition mechanism that has benefits across JavaScript framework ecosystems,...
An Overview of the Most Exciting Proposals for the Web Platform Related to Web Components
30.1.2019
As much as I like frameworks, I'm also a big fan of the native web platform, especially web components.
I look forward to the times when the implementation will be powerful eno
Intro to React Hooks
18.1.2019
Hooks make it possible to organize logic in components, making them tiny and reusable without writing a class. In a sense, they’re React’s way of leaning into functions because, before them, we’d have to write them in a component and, while components have proven to be powerful and functional...
WDRL — Edition 253: Welcome back to a new year with Jank-Free Images, Styled Web Components, Human Branding and Code-Splitting
11.1.2019
Hey,
I’m happy to be back with a new edition of my Web Development Reading List in 2019. I’m grateful for all your ongoing givings to support my work and it makes me happy to hear that so many people find this resource very helpful. So if you enjoy reading it, share it with people you know, give...
Styling a Web Component
8.1.2019
This confused me for a bit here so I'm writing it out while it's fresh in mind. Just because you're using a web component doesn't mean the styles of it are entirely isolated. You might have content within a web component that is styled normally along with the rest of your website. Like this:
See...
The Fragmented, But Evolving State of CSS-in-JS
20.12.2018
TLDR: The CSS-in-JS community has converged on a consistent API.
Not so long ago, a Facebook engineer compiled a list of the available CSS-in-JS methodologies. It wasn’t short:
aphrodite, babel-plugin-css-in-js, babel-plugin-pre-style, bloody-react-styled, classy, csjs, css-constructor, css-light...
Making SVG icon libraries for React apps
14.12.2018
Nicolas Gallagher:
At Twitter I used the approach described here to publish the company’s SVG icon library in several different formats: optimized SVGs, plain JavaScript modules, React DOM components, and React Native components.
There is no One True Way© to make an SVG icon system. The only...
Convert Class Components to Functional Components in a React Project (Solution to Code Challenge #14)
14.12.2018
Last week on the code challenge we set out to refactor some class components in a create-react-app proj
Collective #475
10.12.2018
CodyHouse Components * The State of Web Browsers * Goodbye, EdgeHTML * What is the Shadow DOM? * Pure CSS Pink
Collective #475 was written by Pedro Botelho and published on Codrops
Google Labs Web Components
10.12.2018
I think it's kinda cool to see Google dropping repos of interesting web components. It demonstrates the possibilities of cool new web features and allows them to ship them in a way that's compatible with entirely web standards.
Here's one: <two-up>
I wanted to give it a try, so I linked...
Compound Components in React Using the Context API
7.12.2018
Compound components in React allow you to create components with some form of connected state that’s managed amongst themselves. A good example is the Form component in Semantic UI React.
To see how we can implement compound components in a real-life React application, we’ll build a compound...