Core CSS3
by Rachel Andrew on Jun 10, 2010
- 3,595 views
Core CSS3 Session from Web Directions @media 2010.
Core CSS3 Session from Web Directions @media 2010.
Accessibility
Categories
Tags
More...Upload Details
Uploaded via SlideShare as Apple Keynote
Usage Rights
© All Rights Reserved
Statistics
- Favorites
- 18
- Downloads
- 0
- Comments
- 0
- Embed Views
- Views on SlideShare
- 3,326
- Total Views
- 3,595
So what is CSS3?
A Working Draft is a document that W3C has published for review by the community, including W3C Members, the public, and other technical organizations.
Candidate Recommendation (CR) - gather implementation experience
Proposed Recommendation (PR) - sent to the W3C Advisory Committee for final endorsement.
W3C Recommendation (REC) -specification or set of guidelines that, after extensive consensus-building, has received the endorsement of W3C Members and the Director. W3C recommends the wide deployment of its Recommendations.
Firefox, Opera, Safari, Chrome etc. all offer support for many different parts of the spec.
If using a Vendor specific extension always add the actual CSS3 declaration as well. For example when IE9 comes out it will support border-radius, if you omit it now from your CSS then IE9 won’t show the rounded corners even though it would be able to.
Usually added at an early stage of module development
If the module changes the browser doesn’t need to change their implementation thus breaking older code.
Use carefully and keep an eye on the actual spec and correct way to do things.
Often have to add classes just for the CSS - for example a class on the last item on a list
Annoying when we can access the mark-up, doesn’t help separate presentation from content & structure
Sometimes we can’t access the mark-up - generated by a CMS we can’t change etc. and then we end up having to lose bits of a design because we can’t do them without adding classes.
With CSS2 we would need to put a class on the first para in order to style it differently.
Time limits me from looking at too many selectors today but another group of selectors that are very useful are known as combinators. We have things like an adjacent sibling combinator’ selecting an element that is next to another element that shares the same parent. So the p that comes straight after an h1 for example.
Attribute selectors let you get at an element based on it’s attribute. An obvious use for these is in forms. If you just target input you get text fields, submit buttons and checkboxes etc. This usually means we stick classes on all the input elements to distinguish them. Attribute selectors let you look at the type attribute of the input element and style appropriately.
I also wanted to display and email icon next to the email us text.
To get the email link we use the second declaration - ^= shows we want to match things in the href that begin with mailto
You could just add the CSS directly using jQuery but then you have to remember to update the rules in the JavaScript as well as in the CSS so I feel this is a bit neater.
ecsstender - several extensions for different modules
if not already using javascript these can be really useful. If using js I’d usually add a fixSelectors function into my UI js file and do them there.
I’d urge caution in putting these scripts in place at the beginning of a build - rmemeber some users may have an old browser and no javascript, make sure the experience is ok for them before adding js to the mix.
You can fake some of this using JavaScript depending on the effect you are going for. The good news is that IE9 will have support.
@font-face enables the importing of a font that you have uploaded to your web server - then that font can be used in your font stacks just like any standard font.
IE9 will have support for these - until then you can effect support using JavaScript if required.
Where this is very useful today is if you want to create a version of your site for the iPhone or other devices that support media queries. A device running an up to date Webkit, Opera or Mozilla based browser should have support.