fix-css-style ( style -- style' )


Vocabulary
help.html

Inputs
stylean object


Outputs
style'an object


Definition


: fix-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 2 *
number>string "padding: " "px;" surround
] re-replace-with R/ width: \d+px;/
[ drop "" ] re-replace-with R/ font-family: monospace;/ [
" margin-top: 0.5em; margin-bottom: 0.5em; width: fit-content;..."
append
] re-replace-with ;