A decade ago HTML and CSS added the ability to, at least signal, validation of form fields. The required
attribute helped inform users which fields were required, while pattern
allowed developers to provide a regular expression to match against an <input>
‘s value. Targeting required fields and validation values with just CSS and HTML was very useful.
Did you know that CSS provides :optional
to allow you to style form elements that aren’t required?
input:optional, select:optional, textarea:optional { border: 1px solid #eee; } [required] { border: 1px solid red; }
In a sense, it feels like :optional
represents :not([required])
, but :optional
is limited to just form fields.
Serving Fonts from CDN
For maximum performance, we all know we must put our assets on CDN (another domain). Along with those assets are custom web fonts. Unfortunately custom web fonts via CDN (or any cross-domain font request) don’t work in Firefox or Internet Explorer (correctly so, by spec) though…
Create a CSS Flipping Animation
CSS animations are a lot of fun; the beauty of them is that through many simple properties, you can create anything from an elegant fade in to a WTF-Pixar-would-be-proud effect. One CSS effect somewhere in between is the CSS flip effect, whereby there’s…
Create a Spinning, Zooming Effect with CSS3
In case you weren’t aware, CSS animations are awesome. They’re smooth, less taxing than JavaScript, and are the future of node animation within browsers. Dojo’s mobile solution,
dojox.mobile
, uses CSS animations instead of JavaScript to lighten the application’s JavaScript footprint. One of my favorite effects…