Handbook
Glossary
factorcode.org
css-style ( style -- style' )
Vocabulary
help.html
Inputs
style
an
object
Outputs
style'
an
object
Definition
USING:
formatting
kernel
math
math.parser
regexp
sequences
splitting
;
IN:
help.html
:
css-style
( style -- style' )
R/ font-size: \d+pt;/
[
"font-size: "
?head
drop
"pt;"
?tail
drop
string>number
2
-
"font-size: %dpt;"
sprintf
]
re-replace-with
R/ padding: \d+px;/
[
"padding: "
?head
drop
"px;"
?tail
drop
string>number
dup
even?
[
2
*
1
+
]
[
2
*
]
if
number>string
"padding: "
"px;"
surround
]
re-replace-with
R/ width: \d+px;/
[
drop
""
]
re-replace-with
R/ font-family: monospace;/
[
" white-space: pre-wrap; line-height: 125%;"
append
]
re-replace-with
;