0 Style Developers: Migrating to 3.0.2
Michael Morris edited this page 2013-06-01 16:32:09 -07:00

A style can target specific IRC related events starting with version 3.0.2 of Textual allowing different styling for lines that share the same line type. The newMessagePostedWithoutSender and newMessagePostedWithSender templates now inherit the token rawCommand. The value of this token is the actual command associated with the text being printed. This can be either an actual IRC command such as PRIVMSG or NOTICE. It can also be a raw numeric such as 001, 002, or 003.

When using the default templates of Textual, the rawCommand token will be placed in the command= attribute of the top-most div of a line.

The following is an example of customizing the output for a specific event:

/* Message of the Day (MOTD) */
/* 720, 721, 722 are used by ShadowIRCd for Oper MOTD. */
/* 372, 375, 376 are normal MOTD shared by several IRCds. */ 

body div.line[command="372"],
body div.line[command="721"] {
	border: none;
	padding-top: 3px;
	padding-bottom: 3px;
}

body div.line[command="375"],
body div.line[command="720"] { /* Start. */
	border-bottom: none;
	padding-top: 2px;
	padding-bottom: 3px;
}

body div.line[command="376"],
body div.line[command="722"] { /* End. */
	border-top: none;
	padding-top: 3px;
	padding-bottom: 3px;
}

body div.line[command="372"] .message,
body div.line[command="375"] .message,
body div.line[command="376"] .message 
body div.line[command="720"] .message,
body div.line[command="721"] .message,
body div.line[command="722"] .message {
	font-family: "Menlo" !important;
}