Archive | article

RSS feed for this section

What Does a Well-Documented CSS Codebase Look Like?

In the front-end community, there is a lot of attention related to documenting JavaScript. That’s not so much the case with CSS. Often times I feel like lost when I join a project with minimal or no CSS documentation.

Even though CSS is relatively easy to write, it can be quite hard to maintain. The specificity, the global scope of everything, and the lack of guidance can easily lead to inconsistency, code duplication, and over-complication.

I’ve long been curious …


What Does a Well-Documented CSS Codebase Look Like? is a post from CSS-Tricks

Naming Things is Only Getting Harder

I was working with CSS Grid and came to the grid-column and grid-row properties. I paused for a moment.

They’re not overly complicated. They are shorthand properties for expressing where an element should start and end on a grids defined columns and rows.

What caught me was the fact that I can name these lines. It’s not a requirement (you can use numbers), but the ability to name the grid lines is something we can do here. In fact, naming …


Naming Things is Only Getting Harder is a post from CSS-Tricks

Reactive UI’s with VanillaJS – Part 2: Class Based Components

In Part 1, I went over various functional-style techniques for cleanly rendering HTML given some JavaScript data. We broke our UI up into component functions, each of which returned a chunk of markup as a function of some data. We then composed these into views that could be reconstructed from new data by making a single function call.

This is the bonus round. In this post, the aim will be to get as close as possible to full-blown, class-based …


Reactive UI’s with VanillaJS – Part 2: Class Based Components is a post from CSS-Tricks

Server-Side React Rendering

React is best known as a client-side JavaScript framework, but did you know you can (and perhaps should!) render React server-side?

Suppose you’ve built a zippy new event listing React app for a client. The app is hooked up to an API built with your favorite server-side tool. A couple weeks later the client tells you that their pages aren’t showing up on Google and don’t look good when posted to Facebook. Seems solvable, right?

You figure out that …


Server-Side React Rendering is a post from CSS-Tricks

Introduction to Webpack: Entry, Output, Loaders, and Plugins

Front-end development has shifted to a modular approach, improving the encapsulation and structure of codebases. Tooling became a critical part of any project, and right now there are a lot of possible choices.

Webpack has gained popularity in the last years because of its power and scalability, but some developers found its configuration process confusing and hard to adopt.

We’ll go step by step from an empty configuration file to a simple but complete setup to bundle a project. This


Introduction to Webpack: Entry, Output, Loaders, and Plugins is a post from CSS-Tricks

Introduction to Webpack: Entry, Output, Loaders, and Plugins

Front-end development has shifted to a modular approach, improving the encapsulation and structure of codebases. Tooling became a critical part of any project, and right now there are a lot of possible choices.

Webpack has gained popularity in the last years because of its power and scalability, but some developers found its configuration process confusing and hard to adopt.

We’ll go step by step from an empty configuration file to a simple but complete setup to bundle a project. This


Introduction to Webpack: Entry, Output, Loaders, and Plugins is a post from CSS-Tricks

Using Mixins in Vue.js

It’s a common situation: you have two components that are pretty similar, they share the same basic functionality, but there’s enough that’s different about each of them that you come to a crossroads: do I split this component into two different components? Or do I keep one component, but create enough variance with props that I can alter each one?

Neither of these solutions is perfect: if you split it into two components, you run the risk of having to …


Using Mixins in Vue.js is a post from CSS-Tricks

Using Mixins in Vue.js

It’s a common situation: you have two components that are pretty similar, they share the same basic functionality, but there’s enough that’s different about each of them that you come to a crossroads: do I split this component into two different components? Or do I keep one component, but create enough variance with props that I can alter each one?

Neither of these solutions is perfect: if you split it into two components, you run the risk of having to …


Using Mixins in Vue.js is a post from CSS-Tricks

Handling Long and Unexpected Content in CSS

When we write CSS, sometimes we forget about some edge cases in the designs. For example, when the content is longer than we expected and we didn’t account for that possibility, our design could break. We can’t guarantee that our CSS will always work as expected, but at least we can reduce that by testing different types of content.

When you code CSS, you’re writing abstract rules to take unknown content and organize it in an unknown medium. – Keith


Handling Long and Unexpected Content in CSS is a post from CSS-Tricks

Handling Long and Unexpected Content in CSS

When we write CSS, sometimes we forget about some edge cases in the designs. For example, when the content is longer than we expected and we didn’t account for that possibility, our design could break. We can’t guarantee that our CSS will always work as expected, but at least we can reduce that by testing different types of content.

When you code CSS, you’re writing abstract rules to take unknown content and organize it in an unknown medium. – Keith


Handling Long and Unexpected Content in CSS is a post from CSS-Tricks