0, Firefox 3.6 and Safari 3.0 will require some vendor prefixes. IE8 does support pseudo elements, however doesn’t support transform.

The fallback would be a colored square. Very likely not a huge problem.

There You Have It

It's a price star thing. Flexible enough to grow when you increase your font size. Made with some CSS.

View Demo   Download Files

This was a guest post by Ryan Buttrey of Sparkbox. Thanks for sharing your process Ryan! I too get a kick out of figuring out clever and efficient ways to solve bits of design.

Building a Starburst with CSS is a post from CSS-Tricks

]]> http://css-tricks.com/14475-building-a-starburst-with-css/feed/ 40 Semantic Animationhttp://css-tricks.com/14458-semantic-animation/ http://css-tricks.com/14458-semantic-animation/#comments Tue, 04 Oct 2011 08:24:21 +0000 Chris Coyier http://css-tricks.com/?p=14458 Animations are inherently visual. But can we give a similar experience to everyone by getting a bit more semantic?

Semantic Animation is a post from CSS-Tricks

]]>
I recently said this when asked about new tools (e.g. Edge) for building CSS animations:

Empty divs used for nothing but styling were non-semantic and a bad idea before CSS animations and they are a bad idea now.

I stand by that. I feel like we've come a long way as an industry getting everyone on board with semantic markup. Do this, and reap the great rewards of speed, accessibility, maintainability, and SEO.

Then a new shiny thing comes along and the first thing we do is start abandoning our own rules. "Oooo I can make a bird fly across the screen‽" Order me up a few more of them empty divs! I'm surely guilty of this. It doesn't feel like that big of a deal when you're doing it, especially in moderation.

But CSS animations are here to stay. General best practices are going to emerge regarding what types of things we should be using them for, how much is too much, how to approach them semantically, how to offer fallback content, etc. I thought I'd throw in one little idea I had.

Let's consider what animations do for a design. They can give it mood. They can give it attitude. Like other aspects of design, they affect how a user might feel about that page. But they only do these things for sighted users. The empty div does none of these things for non-sighted users. It's just useless cruft.

<div class="moon">
//AN_Xml:  <!-- I offer nothing to non-sighted users -->
//AN_Xml:</div>

What if we were to take that empty div and try to accomplish for non-sighted users all the same things we are accomplishing for our sighted users. Simply putting descriptive text into those divs might be able to get it done for us. Similar to an alt tag for images, but actual inline content meant to be read/enjoyed in same way the animation is meant to be seen/enjoyed.

Perhaps our animation is of a moon rising, and as it rises the sky and ground turn to black. We need two elements to accomplish our animation, and so perhaps they contain the lyrics to CCR's Bad Moon Rising

<div class="moon">
//AN_Xml:   I see a bad moon rising
//AN_Xml:   I see trouble on the way
//AN_Xml:</div>
//AN_Xml:
//AN_Xml:<div class="ground">
//AN_Xml:   I see earthquakes and lightnin’
//AN_Xml:   I see bad times today
//AN_Xml:</div>

The CSS hides this text from view and calls the keyframe animation:

.ground, .moon {
//AN_Xml:   text-indent: -9999px;
//AN_Xml:   overflow: hidden; /* text-indent without this can cause choppy animation */
//AN_Xml:}
//AN_Xml:
//AN_Xml:.ground {
//AN_Xml:   -webkit-animation: ground-to-black 5s ease;
//AN_Xml:   -moz-animation:    ground-to-black 5s ease;
//AN_Xml:   -ms-animation:     ground-to-black 5s ease;
//AN_Xml:}
//AN_Xml:
//AN_Xml:.moon {
//AN_Xml:   -webkit-animation: rising-moon 5s ease;
//AN_Xml:   -moz-animation:    rising-moon 5s ease;
//AN_Xml:   -ms-animation:     rising-moon 5s ease;
//AN_Xml:}
//AN_Xml:
//AN_Xml:/* Plus various keyframe declarations */

View Demo

Notice the names of those keyframe animations. That's another discussion to have in the "semantic animations" vein. Another time.

This text could be anything that relates to the animation. It could describe the animation literally. It could be a poem that elicits the same emotion as the animation. It could be an <audio> element.

Woah there, fancy designer boy.

I don't use screen readers, so I don't get to make the call if this is a good idea or not. I imagine there is already enough cruft to fight through that this, despite the good intentions, might be just another thing obstacle on the way to "real content".

I suppose it's like everything else in this world: it depends.

Semantic Animation is a post from CSS-Tricks

]]>
http://css-tricks.com/14458-semantic-animation/feed/ 35
Amazon Silkhttp://www.youtube.com/watch?v=_u7F_56WhHk http://css-tricks.com/14453-amazon-silk/#comments Wed, 28 Sep 2011 21:53:18 +0000 Chris Coyier http://css-tricks.com/?p=14453

Listen to the engineers behind Amazon's new "Silk" web browser talk about how it uses the cloud to take the load off mobile devices.

Sounds like it does all the asset-requesting for you from the cloud, optimizes it, then sends you down one file that gets rendered into a website. Sounds clever to me, as long as it's secure as hell.

Rumor has it: WebKit based.

Direct Link to ArticlePermalink

Amazon Silk is a post from CSS-Tricks

]]>
Listen to the engineers behind Amazon's new "Silk" web browser talk about how it uses the cloud to take the load off mobile devices.

Sounds like it does all the asset-requesting for you from the cloud, optimizes it, then sends you down one file that gets rendered into a website. Sounds clever to me, as long as it's secure as hell.

Rumor has it: WebKit based.

Direct Link to ArticlePermalink

Amazon Silk is a post from CSS-Tricks

]]>
http://css-tricks.com/14453-amazon-silk/feed/ 0
//AN_Xml: t and do their own thing.

$(".panel").on("panelOpen", function() {
//AN_Xml:   // Developer 1: do Ajax stuff
//AN_Xml:});
//AN_Xml:
//AN_Xml:// Meanwhile, in another part of town...
//AN_Xml:$(".panel").on("panelOpen", function() {
//AN_Xml:   // Developer 2: do saving stuff
//AN_Xml:});

Yay for freedom! Yay for separation of functionality!

In my opinion custom events are just better all around. I do think they require a bit more communication though. You'll probably have to write up some comments somewhere that explain what custom events are fired and when and make that easy to discover.

View Demo of Custom Events model

More Information

The scenario outlined above is very simple. The following two articles go way more into depth about Custom Events including more complex examples and more information on how they work.

Custom Events are Pretty Cool is a post from CSS-Tricks

]]> http://css-tricks.com/custom-events-are-pretty-cool/feed/ 21 //AN_Xml: wfw:commentRss>http://css-tricks.com/musings-on-preprocessing/feed/ //AN_Xml: 90 //AN_Xml: //AN_Xml: //AN_Xml: Speech Bubble Arrows that Inherit Parent Color //AN_Xml: http://css-tricks.com/speech-bubble-arrows-that-inherit-parent-color/ //AN_Xml: http://css-tricks.com/speech-bubble-arrows-that-inherit-parent-color/#comments //AN_Xml: Mon, 06 Feb 2012 17:57:42 +0000 //AN_Xml: Chris Coyier //AN_Xml: //AN_Xml: //AN_Xml: http://css-tricks.com/?p=16193 //AN_Xml:

Interesting question:

//AN_Xml:

css3 speech bubble question: for the "triangle"'s border color, how can I set it to whatever its parent div's bgcolor is automagically?

//AN_Xml:

— Jin Yang (@jzy) February 1, 2012

//AN_Xml:


//AN_Xml:

//AN_Xml:

By "css3 speech bubble", Jin means using a pseudo element on a container to add a little pointer arrow (triangle). Not really CSS3, but that's pedantic.

//AN_Xml:

//AN_Xml:

Let's say that pink color isn't practical to set in an external CSS file. Perhaps is a user setting, or perhaps …

Speech Bubble Arrows that Inherit Parent Color is a post from CSS-Tricks

]]>
//AN_Xml: Interesting question:

//AN_Xml: //AN_Xml:


//AN_Xml: cle">Direct Link to Article — Permalink

Responsive Navigation Patterns is a post from CSS-Tricks

]]>
//AN_Xml: http://css-tricks.com/responsive-navigation-patterns/feed/ //AN_Xml: 0 //AN_Xml:
//AN_Xml: //AN_Xml: //AN_Xml: