Torgo χ ([info]torgo_x) wrote in [info]s2_for_dummies,
@ 2004-03-09 20:33:00
Previous Entry  Add to memories!  Tell a Friend!  Next Entry
Current mood:cascading and stylish
Current music:Arling & Cameron - "Let's Get Higher"

An S2 so you can avoid S2
This may interest the s2-for-dummies folks:

I've been grumbling for years about the crumminess of the HTML produced by the common styles in both the S1 and S2 systems, and particularly at how there weren't any "class=whatever" attributes that I could use to use CSS to shape it all. So I dove in and decided to write an S2 layer, basically from scratch, that would emit only sane, modern HTML whose actual look would be set by a CSS stylesheet -- ideally not requiring any change to the HTML or the S2 that generates it.

And here it is. It's called CSSerole, and it's what TorgoX uses -- plus a particular layer ("CSSandra") that says what stylesheets to use. Notably, here's some example stylesheets I've written:

I've been using these stylesheets for a while, and test-driving them by applying it to other people's pages (via "?style=mine" on the URL), and I think I've got all the kinks worked out. (And I've validated my CSS and even had a stab at using the W3's largely broken HTML validator on it.)

(Browser note: the CSSes I've designed probably look like crap under MSIE and Opera, since their CSS implementations are ancient and flakey. That's a property of my CSSs, not the HTML that my layer produces. Anyway, use Firefox! or another Mozilla! It's good, and good for you.
BTW, you can switch thru the stylesheets I've set by using the style switcher icon in the lower-left-hand corner of the Firefox window; in other Mozillas, it's on the View pulldown, I think.)

As to how you'd actually use this S2 layer... well, until I manage to have someone at LJ make this a public layer available on the "Step 1: Layout" menu on http://www.livejournal.com/customize/ along with Opal and Haven and stuff, I think these are the directions that apply:

  • Switch from S1 to S2 here, otherwise I bet nothing else will work.

  • Go to the Your Styles screen, and in the box under the heading "Create Style" enter a name for your style (like "CSS_try_1"), and hit "Create"

  • then on the screen that comes up, under the "Layout" heading, select the option "Other", and in the little input box that appears next to "Layer ID", enter "955636", and click the "Change" button.

  • On the screen that comes up, hit "Save Changes".

  • On the screen that THEN comes up, hit the "use" button next to your the name of the style you've made. (If hitting the button does nothing, don't worry, that means it's already being used.)
  • Then go here and hit the "Add/Edit Customizations" button, and you can change all sorts of things.

  • And you can always switch back to S1 or to another S2 layer if things aren't working out.

  • Email me at sburke@cpan.org if you have any ideas for correcting these instructions.

  • You can go poke around with the various themes (sub-styles) of CSSerole by going back to the Your Styles screen and hitting "Edit" by the name of the style you created, and then on the screen that comes up, choosing from the list of themes on the "Theme" submenu (like try Red Menace). Just remember to hit "Save Changes" to make it stick.

Now go to your journal and hit reload, and it should be in the new style!


If/when you want to design your own stylesheets for the HTML that this layer emits, then here's some tips: take a page of HTML produced by that layer -- like what's in my journal (notably in the various views it can present), save it/them to disc (along with copies of the stylesheets mentioned above, probably), and then peruse the HTML and start composing a stylesheet locally that shapes it all as you like. Use The CSS Validator often, and preview in Firefox and possibly MSIE. Then when you're happy, upload the stylesheet to a web server (along with any accompanying graphics that the stylesheet might use), and then change your LJ style to point to the URL of that stylesheet. Voila!



(Post a new comment)


[info]camtarn
2004-05-30 02:13 pm UTC (link)
Excellent idea! I got so fed up with Component's code that I wrote my own style from scratch, designing specifically for styling (inspired by the CSS Zen Garden) Component is a nifty layout, but the code behind is truly horrible to try and read, because of the nested tables used for the rounded corners and stuff.

Unfortunately the style I ended up with, although it works very nicely for my own journal, has a few hardcoded bits (like the top image, sidebar and so on) so it wouldn't be suitable for anyone else to use (although I'm vaguely thinking of revamping it if I ever have a *lot* of time on my hands o.O)

(Reply to this)


[info]nothing_less
2004-06-05 02:36 am UTC (link)
This all sounds great! I did something similar a while ago too, wrote a layer from scratch to be XHTML and CSS valid, using pretty much only CSS to style everything.

But obviously, the more people start doing this, the sooner the LJ staff will hopefully start validating their own layers as well. :) Go you, I'll be sure to try your layer out sometime soon!

(Reply to this)


[info]livredor
2004-06-05 02:42 pm UTC (link)
Thanks so much for the effort you've put into this. I've finally taken the plunge and switched my journal to your layout, and I'm just starting to learn how to handle the CSS to make it work. I really appreciate this, though; a layout that you can fully control with CSS rather than having to delve into S2 programming is something that LiveJournal really needs. Good luck getting it accepted as a public style.

(Reply to this)


Create an Account
Forgot your login?
Login w/ OpenID
English • Español • Deutsch • Русский…