/collects/meta/web/common/resources.rkt

http://github.com/gmarceau/PLT · Racket · 123 lines · 106 code · 10 blank · 7 comment · 0 complexity · 2e77798158a27e5010fea679dac6f3b8 MD5 · raw file

  1. #lang at-exp racket/base
  2. (require scribble/html)
  3. ;; These are some resources that are shared across different toplevel
  4. ;; sites. They could be included from a single place, but then when one
  5. ;; machine crashes the rest won't work right. (Note: do not add
  6. ;; resources that are specific to only one site here, do so in the
  7. ;; site's "resources.rkt" file)
  8. (require "utils.rkt")
  9. (provide make-logo make-icon make-style
  10. navbar-style page-sizes font-family) ; needed for the blog template
  11. (define ((make-file-copier file) dir)
  12. (copyfile-resource (in-here file) (web-path dir file)))
  13. (define make-logo (make-file-copier "logo.png"))
  14. (define make-icon (make-file-copier "plticon.ico"))
  15. (define (make-style dir)
  16. (resource (web-path dir "plt.css")
  17. (file-writer output (list racket-style "\n"))
  18. (lambda (url) (link rel: "stylesheet" type: "text/css"
  19. href: url title: "default"))))
  20. (define page-sizes
  21. @list{
  22. margin-left: auto;
  23. margin-right: auto;
  24. width: 45em;
  25. })
  26. (define font-family
  27. @list{
  28. font-family: Optima, Arial, Verdana, Helvetica, sans-serif;
  29. })
  30. (define navbar-style
  31. ;; All of these are made to apply only inside `racketnav', so the styles can
  32. ;; be used in places with their own CSS (eg, blog.racket-lang.org)
  33. @list{
  34. .racketnav {
  35. background-color: #000000;
  36. color: #ffffff;
  37. margin-bottom: 1em;
  38. padding: 0.5em 0em;
  39. white-space: nowrap;
  40. }
  41. .racketnav a {
  42. color: #ffffff;
  43. text-decoration: none;
  44. }
  45. .racketnav .navcontent {
  46. @page-sizes
  47. @font-family
  48. }
  49. .racketnav .navtitle {
  50. font-size: xx-large;
  51. font-weight: bold;
  52. }
  53. .racketnav .navitem {
  54. text-decoration: none;
  55. font-size: 88%;
  56. }
  57. .racketnav .navlink a {
  58. padding: 0em 1em;
  59. }
  60. .racketnav .navcurlink a {
  61. padding: 0em 1em;
  62. background-color: #555555;
  63. }
  64. .racketnav .navlink a:hover,
  65. .racketnav .navcurlink a:hover {
  66. background-color: #888888;
  67. }
  68. .racketnav .navlinkcell {
  69. text-align: center;
  70. }
  71. .racketnav .helpiconcell {
  72. text-align: right;
  73. vertical-align: top;
  74. }
  75. .racketnav .helpicon {
  76. font-weight: bold;
  77. font-size: 88%;
  78. }
  79. })
  80. (define racket-style
  81. @list{
  82. @; ---- generic styles ----
  83. html {
  84. overflow-y: scroll;
  85. }
  86. body {
  87. color: black;
  88. background-color: white;
  89. @font-family
  90. margin: 0px;
  91. padding: 0px;
  92. }
  93. a {
  94. text-decoration: none;
  95. }
  96. a:hover {
  97. text-decoration: underline;
  98. }
  99. @; ---- content styles ----
  100. .bodycontent {
  101. @page-sizes
  102. }
  103. @; ---- styles for the navbar ----
  104. @navbar-style
  105. @; ---- styles for extras ----
  106. .parlisttitle {
  107. margin-bottom: 0.5em;
  108. }
  109. .parlistitem {
  110. margin-bottom: 0.5em;
  111. margin-left: 2em;
  112. }
  113. })