Here’s a question I got the other day? Would you suggest icon fonts or inline SVGs for a complex single page application? And are there specific accessibility concerns for either? Accessibility is especially important for us because schools use our products. I ask because we are currently in the process of unifying and setting up an icon system.
This article was ported over from Chris House’s guide, by Chris himself, who is keeping both up-to-date. Getting started with Grid is easy. You just define a container element as a grid with display: grid , set the column and row sizes with grid-template-columns and grid-template-rows , and then place its child elements into the grid with grid-column and .
The following is a guest post by Oliver Williams. Oliver has been working with CSS grid layout and has learned quite a bit along the way. In this article he’s going to hop around to different concepts that he’s learned on that journey.
The Halloween game over on CodePen is pretty strong. I’ve been keeping a Collection of them myself, but so have a lot of other people who put mine to shame. You can even search for Halloween Collections, if you really wanna follow the rabbit hole.
Let’s get into the spirit a little bit this year with some Halloween themed posts! I’ll kick it off with some CSS selectors FROM BEYOND THE GRAVE. Er. CSS
The term “responsive images” has come to mean “responsive images in HTML”, in other words, the srcset and sizes attribute for and the element. But how do the capabilities that these things provide map to CSS? CSS generally wasn’t really involved in the responsive images journey of the last few years.
The following is a guest post by Nilan Marktanner from Graph.cool. I don’t know about y’all but I’ve spent plenty of time in my career dealing with REST API’s. It’s a matter of always trying to figure out what URL to hit, what data to expect back, and how you can control that data.
I took a class at Bay View Printing Company, the local community letterpress shop I belong to, all about printing with polymer plates. The shop is absolutely full with wood and metal type, and all the accoutrements around that, but polymer plates are not that. You get them made!
We had a question come up the other day on ShopTalk about regular ol’ anchor links on iOS, and some weird situation where you couldn’t just tap them once to go to the link, it required tapping the link twice. I’ve experienced this myself and have been pretty confounded.
I was watching Rachel Andrew talk about CSS Grid Layout yesterday at An Event Apart. Grid is amazing and the day will soon come where it’s a dominant web layout tool of choice. That day isn’t here yet though, as no stable browser is shipping the latest version of the spec (it’s behind a flag at best).
The element in SVG is the ultimate drawing element. It can draw anything! I’ve heard that under the hood all the other drawing elements ultimately use path anyway. The path element takes a single attribute to describe what it draws: the d attribute. The value it has is a mini syntax all to itself.
FitVids.js is still a perfectly workable mini plugin for making videos (or anything) responsive. You need it, or something like it, for sites that have things like YouTube or Vimeo videos, Instagram embeds, or really anything that’s not responsive in the aspect-ratio sense. / resize their width/height in an aspect ratio friendly way, / / do not.
There are a lot of ways to work with color on the web. I think it’s helpful to understand the mechanics behind what you’re using, and color is no exception. Let’s delve into some of the technical details of color on the web.
The following is a guest post by Ahmad Shadeed. Ahmad has put together a ton of examples to show off how using relative units can benefit us. I think a lot of us think of units like em as being for font-size, which it is, but can also be for lots of other things, tying together typographic sizing and other visual elements.
Edd Morgan writes in: Obviously we all agree that the markup should contain only content, nothing ornamental. But what category do icons fall into? Are the
The following is a guest post by Jon Yablonski. Jon is going to show us an example of how we might approach markup such that one component is particularly versatile. It works as-is, and has a standardized way of making variations (adding a single class) that allow the design to be altered to fit the situation.
I recently saw this loader on CodePen, a pure CSS 3D rotating set of bars with a fading reflection. It’s done by using an element for each bar, then duplicating each and every one of these elements to create the reflection and finally adding a gradient cover to create the fading effect.
I vividly remember my first encounter with a content management system: It was 2002 with a platform called PHP-Nuke. It offered a control panel where site administrators could publish new content that would be immediately available to readers, without the need to create/edit HTML files and upload them via FTP (which at the time was the only reality I knew).
Say you want an animation to run for 1 second, but then delay for 4 seconds before running again. Seems like that would be easy. Turns out it’s not-so-straightforward, but doable. You need to fake it. There is an animation-delay property, but that won’t help us here.
One idea that has lodged itself into my brain recently (largely from this panel discussion) is how a front end developer needs to be aware. In a general sense, the front end developer is positioned in the middle of lots of other jobs. Everybody involved in a web team ends up talking with the front end developers.
Scalable Vector Graphic (SVG) is emerging as the preferred graphic format to use on the web today. Are you abandoning the icon font or replacing old pg, gif and png graphics for the well-supported SVG, too? Let’s see how this will impact users of assistive technology (AT) and what is needed in order to ensure a great user experience for everyone.
Controlling the way that a data visualization lays out on your page on the fly is powerful in terms of conveying information. In the past, we’ve talked about how we can use this to hide and show information for responsive development.
A brief history, if you will. The purpose of a sticky footer is that it “sticks” to the bottom of the browser window. But not always, if there is enough content on the page to push the footer lower, it still does that.
I had a little situation where I head a header with a span in it, and I wanted to make sure to put a line break before the span. For the record, there really isn’t anything wrong with just chucking a tag before it (and in fact the ability to show/hide that is very useful).
Icons. They’re popular. They help complement content ( most of the time). And yet they can be a pain in the neck. Once you’ve decided on a format (SVG or icon font?) and designed the set, there are still other considerations, many of which pop up while you’re coding.
Situation: you have a single line of text in a flex child element. You don’t want that text to wrap, you want it truncated with ellipsis (or fall back to just hiding the overflow). But the worst happens. The unthinkable! The layout breaks and forces the entire flex parent element too wide.
The latest poll around here kicked off asking how you prefer spell this job we all do around here: frontend? front end? Front-End? I asked because 1) I didn’t know if there was a “right” answer 2) Even if there is a right answer, it doesn’t seem adhered to.
The following is a guest post by David Clark. David is the creator of a thing called Stylelint, a tool for keeping your CSS in shape. He does a great intro as to why you might need it himself, so take it away David… You write CSS. Probably a lot of CSS.
I am a website – the ordinary website familiar to all people who use the internet. Presenting information is both my vocation and my advocation; that’s all I do. You may wonder why I should write a genealogy. Well, to begin with, my story is interesting.
There is no shortage of apps to help you arrange windows. I find them tremendously useful. Most Windows (the operating system) users I know quite like the built-in abilities it has to position windows, but there isn’t as much of that built into OS X.
I recently went to Michael Jackson and Ryan Florence’s ReactJS Training. I was really excited to attend, partially because I had so many questions about SVG and React. There are a lot of bits about working with React and SVG, and especially manipulating it, that aren’t quite supported yet.
This tutorial is the first of a three-part series on React by Brad Westfall. When Brad pitched me this, he pointed out there are a good amount of tutorials on getting started in React, but not as much about where to go from there.
Here’s how most people use Google Analytics: you copy and paste the default tracking snippet into your templates. Look at the pageview data that comes in. That’s all good, but that isn’t the most useful analytics for many sites. Google Analytics can track just about anything. It’s very flexible and very powerful.
Steven Trwoga wrote to me with a perfectly reasonable question: I have an idea for a website I would like to have built. I believe it would fall into the category of “large project”. I have spoken with, and been quoted by some web design agencies in the UK.
The following is a guest post by David Attard of DART Creations. David is going to introduce us to AMP (no idea what that is? read on) as well as how you m
Luke Underwood wrote in with an interesting question: What are the best practices for default styling? I guess there are three possibilities: Luke elaborates: Our office is split on the idea. In our base templates we currently have no styles being applied to tables by default.
We’ve long had a way to subscribe to CSS-Tricks via email. You probably couldn’t really call it a “newsletter” though, as it just consumed the RSS feed and sent out newly published articles each week. Nothing wrong with that, but it isn’t nearly as fun a custom-written one.
It’s a term for animation where the lines appear to squirm around, even when the object/scene is at rest. Apparently, it’s even patented.
background-clip is one of those properties I’ve known about for years, but rarely used. Maybe just a couple of times as part of a solution to a Stack Overflow question. Until last year, when I started creating my huge collection of sliders.
There is a documentary that I love love love called Home Movie. It follows five super weird homes and the (super weird) people that live in them. They are all interesting, but I especially enjoyed Bill Tregle, this southern “alligator rancher” living on a houseboat in Louisiana.
GOSH! Don’t the years roll by fast? It’s that time of year to say “Thank you!” I am grateful for the CSS-Tricks community: you read, help me, and help each other be better at our craft. It is each of you that has made this site what it is today.
The following is a guest post by Manuel Matuzovic. It illustrates how flex-grow works, weird quirks and all. Then he goes into several examples on how common layout patterns may be implemented using flex-grow and flex-basis. When I found out about flex-grow, I made a simple demo to find out what it did and how it worked.
A type lockup is a typographic design where the words and characters are styled and arranged very specifically. Like the design is literally locked in placed. This idea is slightly at-odds with the responsive web that we know and love, where text is fluid and wrappable and whatnot.
Sorry the website I just sent you the link to wasn’t looking right on your phone. I checked it out too and the layout was pretty jacked up. I personally caused that, as I’m solely responsible for each and every website on the internet. My bad, everybody.
Did you know that you can animate the content property of pseudo elements? According the list of animatable properties in the spec, you shouldn’t be able t
Jonathan Gillette, “Textarea, You Are A Sunken Nothing”, 2004: Yes, I mean it, Textarea. You are a Sunken Nothing. You have a beveled edge, but you are a worthless thing to jot upon. Bad pad! BAD PAD!! […] Do you accept tabs? Oop. Well, my premature article is published now.
I really want to be a better musician. Someday, I will be. I know what it takes: practice. I want to get really good. I want people to hear me play and say to themselves “hey that guy really knows how to play.”
The Printliminator ( repo) is a bookmarklet with some simple tools you can use to makes websites print better. One click to activate, and then click to remove elements from the page, remove graphics, and apply better print styling.