Swapping State with CSS Keyframes
Say you want an element to be in one state for 9 seconds, and in another state for 1 second, on a loop.
No tweening between the state, just a straight swap.
Say you want an element to be in one state for 9 seconds, and in another state for 1 second, on a loop.
No tweening between the state, just a straight swap.
It's a perfectly reasonable to want to style the marker of list items. You know: blue bullets with black text in an unordered list. Or red counters with knockout white numbers in an ordered list.
There is a working draft spec that defines a ::marker pseudo-element that would give us this control.
/* Not supported anywhere; subject to change */
li::marker {
color: blue;
}
It's possible to do this styling now, though, thanks to CSS counters. The trick is to remove the list-style, then apply the markers through pseudo-element counters.
ol {
list-style: none;
counter-reset: my-awesome-counter;
}
li {
counter-increment: my-awesome-counter;
}
li::before {
content: counter(my-awesome-counter);
/* Style away! */
}
See the Pen Styled List Counters by Chris Coyier (@chriscoyier) on CodePen.
A new interview series from Preethi Kasireddy and Vivian Cromwell, focusing on "how developer products are made". I was honored to be lucky number three, in which I overshare about CodePen.
OpenType-SVG is a font format in which an OpenType font has all or just some of its glyphs represented as SVG (scalable vector graphics) artwork. This allows the display of multiple colors and gradients in a single glyph. Because of these features, we also refer to OpenType-SVG fonts as “color fonts”.
Support so far: Firefox 26+, Edge 38+
It wasn't that long ago where you couldn't programmatically copy text to the clipboard from the web without using Flash. But it's getting pretty well supported these days. IE 10+, Chrome 43+, Firefox 41+, and Opera 29+, says Matt Gaunt in writing about it on Google's developer site.
Here's the example from that article:
See the Pen Copy Text with a Button (Google Example) by Chris Coyier (@chriscoyier) on CodePen.
That article says it's not supported in Safari, but it is as of Safari 10, which only dropped in September.
You don't need a library to do this stuff, as evidenced by the above demo. But, there is one: clipboard.js. It's only 3kb gzipped. The purpose is to give you a bit of a cleaner API to work with, like success and error events, and configuration through data-* attributes. Here's a demo of that:
See the Pen Simplest Possible Clipboard.js by Chris Coyier (@chriscoyier) on CodePen.
One of the interesting things about Media Temple is the breadth of hosting solutions they offer.
Among their least expensive plans is WordPress-specific hosting. Just $20/month, but very powerful and fast hosting, thanks to it being tuned just for WordPress. WP-CLI is installed right on it and it auto-updates WordPress core for you. Not to mention it's all on SSD's, you get SSH access, and you get 24/7 WordPress-certified support.
There are loads of plans that scale up from here, all the way up to incredibly high-end servers. I was just chatting with some Media Temple folks about some real white-glove support they were doing with a huge enterprise client. Guess what kind of site it was? WordPress. All set up on Amazon Web Services and fully managed by Media Temple.
If you go for Grid or DV (level 1 or 2), make sure to use the code CSSTRICKS to save 20% the whole first year.
I absolutely love this idea from Thoughtbot. Just like automated tools that check your HTML for syntax, formatting, validity, or whatever else, FormLinter checks your <form> HTML for best practices. Things like every input having a label, using correct input types, required fields, and more.
Doing all these things right is worth the effort: improvements like these improve accessibility and increase conversions. However, checking this sort of thing by hand is tedious and error-prone.
We were testing some forms in the ol' CSS-Tricks team chat and it was doing what it said on the box. On Geoff's personal site, it gave his contact form a "B" for not having matching labels for inputs and not having any fields required (seems like a fairly high grade?). The form was output from the mega-popular "Contact Form 7" for WordPress, also a bit surprising.
Many of the forms we tested bombed the app though. No word on that. Might be an HTTPS thing?
Cool little lib from Atif Azam that allows you to wrap a name in a span and it puts a little 🔊 button to hear the pronunciation. The audio comes from NameShouts. You can't contribute your own pronunciations to NameShouts, best I can tell, but the lib allows you to provide an alternate source.
I made a demo based on the screenshot in the README:
See the Pen Demo of Vocalizer by Chris Coyier (@chriscoyier) on CodePen.
Over 4,400 companies are using Hired to find their next team member and with transparency into each company, you’re empowered to make the right decision about what opportunities you’d like to pursue. Say goodbye to pushy recruiters trying to sell you on roles you don’t actually want. Life’s too short to waste time with companies that are a bad fit, or to find out after months of interviewing that the offer is no good.
Try Hired and let companies apply to you. The best part: it’s always free.