Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

Commit b3f611a

Browse files
committed
Separate quick jump css file from ocean theme
1 parent cd05fdb commit b3f611a

File tree

5 files changed

+164
-149
lines changed

5 files changed

+164
-149
lines changed

haddock-api/haddock-api.cabal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ data-dir:
2222
data-files:
2323
html/quick-jump.min.js
2424
html/haddock-bundle.min.js
25+
html/quick-jump.css
2526
html/solarized.css
2627
html/highlight.js
2728
html/Classic.theme/haskell_icon.gif

haddock-api/resources/html/Ocean.std-theme/ocean.css

Lines changed: 0 additions & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -614,152 +614,3 @@ div#style-menu-holder {
614614
}
615615

616616
/* @end */
617-
618-
/* @group Search box */
619-
620-
#search {
621-
position: fixed;
622-
top: 3.2em;
623-
bottom: 0;
624-
left: calc(50% - 22em);
625-
width: 44em;
626-
z-index: 1000;
627-
pointer-events: none;
628-
}
629-
630-
#search.hidden {
631-
display: none;
632-
}
633-
634-
#search-form, #search-results {
635-
box-shadow: 2px 2px 6px rgb(199, 204, 208);
636-
pointer-events: all;
637-
}
638-
639-
#search-form input {
640-
font-size: 1.25em; line-height: 2.3em; height: 2.4em;
641-
display: block;
642-
box-sizing: border-box;
643-
width: 100%;
644-
padding: 0 0.75em;
645-
border: 0.05em solid rgb(151, 179, 202);
646-
}
647-
648-
#search input:focus {
649-
outline: none;
650-
}
651-
652-
#search-results {
653-
top: 3em;
654-
max-height: calc(100% - 3em);
655-
box-sizing: border-box;
656-
border-width: 0 0.05em 0.05em;
657-
border-style: solid;
658-
border-color: #b2d5fb;
659-
background: #e8f3ff;
660-
overflow-y: auto;
661-
}
662-
663-
#search-results > ul {
664-
margin: 0;
665-
list-style: none;
666-
}
667-
668-
#search-results > ul > li,
669-
#search-results > p,
670-
#search-results > table {
671-
padding: 0.5em 1em;
672-
margin: 0;
673-
}
674-
675-
#search-results > ul > li {
676-
border-bottom: 1px solid #b2d5fb;
677-
}
678-
679-
#search-results > ul > li > ul {
680-
list-style: none;
681-
}
682-
683-
.search-module h4 {
684-
margin: 0;
685-
}
686-
687-
.search-module > ul {
688-
margin: 0.5em 0 0.5em 2em;
689-
}
690-
691-
.search-module > ul > li > a[href] {
692-
display: block;
693-
color: inherit;
694-
padding: 0.25em 0.5em;
695-
}
696-
697-
.search-module > ul > li > a[href].active-link {
698-
background: #faf9dc;
699-
}
700-
701-
.search-module a[href]:hover {
702-
text-decoration: none;
703-
}
704-
705-
.search-result a a {
706-
pointer-events: none;
707-
}
708-
709-
.search-result ul.subs {
710-
display: inline-block;
711-
margin: 0; padding: 0;
712-
}
713-
714-
.search-result ul.subs li {
715-
display: none;
716-
}
717-
718-
.search-result ul.subs::after {
719-
display: inline-block;
720-
content: "...";
721-
color: rgb(78,98,114);
722-
margin: 0 0.25em;
723-
}
724-
725-
.more-results {
726-
color: rgb(99, 141, 173);
727-
position: relative;
728-
}
729-
730-
.more-results::before {
731-
content: "+";
732-
display: inline-block;
733-
color: #b2d5fb;
734-
font-weight: bold;
735-
font-size: 1.25em; line-height: inherit;
736-
position: absolute;
737-
left: -1em;
738-
}
739-
740-
.keyboard-shortcuts {
741-
line-height: 1.6em;
742-
}
743-
744-
.keyboard-shortcuts th {
745-
color: rgb(78,98,114);
746-
}
747-
748-
.keyboard-shortcuts td:first-child,
749-
.keyboard-shortcuts th:first-child {
750-
text-align: right;
751-
padding-right: 0.6em;
752-
}
753-
754-
.key {
755-
display: inline-block;
756-
font-size: 0.9em;
757-
min-width: 0.8em; line-height: 1.2em;
758-
text-align: center;
759-
background: #b2d5fb;
760-
border: 1px solid #74a3d6;
761-
padding: 0 0.2em;
762-
margin: 0 0.1em;
763-
}
764-
765-
/* @end */
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
/* @group Search box layout */
2+
3+
#search {
4+
position: fixed;
5+
top: 3.2em;
6+
bottom: 0;
7+
left: calc(50% - 22em);
8+
width: 44em;
9+
z-index: 1000;
10+
pointer-events: none;
11+
}
12+
13+
#search.hidden {
14+
display: none;
15+
}
16+
17+
#search-form, #search-results {
18+
box-shadow: 2px 2px 6px rgb(199, 204, 208);
19+
pointer-events: all;
20+
}
21+
22+
#search-form input {
23+
font-size: 1.25em; line-height: 2.3em; height: 2.4em;
24+
display: block;
25+
box-sizing: border-box;
26+
width: 100%;
27+
margin: 0;
28+
padding: 0 0.75em;
29+
border: 0.05em solid rgb(151, 179, 202);
30+
}
31+
32+
#search input:focus {
33+
outline: none;
34+
}
35+
36+
#search-results {
37+
top: 3em;
38+
max-height: calc(100% - 3em);
39+
box-sizing: border-box;
40+
border-width: 0 0.05em 0.05em;
41+
border-style: solid;
42+
border-color: #b2d5fb;
43+
background: #e8f3ff;
44+
overflow-y: auto;
45+
}
46+
47+
/* @end */
48+
49+
/* @group search results */
50+
51+
#search-results > ul {
52+
margin: 0;
53+
list-style: none;
54+
}
55+
56+
#search-results > ul > li,
57+
#search-results > p,
58+
#search-results > table {
59+
padding: 0.5em 1em;
60+
margin: 0;
61+
}
62+
63+
#search-results > ul > li {
64+
border-bottom: 1px solid #b2d5fb;
65+
}
66+
67+
#search-results > ul > li > ul {
68+
list-style: none;
69+
}
70+
71+
.search-module h4 {
72+
margin: 0;
73+
}
74+
75+
.search-module > ul {
76+
margin: 0.5em 0 0.5em 2em;
77+
}
78+
79+
.search-module > ul > li > a[href] {
80+
display: block;
81+
color: inherit;
82+
padding: 0.25em 0.5em;
83+
}
84+
85+
.search-module > ul > li > a[href].active-link {
86+
background: #faf9dc;
87+
}
88+
89+
.search-module a[href]:hover {
90+
text-decoration: none;
91+
}
92+
93+
.search-result a a {
94+
pointer-events: none;
95+
}
96+
97+
.search-result ul.subs {
98+
display: inline-block;
99+
margin: 0; padding: 0;
100+
}
101+
102+
.search-result ul.subs li {
103+
display: none;
104+
}
105+
106+
.search-result ul.subs::after {
107+
display: inline-block;
108+
content: "...";
109+
color: rgb(78,98,114);
110+
margin: 0 0.25em;
111+
}
112+
113+
.more-results {
114+
color: rgb(99, 141, 173);
115+
position: relative;
116+
}
117+
118+
.more-results::before {
119+
content: "+";
120+
display: inline-block;
121+
color: #b2d5fb;
122+
font-weight: bold;
123+
font-size: 1.25em; line-height: inherit;
124+
position: absolute;
125+
left: -1em;
126+
}
127+
128+
/* @end */
129+
130+
/* @group Keyboard shortcuts table */
131+
132+
.keyboard-shortcuts {
133+
line-height: 1.6em;
134+
}
135+
136+
.keyboard-shortcuts th {
137+
color: rgb(78,98,114);
138+
}
139+
140+
.keyboard-shortcuts td:first-child,
141+
.keyboard-shortcuts th:first-child {
142+
text-align: right;
143+
padding-right: 0.6em;
144+
}
145+
146+
.key {
147+
display: inline-block;
148+
font-size: 0.9em;
149+
min-width: 0.8em; line-height: 1.2em;
150+
text-align: center;
151+
background: #b2d5fb;
152+
border: 1px solid #74a3d6;
153+
padding: 0 0.2em;
154+
margin: 0 0.1em;
155+
}
156+
157+
/* @end */

haddock-api/src/Haddock/Backends/Xhtml.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ copyHtmlBits odir libdir themes = do
107107
copyCssFile f = copyFile f (combine odir (takeFileName f))
108108
copyLibFile f = copyFile (joinPath [libhtmldir, f]) (joinPath [odir, f])
109109
mapM_ copyCssFile (cssFiles themes)
110+
copyCssFile (joinPath [libhtmldir, quickJumpCssFile])
110111
copyLibFile haddockJsFile
111112
copyLibFile jsQuickJumpFile
112113
return ()
@@ -118,6 +119,7 @@ headHtml docTitle themes mathjax_url =
118119
meta ! [httpequiv "Content-Type", content "text/html; charset=UTF-8"],
119120
thetitle << docTitle,
120121
styleSheet themes,
122+
thelink ! [ rel "stylesheet", thetype "text/css", href quickJumpCssFile] << noHtml,
121123
script ! [src haddockJsFile, emptyAttr "async", thetype "text/javascript"] << noHtml,
122124
script ! [src mjUrl, thetype "text/javascript"] << noHtml
123125
]

haddock-api/src/Haddock/Utils.hs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ module Haddock.Utils (
2424
moduleIndexFrameName, mainFrameName, synopsisFrameName,
2525
subIndexHtmlFile,
2626
haddockJsFile, jsQuickJumpFile,
27+
quickJumpCssFile,
2728

2829
-- * Anchor and URL utilities
2930
moduleNameUrl, moduleNameUrl', moduleUrl,
@@ -331,6 +332,9 @@ haddockJsFile = "haddock-bundle.min.js"
331332
jsQuickJumpFile :: String
332333
jsQuickJumpFile = "quick-jump.min.js"
333334

335+
quickJumpCssFile :: String
336+
quickJumpCssFile = "quick-jump.css"
337+
334338
-------------------------------------------------------------------------------
335339
-- * Misc.
336340
-------------------------------------------------------------------------------

0 commit comments

Comments
 (0)