junglecoder.css.st
· 572 B · Smalltalk
Sin formato
Playground
body: {[
max-width: 800px:
width: 90%:
font-size: 20px:
font-family: %s[ Verdana, Geneva, Tahoma, sans-serif ]
margin-left: auto:
margin-right: auto:
]
body,input,textarea: {[
background: Theme .bg
color: Theme .fg
]
blockquote: {[
font-style: italic:
]
td: {[ margin: 5px: ]
a: {[ color: Theme .a ]
a:visited: {[ color: Theme .av ]
pre:has(code): {[
padding: 5px:
border: %s[ 1px teal solid ]
]
code: {[
color: burlywood:
white-space: nowrap:
]
"pre code" {[
white-space: unset:
]
h2,h3,h4,h5,h6: {[
margin-top: 40px:
]
| 1 | body: {[ |
| 2 | max-width: 800px: |
| 3 | width: 90%: |
| 4 | font-size: 20px: |
| 5 | font-family: %s[ Verdana, Geneva, Tahoma, sans-serif ] |
| 6 | margin-left: auto: |
| 7 | margin-right: auto: |
| 8 | ] |
| 9 | |
| 10 | body,input,textarea: {[ |
| 11 | background: Theme .bg |
| 12 | color: Theme .fg |
| 13 | ] |
| 14 | |
| 15 | blockquote: {[ |
| 16 | font-style: italic: |
| 17 | ] |
| 18 | td: {[ margin: 5px: ] |
| 19 | a: {[ color: Theme .a ] |
| 20 | |
| 21 | a:visited: {[ color: Theme .av ] |
| 22 | pre:has(code): {[ |
| 23 | padding: 5px: |
| 24 | border: %s[ 1px teal solid ] |
| 25 | ] |
| 26 | |
| 27 | code: {[ |
| 28 | color: burlywood: |
| 29 | white-space: nowrap: |
| 30 | ] |
| 31 | |
| 32 | "pre code" {[ |
| 33 | white-space: unset: |
| 34 | ] |
| 35 | |
| 36 | h2,h3,h4,h5,h6: {[ |
| 37 | margin-top: 40px: |
| 38 | ] |
| 39 | |
| 40 |
junglecoder.project.st
· 1.4 KiB · Smalltalk
Sin formato
Playground
css: fn[
temp[ { ]
{: fn[ >q
^[ @ ] " {" /nl
q> Array .[ of pairs ] each[ .[ 0 at ^[ >k ] 1 at ^[ >v ] ]
" " k ": " v ";" /nl
]
"}" /nl
]
Array .of .[ "" join ]
]
Theme: is-obj[
theme: fn[ av: <-[ swap ] a: <-[ swap ] fg: <-[ swap ] bg: <-[ swap ] ]
aqua: fn[ "#191e2a" "#21ef9f" "aqua" "#32e6e6" theme ]
forest: fn[ "#191e2a" "#daffac" "#32e667" "#32e667" theme ]
qbasic: fn[ "#0000aa" "#e8e8e8" "#aaaaaa" "#aaaaaa" theme ]
stark: fn[ "black" "white" "white" "grey" theme ]
]
project[
css-test: cmd[ Theme .aqua style.css.stk: css[ StackTalk .load-file ] /l ]
build: cmd[
Array .new >pages
"**/*.pstk" Directory .glob each[
if[ dup .file? :then pages .push :else void ]
]
"@pages/web.stk" StackTalk .load-file
#page: module/extend[ style.css.stk: ^[ Theme .aqua css[ StackTalk .load-file ] ] >style ]
#markup: module/extend[
link: fryn[ " " write @link> " " write ]
]
source-of: fn[ .[ Path .[ "." of[ path name ] relative ] ] ]
dest-of: fn[ .[
Path .[
"." of[ path name Path .parse .name ".html" + ] relative
"content/" "site/" String .replace ] ] ]
NB[ Directory .[ try[ site: rmr :catch void ] static: site: copy ] ]
Set .of[ pages each[ dest-of Path .parse .dir ] ] >destFolders
destFolders each[ Directory .ensure ]
pages each[ >p p. dest-of p> source-of /t StackTalk .load-file ]
]
]
| 1 | css: fn[ |
| 2 | temp[ { ] |
| 3 | {: fn[ >q |
| 4 | ^[ @ ] " {" /nl |
| 5 | q> Array .[ of pairs ] each[ .[ 0 at ^[ >k ] 1 at ^[ >v ] ] |
| 6 | " " k ": " v ";" /nl |
| 7 | ] |
| 8 | "}" /nl |
| 9 | ] |
| 10 | Array .of .[ "" join ] |
| 11 | ] |
| 12 | |
| 13 | Theme: is-obj[ |
| 14 | theme: fn[ av: <-[ swap ] a: <-[ swap ] fg: <-[ swap ] bg: <-[ swap ] ] |
| 15 | |
| 16 | aqua: fn[ "#191e2a" "#21ef9f" "aqua" "#32e6e6" theme ] |
| 17 | forest: fn[ "#191e2a" "#daffac" "#32e667" "#32e667" theme ] |
| 18 | qbasic: fn[ "#0000aa" "#e8e8e8" "#aaaaaa" "#aaaaaa" theme ] |
| 19 | stark: fn[ "black" "white" "white" "grey" theme ] |
| 20 | ] |
| 21 | |
| 22 | project[ |
| 23 | |
| 24 | css-test: cmd[ Theme .aqua style.css.stk: css[ StackTalk .load-file ] /l ] |
| 25 | build: cmd[ |
| 26 | Array .new >pages |
| 27 | "**/*.pstk" Directory .glob each[ |
| 28 | if[ dup .file? :then pages .push :else void ] |
| 29 | ] |
| 30 | "@pages/web.stk" StackTalk .load-file |
| 31 | #page: module/extend[ style.css.stk: ^[ Theme .aqua css[ StackTalk .load-file ] ] >style ] |
| 32 | #markup: module/extend[ |
| 33 | link: fryn[ " " write @link> " " write ] |
| 34 | ] |
| 35 | |
| 36 | source-of: fn[ .[ Path .[ "." of[ path name ] relative ] ] ] |
| 37 | dest-of: fn[ .[ |
| 38 | Path .[ |
| 39 | "." of[ path name Path .parse .name ".html" + ] relative |
| 40 | "content/" "site/" String .replace ] ] ] |
| 41 | NB[ Directory .[ try[ site: rmr :catch void ] static: site: copy ] ] |
| 42 | |
| 43 | Set .of[ pages each[ dest-of Path .parse .dir ] ] >destFolders |
| 44 | |
| 45 | destFolders each[ Directory .ensure ] |
| 46 | pages each[ >p p. dest-of p> source-of /t StackTalk .load-file ] |
| 47 | ] |
| 48 | ] |
| 49 |