Tag archives for CSS

Thursday, November 30, 2006

Damn him all to hell

So apparently Michael Douglas almost killed himself.

Douglas briefly lost his footing while standing in a cherry-picker basket 25 feet in the air to christen a new art museum in Bermuda. Douglas, a benefactor of the Masterworks Museum of Bermuda Art, was pouring rum on the roof in a traditional regional "roof-wetting" ceremony Monday but managed to steady himself.

Fucking Michael Douglas. When presented with the opportunity, the guy adamantly refuses to fall on his head.

 

And on a completely different note, I've been considering making a dramatic overhaul to my sidebar. A few of the ideas I'm kicking around might not be compatible with my older blog skins. Does anyone use the Eat at The Fish's, Tossed My Salad, or Just For Charred skins? I'm thinking about getting rid of them to free my template for more radical designs, but I don't want to feel like I'm yanking the rug out from under too many people.

Speaking of design changes, I've changed the way this blog uses CSS. The "standard" methods for serving CSS are to have styles embedded in the HTML or to use static external files. I'm using a different method now. I'm serving CSS through PHP, which (among other benefits) allows some server-side trickery.

Anyway, you probably don't care about the behind-the-scenes voodoo. I bring it up only because I'm wondering about compatibility. I'd hate to go blazing forward with something that doesn't work for everyone. So if none of these new stylesheets are available to you, I'd really appreciate hearing about it.

Friday, September 29, 2006

Don't I just suck?

Off and on for the last week or so I've been working on a technical how-to post. It's about using conditional CSS to improve the display of hyperlinks. It's well-written, informative and completely fucking boring. You know it's got to be boring if even I can't stand it. It's not really even that useful, it's just something that struck me a week ago.

Yeah, not so striking anymore.

 

The thing that inspired me to write the whole thing in the first place is that I wanted a solution to differentiate between my own internal links and links to some other site. I had this worked out and implemented in the crumbs blogskin. And it stayed there for about two hours before I got bored with it and killed it again.

If you're using Internet Explorer, you would never have seen it anyway.

 

The absolute worst thing about being a celebrity has got to be losing all the people you can trust to tell you the truth. Do you think celebs ever realize that one by one their real friends have vanished and they're surrounded by toadying yesmen? (Not that they're all men, but "yespersons" sounds fucking stupid.)

Example: Lindsay Lohan. She used to be absolutely adorable. She was one of those rare women who managed to pull off sexy and innocent simultaneously.

Old Lindsay

Somewhere along the line she found her inner skank. Over the past year or two she's turned so nasty celebrity gossip sites have taken to calling her "Firecrotch." Not just one or two gossip sites, but pretty much all of them. That's her rep. That's her image these days.

Firecrotch

I'm pretty sure that wouldn't have happened if she still had one true friend.

Saturday, September 2, 2006

New feature, new pretty

I'm more or less constantly tweaking this blog. At least a couple of times a week I try something or other new. Most of the time my tweaks aren't really noteworthy. It's usually the kind of thing where if people notice, they notice. If they don't, oh well.

Today I've a tweak worth talking about.

But first, the pretty. I've added a spiffy drop shadow effect around user gravatars and a default grav for users without. The drop shadow uses a second image and is really nothing more than a CSS trick. Because it's not a plugin and doesn't require PHP, this particular effect will work on any blog (although it would be of limited usefulness on something like Blogger, where styled comments don't have gravatars).

Is anyone interested in seeing the CSS I've used to create this effect? (Somebody say yes. You know I'm going to talk about it soon anyway.)

Second, the new feature. All users now have the ability to edit their own comments within five minutes of submitting them. This feature will work for any user, and will even work if you close and reopen your browser.

So if ever you find yourself reviewing a comment you've just posted and you find a misspelling or whatnot that you'd like to fix, look for the new Edit link in your comment's byline.

To make this new feature a little easier to use, I've also adjusted the comment post redirect. Previously, posting a comment would reload the page with your comment a part of it, leaving you at the top of the page. Now it works a little different. Posting a comment will reload the page and take you to the comment you've just left so you can review it if you choose.

I'd like to ask you all to be my guinea pigs with this. I always have the ability to edit any comment, so I don't see the same things you do. I'd appreciate it if you could let me know if ever the edit link appears a little wonky or if the function doesn't work as expected.

Wednesday, July 26, 2006

A whatsis?

I've been following with great interest Andy Skelton and Scott Allen Wallick's posts on semantic CSS. At first I was really thrown by their use of "semantic." "The meaning of words?" I thought. "What does that have to do with CSS?"

It turns out that semantics is all about meaning and changes in meaning, usually (but not always) as it applies to language. Yeah, ok, that does make a little more sense. Anyway! They're trying to flesh out a new model for WordPress templates that would provide a much higher level of customizability than most designs currently floating around out there.

Although the entire idea has tremendous potential, the one aspect of this that interests me most is the possibility of distinct styles for individual posts based on that post's category. I've had this particular feature implemented on this blog for over a week. So far all I've done with it is specify subtle background images for the "geekery" category, and only on the red "Eat at The Fish's" skin.

Interested in seeing how it's done? No? Tough luck, I'm writing about it anyway.

Implementation requires three fairly minor changes. First, you need to add a custom function to your theme's functions.php (if you don't have a functions.php, you'll need to create one):

function post_category_class() {
    foreach ( ( get_the_category() ) as $cat ) {
        echo ' ' . $cat->category_nicename;
    }
}

This function will generate the category slug names as output suitable for CSS classes.

Next you need to call the function in the WordPress loop. Your theme will probably have a line of code similar to this:

<div class="post" id="post-<?php the_ID(); ?>">

Which would generate output like this:

<div class="post" id="post-514">

After you've inserted the new function call into your template like this:

<div class="post<?php post_category_class(); ?>" id="post-<?php the_ID(); ?>">

Simply and elegantly, every post will now automatically have a category-related class attached. Like this:

<div class="post geekery" id="post-514">

Finally, you'll need to add style rules to make certain categories stand out. Here are mine:

.geekery {
 background:url('/images/styles/eatatthefishs/geekery.gif') top right no-repeat;
}
.geekery .entry {
 background:url('/images/styles/eatatthefishs/geekery2.gif') bottom right no-repeat;
}

And huzzah! New styles just for "geekery" posts. If you intend to implement this type of setup on your WordPress blog, note that you'll probably want to insert that new function call into every template page that contains the WP loop (e.g., Search Results, Archives, Single Post, etc.) Not all themes have all template files, so your results will vary.
 

As I said, the only thing I've done with this so far is to specify those two subtle background images. Because this method will apply the category slug as a class for every category to which a post is assigned, there's the very real possibility of overstyling a post. For example, if I specify a border for the News category and a larger font for the A/V category, a post filed in both categories would have both a border and the larger font. Since a few of my catch-all posts are filed into many categories, too many styles would easily make for cluttered eyesores.

I like the clean simplicity of my template now, so I'm only implementing modest styles as they occur to me. Since the blue "Tossed My Salad" skin is available mostly as a retro throwback, that skin probably won't see any new styles at all.

Tuesday, November 29, 2005

Carry on

Yeah, so I looked into it a little more. CSS-3 isn't as big a deal as I thought it was going to be.

FF 1.5 is still pretty damn cool, though.

Like a kid at Christmas

It's here! It's here!

Firefox 1.5 gets released tonight. It's out of beta and it now supports CSS-3. Woohoo!

("Woohoo" along with me. Trust me, that's cool.)