logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Mactaggart" <st...@golftime.com.au>
Subject RE: EnhancedHTMLAppender
Date Wed, 08 Sep 2004 00:31:46 GMT
Long time no speak,

I've been very slack on this front and as it seems that 1.3 is gathering
steam to get released I hope to get the EnhancedHTMLAppender completed in
the next week.

After leaving it so long, and having to re-read the discussion to work out
where we were up to I think its time to solve this CSS issue.

My suggestion is to hard-code styles into the top of the style sheet and
provide the user a property to change a link to override the default styles,
as suggested here:

> ><HEAD>
> >   <STYLE TYPE="text/css">
> >     <!--
> >       BODY { background-color: white }
> >     -->
> >   </STYLE>
> >   <LINK REL=StyleSheet HREF="http://apache.org/~ceki/yellow.css" 
> > TITLE="Basic"/>
> ></HEAD>

I'll update the code over the next few days to support this and get an
update file posted back to the list.

Sorry for the HUGE delay,

Steve


> -----Original Message-----
> From: Jacob Kjome [mailto:hoju@visi.com] 
> Sent: Saturday, 5 June 2004 9:51 AM
> To: Log4J Developers List
> Subject: RE: EnhancedHTMLAppender
> 
> At 02:51 PM 6/4/2004 +0200, you wrote:
> >Hi Jacob,
> >
> >I very much like the solution you outlined.
> 
> Happy to hear :-)
> 
> >As you mentioned, my observation also show that the order in which
> >styles are listed has its importance.
> >
> >For example, in the following sample, the output will be white as the
> >embedded style listed last overrides the external style sheet listed
> >first
> >
> ><HEAD>
> >   <LINK REL=StyleSheet HREF="http://apache.org/~ceki/yellow.css" 
> > TITLE="Basic"/>
> >
> >   <STYLE TYPE="text/css">
> >     <!--
> >      BODY { background-color: white }
> >     -->
> >   </STYLE>
> ></HEAD>
> >
> >Similarly, in the following sample, the output will be yellow as the
> >external style listed last overrides the embedded style sheet listed
> >first
> >
> ><HEAD>
> >   <STYLE TYPE="text/css">
> >     <!--
> >       BODY { background-color: white }
> >     -->
> >   </STYLE>
> >   <LINK REL=StyleSheet HREF="http://apache.org/~ceki/yellow.css" 
> > TITLE="Basic"/>
> ></HEAD>
> 
> Yep
> 
> >Is this precedence rule documented somewhere?
> 
> Actually, this is the definition of the cascade.
> http://www.w3.org/TR/CSS21/cascade.html#cascade
> 
> Here's a more clear order of the cascade presented by Ian 
> Hixson, one of 
> the CSS spec authors
> http://bugzilla.mozilla.org/show_bug.cgi?id=43220#c105
> 
> For our purposes, the main thing we need to remember is rule 
> #4 of the spec:
> 
> "Finally, sort by order specified: if two rules have the same weight, 
> origin and specificity, the latter specified wins. Rules in 
> imported style 
> sheets are considered to be before any rules in the style 
> sheet itself. "
> 
> As long as the user specified style sheet writes rules with 
> at least the 
> same weight and specificity of the default style sheet, the 
> user specified 
> style sheet will successfully override the default if it 
> comes last in the 
> cascading order.
> 
> 
> Jake
> 
> 
> >If take the precedence rule for granted, then as you suggested, we
> >could embed a default style in the HTML and override it with a custom
> >style specified by the user.
> >
> >We could even have:
> >
> ><HEAD>
> >   <STYLE TYPE="text/css">
> >     <!--
> >       default style here
> >     -->
> >   </STYLE>
> >   <LINK REL=StyleSheet 
> HREF="http://logging.apache.org/css/default.css" 
> > TITLE="Default style"/>
> >   <LINK REL=StyleSheet HREF="user specified css" 
> TITLE="User defined"/>
> ></HEAD>
> >
> >In summary, we should be able to provide robust solutions as long as
> >the precedence rules are clearly understood.
> 
> Yep, and they certainly are well understood.  This is a good 
> solution.  BTW, what "default style" would you provide in the 
> default.css 
> that the inline <style> wouldn't already have?  I see that as 
> redundant.  However, having a style sheet with media="print" defining 
> styles to be used only when printing might be valuable to link from 
> logging.apache.org.
> 
> 
> Jake
> 
> 
> 
> >At 06:07 AM 6/4/2004, Jacob Kjome wrote:
> >
> >>I have to imagine that the style stuff for 
> EnhancedHTMLLayout would be 
> >>pretty sparse.  The structure of the document will be pretty 
> >>standard.  In-lining styles (meaning <sometag style="">) in 
> this case 
> >>would be tantamount to using <font> tags given the sheer 
> amount of markup 
> >>written.  However, one can add a style for the whole 
> document in the head 
> >>without having to import it which solves both the redundant 
> style="" and 
> >>non-existent external file issues.  In fact, that can be 
> the default 
> >>stylesheet and a linked one can be added later in the 
> cascade to provide 
> >>an override for anyone to utilize.  If the linked one 
> doesn't exist, only 
> >>the default applies.  If the linked one exists, then that 
> linked css file 
> >>has the ability to override and extend the styles.  For instance...
> >>
> >><style type="text/css">
> >>html, body { ... }
> >>a { .... }
> >>...
> >>...
> >>...
> >></style>
> >><link rel="Stylesheet" type="text/css" href="[user defined 
> path set via 
> >>some property of layout]/log4jhtmllayout.css" title="Custom Style">
> >>
> >>One can also provide alternate style sheets or even ones 
> specifically for 
> >>printing.  These can be either always provided with 
> standard css file 
> >>names and only used in the cascade if they exist (as is 
> shown above) or 
> >><link> tags can be written as they are set via some property of the 
> >>Layout class.
> >>
> >>Thoughts?
> >>
> >>Jake
> >
> >--
> >Ceki Gülcü
> >
> >      For log4j documentation consider "The complete log4j manual"
> >      ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> >For additional commands, e-mail: log4j-dev-help@logging.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-dev-help@logging.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message