"font-size: " % # "pt; " % ;
: font-css, ( font -- )
- "font-family: " % % "; " % ;
+ [ "font-family: " % % "; " % ]
+ [ "monospace" = [ "white-space: pre-wrap; " % ] when ] bi ;
MACRO: make-css ( pairs -- str )
[ '[ _ of [ _ execute ] when* ] ] { } assoc>map
: padding-css, ( padding -- )
first2 (padding-css,) ;
-CONSTANT: pre-css "white-space: pre; font-family: monospace; "
+: width-css, ( width -- )
+ "width: " % # "px; " % ;
: div-css-style ( style -- str )
[ span-css-style ]
{ page-color bg-css, }
{ border-color border-css, }
{ inset padding-css, }
+ { wrap-margin width-css, }
} make-css
- ] [ wrap-margin of [ pre-css append ] unless ] tri
- "display: inline-block; " 3append ;
+ ] bi "display: inline-block; " 3append ;
: div-tag ( xml style -- xml' )
div-css-style