Re: [1.3.b69] CSS and Chat
Posted: Sat Jun 19, 2010 6:21 pm
Nice looking stuff, maybe I'll create some automated macros for my treasure.
Not from what I can tell, although macro output does get ... altered ... considerably on the way to chat. For example, a macro containing this:Azhrei wrote: The first element that appears in the chat panel which is NOT valid inside the <head> is probably what triggers the Java code to switch from the head to the body. And once switched, you can't get back.
Code: Select all
<link rel="stylesheet" type="text/css" href="styles.css@[R: getMacroLocation()]"> <!-- Custom stylesheet. "@this" will not work -->
<!-----===== OnCampaignLoad =====----->
<b>HTML START</b>
<p>paragraph <em>of text</em>.</p>
Code: Select all
<html>
<head>
<style type="text/css">
<!--
body { font-family: sans-serif; font-size: 12pt }
div { margin-bottom: 5px }
span.roll { background-color: #efefef; background-attachment: scroll; background-repeat: repeat }
span.trustedprefix { background-color: #D8E9F6; background-repeat: repeat; background-attachment: scroll; color: #000000 }
-->
</style>
</head>
<body id="body">
<div>
<table cellpadding="0">
<tr>
<td style="padding-right: 5px" valign="top" width="40">
<img src="asset://1f5ffdc593cfe553ae7ade46afd1174c-40">
</td>
<td style="margin-right: 5px" valign="top">
Lib:style:
</td>
<td valign="top">
</td>
</tr>
<!-- Custom stylesheet. "@this" will not work -->
<!-----===== OnCampaignLoad =====------>
<tr>
<td>
HTML START
<p rel="stylesheet" type="text/css" href="styles.css@Lib:style">
paragraph <em>of text</em>.
</p>
</td>
</tr>
</table>
</div>
</body>
</html>
I would actually consider this an accessibility issue. The current preferences allow you to change the size of the font, but not the font face, or colours. Or all other manner of things CSS is designed for.Azhrei wrote:Some day we'll have an entry in the Campaign Properties where the GM can provide a URI to a global stylesheet. But don't hold your breath.
Well, I'm no expert but I know a little about it. And from what I've seen, the Stylesheet object would need to be applied to each Document object after it's created. That means anywhere in the code that pops up an HTMLPane (and hence instantiates a Document object), anywhere that has HTML inside a label or button or checkbox or dropdown list, or anywhere else that HTML is rendered would need to have the Stylesheet object assigned to it. And that's a whole boatload of code we're talking about changing!biodude wrote:I don't know anything about the technicalities of how the chat is rendered,
The UI is not a problem. There are lots of ways to answer the question of how to get the CSS into the program in the first place -- that's a piece of cake. It's what has to be done with it once it's in there that's a problem.I'm just thinking from a user perspective.
Yea, and as noted in that thread, "better" still does not mean compliant with the current html/css standards by any stretch, so it's not a be all, end all solution. Plain and simple java is just behind the times in ways to support current html standards... which is probably why browsers are not written in java very often.Azhrei wrote:We really need a better HTML rendering engine, but that's been discussed before as well. I weighed in on that discussion as did Craig, jfrazierjr, and Phergus (IIRC). It's a pretty old thread now; perhaps 8 months or so...?