How I Created a Code Beautifier in Two Days

I recently drew up a wireframe for a code beautifier. The next day, I decided to turn it into a real tool. The whole project took less than two days to complete.
I’d been thinking about building a new code beautifier for a while. The idea isn’t unique, but every time I use someone else’s tool, I find myself reapplying the same settings and dodging advertisements every single time. 🤦🏻‍

I wanted a simple tool that worked well without the … Read article
The post How I Created a Code Beautifier in Two Days appeared first on CSS-Tricks.

Link: https://css-tricks.com/how-i-created-a-code-beautifier-in-two-days/

What the Web Needs Now (and how ARTIFACT is here for it)

I recently had the pleasure of joining Dave Rupert, Chris Coyier, and Chris Ferdinandi on the Shop Talk Show to talk about the upcoming ARTIFACT Conference (Austin, TX on Sept. 30 – Oct. 1, 2019). ARTIFACT is an intimate gathering of web designers and developers where we discuss ways to build web sites that work for everyone.
This isn’t our first rodeo! I started ARTIFACT back in 2013 with Christopher Schmitt and Ari Stiles (the team behind the legendary In … Read article
The post What the Web Needs Now (and how ARTIFACT is here for it) appeared first on CSS-Tricks.

Link: https://css-tricks.com/what-the-web-needs-now-and-how-artifact-is-here-for-it/

Weekly Platform News: CSS ::marker pseudo-element, pre-rendering web components, adding Webmention to your site

In this week’s roundup: datepickers are giving keyboard users headaches, a new web component compiler that helps fight FOUC, we finally get our hands on styling list item markers, and four steps to getting webmentions on your site.
The post Weekly Platform News: CSS ::marker pseudo-element, pre-rendering web components, adding Webmention to your site appeared first on CSS-Tricks.

Link: https://css-tricks.com/weekly-platform-news-css-marker-pseudo-element-pre-rendering-web-components-adding-webmention-to-your-site/

Using GraphQL Playground with Gatsby

I’m assuming most of you have already heard about Gatsby, and at least loosely know that it’s basically a static site generator for React sites. It generally runs like this:

Data Sources → Pull data from anywhere.
Build → Generate your website with React and GraphQL.
Deploy → Send the site to any static site host.

What this typically means is that you can get your data from any recognizable data source — CMS, markdown, file systems and … Read article
The post Using GraphQL Playground with Gatsby appeared first on CSS-Tricks.

Link: https://css-tricks.com/using-graphql-playground-with-gatsby/

Multi-Line Truncation with Pure CSS

Truncating a single line of text if is fairly straightforward. Truncating multiple lines is a bit harder. Using just CSS (no JavaScript or server-side dancing) is nice for the simplicity. It’s gotten a little easier lately since Firefox (since version 68) has started supporting the ultra-bizarre -webkit-line-clamp soup method, which makes browser support for that pretty OK.
There is another way though, which is very clever and something I’d call a bonafide CSS trick. We somehow failed to … Read article
The post Multi-Line Truncation with Pure CSS appeared first on CSS-Tricks.

Link: https://css-tricks.com/multi-line-truncation-with-pure-css/

Micro Frontends

One random day not long ago, I started hearing joke after joke about “micro frontends" — sort of how I first learned about Toast. I didn’t understand the source until asking around, which uncovered this article from Cam Jackson.
In this article we’ll describe a recent trend of breaking up frontend monoliths into many smaller, more manageable pieces, and how this architecture can increase the effectiveness and efficiency of teams working on frontend code.
I’d argue it should… Read article

Link: https://css-tricks.com/micro-frontends/

Improving Video Accessibility with WebVTT

“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect."
– Tim Berners-Lee
Accessibility is an important element of web development, and with the ever-growing prevalence of video content, the necessity for captioned content is growing as well. WebVTT is a technology that solves helps with captioned content as a subtitle format that integrates easily with already-existing web APIs.
That’s what we’re going to look at here in this article. … Read article

Link: https://css-tricks.com/improving-video-accessibility-with-webvtt/

Finally… A Post on Finally in Promises

“When does finally fire in a JavaScript promise?” This is a question I was asked in a recent workshop and I thought I’d write up a little post to clear up any confusion.

The answer is, to quote Snape:
…always.
The basic structure is like this:
try {
// I’ll try to execute some code for you
}
catch(error) {
// I’ll handle any errors in that process
}
finally {
// I’ll fire either way
}
Take, for instance, … Read article
The post Finally… A Post on Finally in Promises appeared first on CSS-Tricks.

Link: https://css-tricks.com/finally-a-post-on-finally-in-promises/

A Peek at New Methods Coming to Promises

Promises are one of the most celebrated features introduced to JavaScript. Having a native asynchronous artifact baked right into the language has opened up a new era, changing not only how we write code but also setting up the base for other freat APIs — like fetch!
Let’s step back a moment to recap the features we gained when they were initially released and what new bells and whistles we’re getting next.

New to the concept of Promises? … Read article
The post A Peek at New Methods Coming to Promises appeared first on CSS-Tricks.

Link: https://css-tricks.com/a-peek-at-new-methods-coming-to-promises/

Managing Multiple Backgrounds with Custom Properties

One cool thing about CSS custom properties is that they can be a part of a value. Let’s say you’re using multiple backgrounds to pull off a a design. Each background will have its own color, image, repeat, position, etc. It can be verbose!

You have four images:
body {

background-position:
top 10px left 10px,
top 10px right 10px,
bottom 10px right 10px,
bottom 10px left 10px;

background-repeat: no-repeat;

background-image:
url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/angles-top-left.svg),
url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/angles-top-right.svg),
url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/angles-bottom-right.svg),
url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/angles-bottom-left.svg);

}
You want to add a … Read article
The post Managing Multiple Backgrounds with Custom Properties appeared first on CSS-Tricks.

Link: https://css-tricks.com/managing-multiple-backgrounds-with-custom-properties/