html.streams: allow non-equal padding values.

db4
John Benediktsson 2013-04-11 14:47:57 -07:00
parent 6b94cf2e7f
commit ab4e380c04
1 changed files with 9 additions and 2 deletions

View File

@ -101,8 +101,15 @@ M: html-span-stream dispose
: border-css, ( border -- )
"border: 1px solid #" % hex-color, "; " % ;
: (padding-css,) ( horizontal vertical -- )
2dup = [
drop "padding: " % # "px; " %
] [
"padding: " % # "px " % # "px; " %
] if ;
: padding-css, ( padding -- )
first2 "padding: " % # "px " % # "px; " % ;
first2 (padding-css,) ;
CONSTANT: pre-css "white-space: pre; font-family: monospace;"
@ -129,7 +136,7 @@ M: html-block-stream dispose
end-sub-stream format-html-div ;
: border-spacing-css, ( pair -- )
first2 max 2 /i "padding: " % # "px; " % ;
first2 [ 2 /i ] bi@ (padding-css,) ;
: table-style ( style -- str )
{