CSS Filters Test Page
Test page showing the new filters available in webkit using -webkit-filter. Works in Webkit nightly’s and Chrome 18.
Posts tagged css3
Test page showing the new filters available in webkit using -webkit-filter. Works in Webkit nightly’s and Chrome 18.
I was going to title this post, “I was bored at work today so here’s some CSS” but that didn’t seem very descriptive. And for those that don’t want to scroll down to find the link to the demo: Here you go.
Essentially, I was trying to filter content based on data attribute and the negation pseudo-class. And it works well using a combination of :not(s) pseudo-class and the general sibling combinator.
a[data-filter="red"]:focus ~ div:not([data-filter="red"]) works by selecting all divs that do not have a data-filter attribute equal to exactly “red”. These divs must also be a sibling of an in focus <a> element that has a data-filter attribute equal to “red”. If these requirements are met then all other divs have their values zeroed out.
Just over a month ago the CSS WG Blog announced the recommendation of the Selectors Level 3 spec so I made this page as my personal reference for the spec. The page is a repsonsive/fluid design and uses the isotope.js jQuery plugin for layout and filtering. Each selector includes:
This is the first time I’ve tried creating a responsive/fluid site using isotope.js. By and large there weren’t too many problems but the layout was a bit janky until a fluid/responsive hack was included in plugin. Before that, the layout would go a bit nuts sometimes when I re-sized the browser window. If you find any errors, feel free to send them to me on Twitter. You can find me on Twitter @dumaurier.
View the CSS Selectors Reference.
Creating a horizontal navigation bar using floats isn’t particularly difficult but there’s usually a few hiccups if you want it to be 100% width of the viewport with each link taking an equal amount of the width. The CSS3 Flexbox model makes creating the nav a lot easier and also gives you a lot more flexibility in changing the layout of the navigation bar.
I made yet another CSS3 based image gallery that I’ll probably use on my soon to be revamped website. Still some irritating IE bugs and generally tinkering. I’m going to do a quick write up so I don’t forget how I did it. But not today.
View the demo HERE.
I just finished Dan Cederholm’s CSS3 For Web Designers (go buy it!) the other day and finally felt like I had a proper understanding of how to work with the new tools available in CSS3. So I thought I’d take a stab at creating a drop down menu using CSS3 transitions. This animated menu does not require JavaScript.
I started with plain old nested lists with id=”top” on the <nav> element and class=”toplink” on each parent list item. I think I could probably do away with both in the future. (I’d post the code but tumblr won’t let me without formatting it and I don’t feel like figuring out why so just view the source).
A few days ago, Eric Meyer wrote a post on the CSS3 border-image property. Specifically, he wanted to know how you repeat a single image throughout the entire border. To put it simply, the border-image property doesn’t seem to be designed to use a single image, rather it’s designed to use a grid of images. So if you want a border of repeating diamonds instead of creating a single diamond image you need to create a grid like this:
And use the following syntax:
-webkit-border-image:url(grid.png) 5 / 5px repeat;-moz-border-image:url(grid.png) 5 / 5px repeat;But why can’t you achieve the same effect with a single image?
A few days ago, a post went up on the Surfin’ Safari blog announcing changes to the CSS3 Gradient syntax. The two important points in the post are:
This is great news because not only was the WebKit syntax a bit knotty but WebKit and Mozilla used different syntax for gradients (and you thought using different vendor prefixes was a pain in the ass). So for my still-a-work-in-progress page I had to include this:
background:#999;/*-- WebKit Gradients --*/background-image:-webkit-gradient(radial, center center, 50, center center, 700,from(rgba(255, 255, 255, .8)), to(rgba(255, 255, 255, .1)) ); /*-- Moz Gradients --*/ background-image:-moz-radial-gradient(center,rgba(255,255,255,.8) 20%,rgba(255,255,255,.1) 100%););Yeah, I barely had a grasp on the syntax when I wrote it and no, they do not look the same when viewed side-by-side but…
Once this is rolled into Safari and Chrome (the new syntax is currently available only in the Nightly Builds) I can just add the -webkit vendor prefix to the new syntax. But I’ll need to leave the nasty old -webkit-gradient code in for a while otherwise people that don’t upgrade will get the plain old background colour.
To an extent, it seems like WebKit is simplifying the syntax by adopting the syntax currently employed in Firefox. Fine with me, the soon to be retired WebKit syntax was a bit of a nightmare.
Links: