Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Theming Perlmonks: the CSS way

by darobin (Monk)
on Mar 23, 2001 at 00:43 UTC ( #66453=monkdiscuss: print w/replies, xml ) Need Help??

I just read the discussion that went on about the Themes for Perlmonks Quest and I think that there might be a way to make personalized theming easy enough for users without it becoming a nightmare for admins.

This site's pages are extremely well structured, which makes them excellent candidates for styling using CSS. I believe most graphical web browsers implement a sufficient subset of CSS for it to be a workable option. Plus, it would make the pages lighter (by eliminating at least all the font tags and the bgcolor attributes). CSS (Cascading Style Sheets) are simple enough and I think almost anyone can easily learn how to use them.

On the preferences node, the user could be presented with a simple textarea containing some basic CSS code to edit (several templates could be available). All widgets types on Perlmonks would get a class attribute (eg class='rhsBox') and perhaps in some cases an id attribute too (eg id='rhsBoxInfo'), the latter allowing one to style the information box differently from the other boxes.

Once a user would have saved a personalized style sheet, that style sheet would be the one served to him through a simple link tag in the head section of each page. As an added advantage, this would make theme contribution much easier.

The main reason I'm thinking about this is less for fancy additions than for readability. I'd like to be able to truly fine tune fonts in various places, as well as some color contrasts. Making all those options available in any other way would be painful. Using simple user editable style sheets I think (hope) everyone can be happy.

-- darobin

Replies are listed 'Best First'.
Re: Theming Perlmonks: the CSS way
by OeufMayo (Curate) on Mar 23, 2001 at 01:01 UTC

    I really like this idea of being able to define your own CSS to view Perlmonks! I even think that the idea could be pushed a little further.

    My idea would be to allow monks to upload their own CSS file, given a default one with all the specific classes and ids allready filled in.

    A link to the user CSS could then be provided in the head of each page served (e.g.: <link type="text/css" rel="stylesheet"  ref="OeufMayo.css">)

    I'm aware of the cost of disk space on the server resulting of this implementation, and that's why maybe it should be reserved for higher monks (Lev. 3/4?). I'd be more than happy to help in whatever way to achieve this idea!

    my $OeufMayo = new PerlMonger::Paris({http => ''});</kbd>
      One way to inch into this safely would be to start embedding <link type="text/css" rel="stylesheet" ref="/"> into pages. In the default case (the user with that node_id has no css-sheet specified), could emit a stylesheet that's appropriate for the target browser.

      A simple next step would be to offer a palette of stylesheet options, and let users choose one. The more complicated (but still relatively easy in the grand scheme of things) step would be to let monks edit theirs via user settings.

      The space requirement for user-editable stylesheets probably pales in comparison to the space eaten up by monk pictures.

      It's true that an even simpler way to achieve this (simpler in that it requires less work) would be to provide a typical style sheet, and then allow monks to specify the link they want to use in their <link> tag. The file can then live just about anywhere... No disk space, just a simple db field.

      -- darobin
(crazyinsomniac) Re: Theming Perlmonks: the CSS way
by crazyinsomniac (Prior) on Mar 23, 2001 at 09:29 UTC
    I suggested something like this a while back at Be Creative, I doubt even vroom could've found it now(20,000 nodes later%^).

    Anyway, letting users upload their own css files, good idea.
    Making a big fat form for monks to edit, bad idea.
    Like i suggested in Be Creative, just allow monks to link to some css stylesheet, or just the one they uploaded, but don't go further than that. This should be considered a perk, perhaps for level 4.

    Disclaimer: Don't blame. It came from inside the void

    perl -e "$q=$_;map({chr unpack qq;H*;,$_}split(q;;,q*H*));print;$q/$q;"

Re: Theming Perlmonks: the CSS way
by Lexicon (Chaplain) on Mar 28, 2001 at 05:38 UTC
    I believe most graphical web browsers implement a sufficient subset of CSS for it to be a workable option.

    If we have user uploadable style sheets, we can just build the style sheet according to the browser(s) we use, and PM can use defaults for styles that aren't implimented in our .css files, which is what CSS was built to do, as I understand it. So this shouldn't be a limit to our mad customizability.


Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: monkdiscuss [id://66453]
Approved by root
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2023-06-09 11:42 GMT
Find Nodes?
    Voting Booth?
    How often do you go to conferences?

    Results (35 votes). Check out past polls.