Andrew Pollack's Blog

Technology, Family, Entertainment, Politics, and Random Noise

Config driven CSS websites in Domino - What do you tokenize?

By Andrew Pollack on 07/04/2008 at 01:58 PM EDT

I'm soliciting ideas & best practices on building configurable "theme like" CSS for a Domino site. I'm in the midst of a design refresh for this blog, as well as the main NCT site. They are both functional but truly ugly. I've decided to merge the two into a much more integrated self -- but more on that later. As part of the redesign work, I've been hand crafting a bit of HTML and CSS that will eventually become the framework into which all the active content will be placed. Every time I do this, I try to come up with the best scheme for making the site easily updated with new colors and so on.

The whole point of CSS is that it makes up for the lack of tokenization in HTML. That is to say, there is no "Meta-Tag" that you can use for colors in html tags so that you can define your colors in one place. Instead of every table cell you want to be "red" having to have a color tag on the table cell tag, you define your table cells with a "class" and then you assign your colors and things there.

Great, now the bad news. CSS is one of long line of terrible standards created during the hype of the late 90's when foolish investors paid six figure salaries to 20 something year old CIS majors fresh out of university, gave them big offices, swimming pools, game rooms, and a bunch of equipment with the sole job of creating "something interesting".

CSS, designed to solve the problem of no tokenization in HTML, has no tokenization. You end up with long CSS files where the same color codes and file paths are repeated over and over, making updates painful.

We can get around that in Domino, by generating our pages on the fly. Other systems use external scripting to do the same thing. Where you would normally put a color tag, you might embed a token like ${MainBGcolor}. A scripting tool can then run and quickly replace all instances of that token in your template with the color you've assigned, and produce an output file containing your actual CSS. In Domino, instead of tokens we use <computed text&rt;.

All of these solutions talk about HOW you can tokenize your CSS ahead of time, but the better question is still "WHAT" do you tokenize and how? Colors are the obvious choice, background images? Icon images? What do you tokenize when you build your css?

There are  - loading -  comments....

re: Config driven CSS websites in Domino - What do you tokenize?By Nathan T. Freeman on 07/04/2008 at 04:44 PM EDT
Hrmmm... I tend to wonder... if you're doing that much tokenization in your
CSS, are you correctly using the CASCADING aspect of it?

I can't think of a circumstance where I wished I'd had tokenization like that.
As I ponder it, it seems like I'd be over-classing and not using the
hierarchical nature of CSS if I did run into that problem.

Like.... why would you need to define MainBGColor in more than one place?
That's just the BODY {background-color: }

Even if you were looking to do individual cells or something, then it's just TD
Probably so --By Andrew Pollack on 07/04/2008 at 05:24 PM EDT
-- the first real serious use I made of CSS was building an earlier version of
this blog site. Since, I've done a great deal more with it and with html and
javascript in general (this blog site was a learning exercise).

These days I do fairly large "household name" sites that most people who read
this would recognize, and that's forced me to get deeper into the browser
variants and so on.

In answer to your question: First is "yes" I'm probably not using it in the
most efficient way.

The second answer is that I often will try to stick with a color scheme that
uses the same colors for different things on the site. They don't necessarily
cascade from one another.

The third answer is that cascading doesn't always work. Anchor references are
among my biggest complain in that regard.
re: Probably so --By Nathan T. Freeman on 07/05/2008 at 07:10 AM EDT
Bear in mind that any element can have more than one class as well. So you
could have DIV.sidebar and DIV.comment (which on this side share a background
color) but you could also have, which just set the
background, border and text colors, and assign your comments to have class
"comment blue-background" and you sidebar to have "sidebar blue-background."

Then both would apply.

(Of course, the sidebar probably ought to be an ID instead of a class, but you
get the point.)
re: Config driven CSS websites in Domino - What do you tokenize?By Jim Knight on 07/04/2008 at 06:35 PM EDT
When I was building Struturo as a commercial venture, I was thinking it would
be easier for end users to modify the colors and sizes. I had color picker and
drop downs for header tags and paragraphs and lists. And it was pretty cool at
first but then I realized it was very limiting and I had to add more and more
fields to make it work right.
So I came to the conclusion that unless you are using one very bland design
that will not change much, this approach wouldn't work. It was a lot faster to
just plain type in the CSS and be able to tweak as text than to use fields or
tokens representing the individual properties.
What I did end up doing was a stylesheet or theme document with tabs for
header, main, col1, col2, etc so at least the end user could find things
easier. Then on the output form to the web, I formalize it into a flat text
The cool thing about Domino is that I could make the sheet appear one way with
tabs etc on Notes and flatten for the web.
re: Config driven CSS websites in Domino - What do you tokenize?By Ben Poole on 07/05/2008 at 11:59 AM EDT
I store all CSS in standard documents with an appropriate MIME type set. The
CSS itself is in a rich text field, allowing the use of colour formatting,
computed text, etc. Given all that, it's pretty easy to define a number of text
fields in the same document which store colour hex values. These fields can
then be referenced in the body of the CSS via computed text, making central
updates a breeze (i.e. define a colour "tag" and link that to one of these
colour fields).

Other Recent Stories...

  1. 09/04/2018With two big projects on hold, I suddenly find myself very available for new short and long term projects. In twenty five years, I don't think I've ever written an entry like this, but if you need the kind of work I do now would be a great time to get in touch. Both of the big projects I had lined up for late summer and early fall have been placed on hold and will be that way for a while. With the kids now all off at college and careers, I'm open to more travel than such than I have been in decades, but unless something else comes along, I'll be here working on updates to Second Signal and other things that ...... 
  2. 07/13/2018Who is HCL and why is it a good thing that they are now the ones behind Notes and Domino?We need to address some biases here. IBM has made a deal under which the Notes & Domino software and intellectual property is now being developed and maintained by HCL America. HCL America is part of the very large "HCL Technologies" company that has grown from its roots in India to become an 8 Billion Dollar company with a global presence in the IT Industry. You could be excused for initially believing, as many people do when they hear this, that "they've outsourced the code to India where they'll milk it ...... 
  3. 03/21/2018Domino Apps on IOS is a Game Changer. Quit holding back.BOOM. This will be as important for the platform as Traveler. If your company has ditched Notes and Domino, I feel sorry for you. For companies that do use Notes/Domino this is a game changer and Apple should be paying attention. Here's why: There are hundreds of little Notes client applications you'd never spend the time and money to build and deploy for your internal user base on IOS that we use Notes for all the time (those of us still using it). Now, those are suddenly ALL available on the iPad. ...... 
  4. 02/15/2018Andrew’s Proposed Gun Laws 
  5. 05/05/2016Is the growing social-sourced economy the modern back door into socialism? 
  6. 04/20/2016Want to be whitelisted? Here are some sensible rules for web site advertising 
  7. 12/30/2015Fantastic new series on Syfy called “The Expanse” – for people who love traditional science fiction 
  8. 10/20/2015My suggestion is to stay away from PayAnywhere(dot)com  
  9. 08/07/2015Here is one for you VMWARE gurus - particularly if you run ESXi without fancy drive arrays 
  10. 08/06/2015The Killer of Orphans (Orphan Documents) 
Click here for more articles.....

pen icon Comment Entry
Your Name
*Your Email
* Your email address is required, but not displayed.
Your thoughts....
Remember Me  

Please wait while your document is saved.