From b7afd6844766d58cd33c02e7c9e908806e3f9227 Mon Sep 17 00:00:00 2001 From: alexbiehl Date: Wed, 21 Mar 2018 09:33:04 +0100 Subject: Add NewOcean theme And make it the default theme. --- .../html/NewOcean.std-theme/hslogo-16.png | Bin 0 -> 1684 bytes .../resources/html/NewOcean.std-theme/minus.gif | Bin 0 -> 56 bytes .../html/NewOcean.std-theme/new-ocean.css | 647 +++++++++++++++++++++ .../resources/html/NewOcean.std-theme/plus.gif | Bin 0 -> 59 bytes .../resources/html/NewOcean.std-theme/synopsis.png | Bin 0 -> 11327 bytes 5 files changed, 647 insertions(+) create mode 100644 haddock-api/resources/html/NewOcean.std-theme/hslogo-16.png create mode 100644 haddock-api/resources/html/NewOcean.std-theme/minus.gif create mode 100644 haddock-api/resources/html/NewOcean.std-theme/new-ocean.css create mode 100644 haddock-api/resources/html/NewOcean.std-theme/plus.gif create mode 100644 haddock-api/resources/html/NewOcean.std-theme/synopsis.png (limited to 'haddock-api/resources/html/NewOcean.std-theme') diff --git a/haddock-api/resources/html/NewOcean.std-theme/hslogo-16.png b/haddock-api/resources/html/NewOcean.std-theme/hslogo-16.png new file mode 100644 index 00000000..0ff8579f Binary files /dev/null and b/haddock-api/resources/html/NewOcean.std-theme/hslogo-16.png differ diff --git a/haddock-api/resources/html/NewOcean.std-theme/minus.gif b/haddock-api/resources/html/NewOcean.std-theme/minus.gif new file mode 100644 index 00000000..1deac2fe Binary files /dev/null and b/haddock-api/resources/html/NewOcean.std-theme/minus.gif differ diff --git a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css new file mode 100644 index 00000000..ddedcace --- /dev/null +++ b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css @@ -0,0 +1,647 @@ +/* @group Fundamentals */ + +* { margin: 0; padding: 0 } + +/* Is this portable? */ +html { + background-color: white; + width: 100%; + height: 100%; +} + +body { + background: white; + color: black; + text-align: left; + min-height: 100%; + position: relative; +} + +p { + margin: 0.8em 0; +} + +ul, ol { + margin: 0.8em 0 0.8em 2em; +} + +dl { + margin: 0.8em 0; +} + +dt { + font-weight: bold; +} +dd { + margin-left: 2em; +} + +a { text-decoration: none; } +a[href]:link { color: rgb(196,69,29); } +a[href]:visited { color: rgb(171,105,84); } +a[href]:hover { text-decoration:underline; } + +a[href].def:link, a[href].def:visited { color: black; } +a[href].def:hover { color: rgb(78, 98, 114); } + +/* @end */ + +/* @group Show and hide with JS */ + +body.js-enabled .hide-when-js-enabled { + display: none; +} + +/* @end */ + +/* @group Fonts & Sizes */ + +/* Basic technique & IE workarounds from YUI 3 + For reasons, see: + http://yui.yahooapis.com/3.1.1/build/cssfonts/fonts.css + */ + +body { + font:13px/1.4 sans-serif; + *font-size:small; /* for IE */ + *font:x-small; /* for IE in quirks mode */ +} + +h1 { font-size: 146.5%; /* 19pt */ } +h2 { font-size: 131%; /* 17pt */ } +h3 { font-size: 116%; /* 15pt */ } +h4 { font-size: 100%; /* 13pt */ } +h5 { font-size: 100%; /* 13pt */ } + +select, input, button, textarea { + font:99% sans-serif; +} + +table { + font-size:inherit; + font:100%; +} + +pre, code, kbd, samp, tt, .src { + font-family:monospace; + *font-size:108%; + line-height: 124%; +} + +.links, .link { + font-size: 85%; /* 11pt */ +} + +#module-header .caption { + font-size: 182%; /* 24pt */ +} + +#module-header .caption sup { + font-size: 70%; + font-weight: normal; +} + +.info { + font-size: 85%; /* 11pt */ +} + +#table-of-contents, #synopsis { + /* font-size: 85%; /* 11pt */ +} + + +/* @end */ + +/* @group Common */ + +.caption, h1, h2, h3, h4, h5, h6, summary { + font-weight: bold; + color: rgb(78,98,114); + margin: 0.8em 0 0.4em; +} + +* + h1, * + h2, * + h3, * + h4, * + h5, * + h6 { + margin-top: 2em; +} + +h1 + h2, h2 + h3, h3 + h4, h4 + h5, h5 + h6 { + margin-top: inherit; +} + +ul.links { + list-style: none; + text-align: left; + float: right; + display: inline-table; + margin: 0 0 0 1em; +} + +ul.links li { + display: inline; + border-left: 1px solid #d5d5d5; + white-space: nowrap; + padding: 0; +} + +ul.links li a { + padding: 0.2em 0.5em; +} + +.hide { display: none; } +.show { display: inherit; } +.clear { clear: both; } + +.collapser { + background-image: url(minus.gif); + background-repeat: no-repeat; +} +.expander { + background-image: url(plus.gif); + background-repeat: no-repeat; +} +.collapser, .expander { + padding-left: 14px; + margin-left: -14px; + cursor: pointer; +} +p.caption.collapser, +p.caption.expander { + background-position: 0 0.4em; +} + +.instance.collapser, .instance.expander { + margin-left: 0px; + background-position: left center; + min-width: 9px; + min-height: 9px; +} + +summary { + cursor: pointer; + outline: none; + list-style-image: url(plus.gif); + list-style-position: outside; +} + +details[open] > summary { + list-style-image: url(minus.gif); +} + +pre { + padding: 0.25em; + margin: 0.8em 0; + background: rgb(229,237,244); + overflow: auto; + border-bottom: 0.25em solid white; + /* white border adds some space below the box to compensate + for visual extra space that paragraphs have between baseline + and the bounding box */ +} + +.src { + background: #f0f0f0; + padding: 0.2em 0.5em; +} + +.keyword { font-weight: normal; } +.def { font-weight: bold; } + +@media print { + #footer { display: none; } +} + +/* @end */ + +/* @group Page Structure */ + +#content { + margin: 0 auto; + padding: 0 2em 6em; +} + +#package-header { + background: rgb(41,56,69); + border-top: 5px solid rgb(78,98,114); + color: #ddd; + padding: 0.2em; + position: relative; + text-align: left; +} + +#package-header .caption { + background: url(hslogo-16.png) no-repeat 0em; + color: white; + margin: 0 2em; + font-weight: normal; + font-style: normal; + padding-left: 2em; +} + +#package-header a:link, #package-header a:visited { color: white; } +#package-header a:hover { background: rgb(78,98,114); } + +#module-header .caption { + color: rgb(78,98,114); + font-weight: bold; + border-bottom: 1px solid #ddd; +} + +table.info { + float: right; + padding: 0.5em 1em; + border: 1px solid #ddd; + color: rgb(78,98,114); + background-color: #fff; + max-width: 40%; + border-spacing: 0; + position: relative; + top: -0.5em; + margin: 0 0 0 2em; +} + +.info th { + padding: 0 1em 0 0; +} + +div#style-menu-holder { + position: relative; + z-index: 2; + display: inline; +} + +#style-menu { + position: absolute; + z-index: 1; + overflow: visible; + background: #374c5e; + margin: 0; + text-align: center; + right: 0; + padding: 0; + top: 1.25em; +} + +#style-menu li { + display: list-item; + border-style: none; + margin: 0; + padding: 0; + color: #000; + list-style-type: none; +} + +#style-menu li + li { + border-top: 1px solid #919191; +} + +#style-menu a { + width: 6em; + padding: 3px; + display: block; +} + +#footer { + background: #ddd; + border-top: 1px solid #aaa; + padding: 0.5em 0; + color: #666; + text-align: center; + position: absolute; + bottom: 0; + width: 100%; + height: 3em; +} + +/* @end */ + +/* @group Front Matter */ + +#table-of-contents { + float: right; + clear: right; + background: #faf9dc; + border: 1px solid #d8d7ad; + padding: 0.5em 1em; + max-width: 20em; + margin: 0.5em 0 1em 1em; +} + +#table-of-contents .caption { + text-align: center; + margin: 0; +} + +#table-of-contents ul { + list-style: none; + margin: 0; +} + +#table-of-contents ul ul { + margin-left: 2em; +} + +#description .caption { + display: none; +} + +#synopsis { + display: block; + position: fixed; + right: 0; + height: 80%; + top: 10%; + padding: 0; + max-width: 75%; + /* Ensure that synopsis covers everything (including MathJAX markup) */ + z-index: 1; +} + +#synopsis summary { + display: block; + float: left; + width: 29px; + color: rgba(255,255,255,0); + height: 110px; + margin: 0; + font-size: 1px; + padding: 0; + background: url(synopsis.png) no-repeat 0px -8px; +} + +#synopsis details[open] > summary { + background: url(synopsis.png) no-repeat -64px -8px; +} + +#synopsis ul { + height: 100%; + overflow: auto; + padding: 0.5em; + margin: 0; +} + +#synopsis ul ul { + overflow: hidden; +} + +#synopsis ul, +#synopsis ul li.src { + background-color: #faf9dc; + white-space: nowrap; + list-style: none; + margin-left: 0; +} + +/* @end */ + +/* @group Main Content */ + +#interface div.top { margin: 2em 0; } +#interface h1 + div.top, +#interface h2 + div.top, +#interface h3 + div.top, +#interface h4 + div.top, +#interface h5 + div.top { + margin-top: 1em; +} +#interface .src .selflink, +#interface .src .link { + float: right; + color: #919191; + background: #f0f0f0; + padding: 0 0.5em 0.2em; + margin: 0 -0.5em 0 0; + -moz-user-select: none; +} +#interface .src .selflink { + border-left: 1px solid #919191; + margin: 0 -0.5em 0 0.5em; +} + +#interface span.fixity { + color: #919191; + border-left: 1px solid #919191; + padding: 0.2em 0.5em 0.2em 0.5em; + margin: 0 -1em 0 1em; +} + +#interface span.rightedge { + border-left: 1px solid #919191; + padding: 0.2em 0 0.2em 0; + margin: 0 0 0 1em; +} + +#interface table { border-spacing: 2px; } +#interface td { + vertical-align: top; + padding-left: 0.5em; +} + +#interface td.doc p { + margin: 0; +} +#interface td.doc p + p { + margin-top: 0.8em; +} + +.doc table { + border-collapse: collapse; + border-spacing: 0px; +} + +.doc th, +.doc td { + padding: 5px; + border: 1px solid #ddd; +} + +.doc th { + background-color: #f0f0f0; +} + +.clearfix:after { + clear: both; + content: " "; + display: block; + height: 0; + visibility: hidden; +} + +.subs ul { + list-style: none; + display: table; + margin: 0; +} + +.subs ul li { + display: table-row; +} + +.subs ul li dfn { + display: table-cell; + font-style: normal; + font-weight: bold; + margin: 1px 0; + white-space: nowrap; +} + +.subs ul li > .doc { + display: table-cell; + padding-left: 0.5em; + margin-bottom: 0.5em; +} + +.subs ul li > .doc p { + margin: 0; +} + +/* Render short-style data instances */ +.inst ul { + height: 100%; + padding: 0.5em; + margin: 0; +} + +.inst, .inst li { + list-style: none; + margin-left: 1em; +} + +/* Workaround for bug in Firefox (issue #384) */ +.inst-left { + float: left; +} + +.top p.src { + border-top: 1px solid #ccc; +} + +.subs, .doc { + /* use this selector for one level of indent */ + padding-left: 2em; +} + +.warning { + color: red; +} + +.arguments { + margin-top: -0.4em; +} +.arguments .caption { + display: none; +} + +.fields { padding-left: 1em; } + +.fields .caption { display: none; } + +.fields p { margin: 0 0; } + +/* this seems bulky to me +.methods, .constructors { + background: #f8f8f8; + border: 1px solid #eee; +} +*/ + +/* @end */ + +/* @group Auxillary Pages */ + + +.extension-list { + list-style-type: none; + margin-left: 0; +} + +#mini { + margin: 0 auto; + padding: 0 1em 1em; +} + +#mini > * { + font-size: 93%; /* 12pt */ +} + +#mini #module-list .caption, +#mini #module-header .caption { + font-size: 125%; /* 15pt */ +} + +#mini #interface h1, +#mini #interface h2, +#mini #interface h3, +#mini #interface h4 { + font-size: 109%; /* 13pt */ + margin: 1em 0 0; +} + +#mini #interface .top, +#mini #interface .src { + margin: 0; +} + +#mini #module-list ul { + list-style: none; + margin: 0; +} + +#alphabet ul { + list-style: none; + padding: 0; + margin: 0.5em 0 0; + text-align: center; +} + +#alphabet li { + display: inline; + margin: 0 0.25em; +} + +#alphabet a { + font-weight: bold; +} + +#index .caption, +#module-list .caption { font-size: 131%; /* 17pt */ } + +#index table { + margin-left: 2em; +} + +#index .src { + font-weight: bold; +} +#index .alt { + font-size: 77%; /* 10pt */ + font-style: italic; + padding-left: 2em; +} + +#index td + td { + padding-left: 1em; +} + +#module-list ul { + list-style: none; + margin: 0 0 0 2em; +} + +#module-list li { + clear: right; +} + +#module-list span.collapser, +#module-list span.expander { + background-position: 0 0.3em; +} + +#module-list .package { + float: right; +} + +:target { + background-color: #ffff00; +} + +/* @end */ diff --git a/haddock-api/resources/html/NewOcean.std-theme/plus.gif b/haddock-api/resources/html/NewOcean.std-theme/plus.gif new file mode 100644 index 00000000..2d15c141 Binary files /dev/null and b/haddock-api/resources/html/NewOcean.std-theme/plus.gif differ diff --git a/haddock-api/resources/html/NewOcean.std-theme/synopsis.png b/haddock-api/resources/html/NewOcean.std-theme/synopsis.png new file mode 100644 index 00000000..85fb86ec Binary files /dev/null and b/haddock-api/resources/html/NewOcean.std-theme/synopsis.png differ -- cgit v1.2.3 From cb6d84cb906eca820abb986899fb6c7ff0f7d69d Mon Sep 17 00:00:00 2001 From: NunoAlexandre Date: Tue, 26 Dec 2017 17:36:57 +0100 Subject: Improve appearance and readability These changes include: - use latest Haskell's logo colors - decrease #content width to improve readability - use nicer font - improve sizes and distances --- .../html/NewOcean.std-theme/new-ocean.css | 61 ++++++++++++++-------- 1 file changed, 39 insertions(+), 22 deletions(-) (limited to 'haddock-api/resources/html/NewOcean.std-theme') diff --git a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css index ddedcace..6c4357b0 100644 --- a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css +++ b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css @@ -10,8 +10,8 @@ html { } body { - background: white; - color: black; + background: #fefefe; + color: rgba(69, 59, 97, 0.95); text-align: left; min-height: 100%; position: relative; @@ -41,7 +41,7 @@ a[href]:link { color: rgb(196,69,29); } a[href]:visited { color: rgb(171,105,84); } a[href]:hover { text-decoration:underline; } -a[href].def:link, a[href].def:visited { color: black; } +a[href].def:link, a[href].def:visited { color: rgba(69, 59, 97, 0.8); } a[href].def:hover { color: rgb(78, 98, 114); } /* @end */ @@ -62,9 +62,9 @@ body.js-enabled .hide-when-js-enabled { */ body { - font:13px/1.4 sans-serif; - *font-size:small; /* for IE */ - *font:x-small; /* for IE in quirks mode */ + font: 300 13px/1.85 "Merriweather Sans", sans-serif; + *font-size:small; /* for IE */ + *font:x-small; /* for IE in quirks mode */ } h1 { font-size: 146.5%; /* 19pt */ } @@ -85,7 +85,7 @@ table { pre, code, kbd, samp, tt, .src { font-family:monospace; *font-size:108%; - line-height: 124%; + line-height: 1.54em; } .links, .link { @@ -117,7 +117,8 @@ pre, code, kbd, samp, tt, .src { .caption, h1, h2, h3, h4, h5, h6, summary { font-weight: bold; color: rgb(78,98,114); - margin: 0.8em 0 0.4em; + color: rgb(142, 80, 132); + margin: 2em 0 1em 0; } * + h1, * + h2, * + h3, * + h4, * + h5, * + h6 { @@ -128,21 +129,33 @@ h1 + h2, h2 + h3, h3 + h4, h4 + h5, h5 + h6 { margin-top: inherit; } +p + ul { + margin-top: 1em; +} + +ul + p { + margin-top: 2em; +} + ul.links { list-style: none; text-align: left; float: right; display: inline-table; margin: 0 0 0 1em; + margin-right: 22vw; } ul.links li { display: inline; - border-left: 1px solid #d5d5d5; white-space: nowrap; padding: 0; } +ul.links li + li:before { + content: '\00B7'; +} + ul.links li a { padding: 0.2em 0.5em; } @@ -188,9 +201,9 @@ details[open] > summary { } pre { - padding: 0.25em; - margin: 0.8em 0; - background: rgb(229,237,244); + padding: 17px; + margin: 1em 0 2em 0; + background-color: rgba(0, 0, 0, .025); overflow: auto; border-bottom: 0.25em solid white; /* white border adds some space below the box to compensate @@ -216,32 +229,34 @@ pre { #content { margin: 0 auto; - padding: 0 2em 6em; + padding: 0; + width: 55vw; } #package-header { - background: rgb(41,56,69); - border-top: 5px solid rgb(78,98,114); + background: rgb(94, 81, 132); + border-bottom: 5px solid rgba(69, 59, 97, 0.5); color: #ddd; - padding: 0.2em; + padding: 0.6em 0 0.2em 0; position: relative; text-align: left; + margin: 0 auto; } #package-header .caption { background: url(hslogo-16.png) no-repeat 0em; color: white; - margin: 0 2em; + margin: 0; + margin-left: 22.5vw; font-weight: normal; font-style: normal; padding-left: 2em; } #package-header a:link, #package-header a:visited { color: white; } -#package-header a:hover { background: rgb(78,98,114); } #module-header .caption { - color: rgb(78,98,114); + color: rgb(94, 81, 132); font-weight: bold; border-bottom: 1px solid #ddd; } @@ -255,7 +270,7 @@ table.info { max-width: 40%; border-spacing: 0; position: relative; - top: -0.5em; + top: -0.78em; margin: 0 0 0 2em; } @@ -307,9 +322,9 @@ div#style-menu-holder { color: #666; text-align: center; position: absolute; - bottom: 0; width: 100%; height: 3em; + margin-top: 3em; } /* @end */ @@ -327,13 +342,15 @@ div#style-menu-holder { } #table-of-contents .caption { - text-align: center; + text-align: left; margin: 0; } #table-of-contents ul { list-style: none; margin: 0; + margin-top: 10px; + font-size: 95%; } #table-of-contents ul ul { -- cgit v1.2.3 From 1c1c4001cf7d2167e545d88bd58f97a71778621b Mon Sep 17 00:00:00 2001 From: NunoAlexandre Date: Tue, 26 Dec 2017 21:23:49 +0100 Subject: Update html test reference files --- haddock-api/resources/html/NewOcean.std-theme/new-ocean.css | 3 +-- haddock-api/src/Haddock/Backends/Xhtml.hs | 2 +- html-test/ref/A.html | 3 ++- html-test/ref/B.html | 3 ++- html-test/ref/Bold.html | 1 + html-test/ref/Bug1.html | 1 + html-test/ref/Bug195.html | 1 + html-test/ref/Bug2.html | 1 + html-test/ref/Bug201.html | 1 + html-test/ref/Bug253.html | 1 + html-test/ref/Bug26.html | 1 + html-test/ref/Bug280.html | 1 + html-test/ref/Bug294.html | 1 + html-test/ref/Bug298.html | 1 + html-test/ref/Bug3.html | 1 + html-test/ref/Bug308.html | 1 + html-test/ref/Bug308CrossModule.html | 1 + html-test/ref/Bug310.html | 1 + html-test/ref/Bug313.html | 1 + html-test/ref/Bug335.html | 1 + html-test/ref/Bug387.html | 1 + html-test/ref/Bug4.html | 1 + html-test/ref/Bug546.html | 1 + html-test/ref/Bug548.html | 1 + html-test/ref/Bug6.html | 1 + html-test/ref/Bug613.html | 1 + html-test/ref/Bug647.html | 1 + html-test/ref/Bug7.html | 1 + html-test/ref/Bug8.html | 1 + html-test/ref/Bug85.html | 1 + html-test/ref/BugDeprecated.html | 1 + html-test/ref/BugExportHeadings.html | 1 + html-test/ref/Bugs.html | 1 + html-test/ref/BundledPatterns.html | 1 + html-test/ref/BundledPatterns2.html | 1 + html-test/ref/ConstructorPatternExport.html | 1 + html-test/ref/DeprecatedClass.html | 1 + html-test/ref/DeprecatedData.html | 1 + html-test/ref/DeprecatedFunction.html | 1 + html-test/ref/DeprecatedFunction2.html | 1 + html-test/ref/DeprecatedFunction3.html | 1 + html-test/ref/DeprecatedModule.html | 1 + html-test/ref/DeprecatedModule2.html | 1 + html-test/ref/DeprecatedNewtype.html | 1 + html-test/ref/DeprecatedReExport.html | 1 + html-test/ref/DeprecatedRecord.html | 1 + html-test/ref/DeprecatedTypeFamily.html | 1 + html-test/ref/DeprecatedTypeSynonym.html | 1 + html-test/ref/DuplicateRecordFields.html | 1 + html-test/ref/Examples.html | 1 + html-test/ref/Extensions.html | 1 + html-test/ref/FunArgs.html | 1 + html-test/ref/GADTRecords.html | 1 + html-test/ref/Hash.html | 1 + html-test/ref/HiddenInstances.html | 1 + html-test/ref/HiddenInstancesB.html | 1 + html-test/ref/Hyperlinks.html | 1 + html-test/ref/IgnoreExports.html | 1 + html-test/ref/ImplicitParams.html | 1 + html-test/ref/Instances.html | 1 + html-test/ref/Math.html | 1 + html-test/ref/Minimal.html | 1 + html-test/ref/ModuleWithWarning.html | 1 + html-test/ref/NamedDoc.html | 1 + html-test/ref/Nesting.html | 1 + html-test/ref/NoLayout.html | 1 + html-test/ref/NonGreedy.html | 1 + html-test/ref/Operators.html | 1 + html-test/ref/OrphanInstances.html | 1 + html-test/ref/OrphanInstancesClass.html | 1 + html-test/ref/OrphanInstancesType.html | 1 + html-test/ref/PR643.html | 1 + html-test/ref/PR643_1.html | 1 + html-test/ref/PatternSyns.html | 1 + html-test/ref/PromotedTypes.html | 1 + html-test/ref/Properties.html | 1 + html-test/ref/PruneWithWarning.html | 1 + html-test/ref/QuasiExpr.html | 1 + html-test/ref/QuasiQuote.html | 1 + html-test/ref/SpuriousSuperclassConstraints.html | 1 + html-test/ref/TH.html | 1 + html-test/ref/TH2.html | 1 + html-test/ref/Table.html | 1 + html-test/ref/Test.html | 1 + html-test/ref/Threaded.html | 1 + html-test/ref/Threaded_TH.html | 1 + html-test/ref/Ticket112.html | 1 + html-test/ref/Ticket61.html | 1 + html-test/ref/Ticket75.html | 1 + html-test/ref/TitledPicture.html | 1 + html-test/ref/TypeFamilies.html | 1 + html-test/ref/TypeFamilies2.html | 1 + html-test/ref/TypeOperators.html | 1 + html-test/ref/Unicode.html | 1 + html-test/ref/Visible.html | 1 + 95 files changed, 97 insertions(+), 5 deletions(-) (limited to 'haddock-api/resources/html/NewOcean.std-theme') diff --git a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css index 6c4357b0..f1523143 100644 --- a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css +++ b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css @@ -142,8 +142,7 @@ ul.links { text-align: left; float: right; display: inline-table; - margin: 0 0 0 1em; - margin-right: 22vw; + margin: 0 22vw 0 1em; } ul.links li { diff --git a/haddock-api/src/Haddock/Backends/Xhtml.hs b/haddock-api/src/Haddock/Backends/Xhtml.hs index 41c11361..0264b7f7 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml.hs @@ -124,8 +124,8 @@ headHtml docTitle themes mathjax_url = meta ! [httpequiv "Content-Type", content "text/html; charset=UTF-8"], thetitle << docTitle, styleSheet themes, - thelink ! [ rel "stylesheet", thetype "text/css", href fontUrl] << noHtml, thelink ! [ rel "stylesheet", thetype "text/css", href quickJumpCssFile] << noHtml, + thelink ! [ rel "stylesheet", thetype "text/css", href fontUrl] << noHtml, script ! [src haddockJsFile, emptyAttr "async", thetype "text/javascript"] << noHtml, script ! [src mjUrl, thetype "text/javascript"] << noHtml ] diff --git a/html-test/ref/A.html b/html-test/ref/A.html index e4802966..537a7bac 100644 --- a/html-test/ref/A.html +++ b/html-test/ref/A.html @@ -4,6 +4,7 @@ />A \ No newline at end of file +> diff --git a/html-test/ref/B.html b/html-test/ref/B.html index 12d8e907..1d7d436c 100644 --- a/html-test/ref/B.html +++ b/html-test/ref/B.html @@ -4,6 +4,7 @@ />B \ No newline at end of file +> diff --git a/html-test/ref/Bold.html b/html-test/ref/Bold.html index 112d7aca..276e7b23 100644 --- a/html-test/ref/Bold.html +++ b/html-test/ref/Bold.html @@ -4,6 +4,7 @@ />BoldBug1Bug195Bug2Bug201Bug253Bug26Bug280Bug294Bug298Bug3Bug308Bug308CrossModuleBug310Bug313Bug335Bug387Bug4Bug546Bug548Bug6Bug613Bug647Bug7Bug8Bug85BugDeprecatedBugExportHeadingsBugsBundledPatternsBundledPatterns2ConstructorPatternExportDeprecatedClassDeprecatedDataDeprecatedFunctionDeprecatedFunction2DeprecatedFunction3DeprecatedModuleDeprecatedModule2DeprecatedNewtypeDeprecatedReExportDeprecatedRecordDeprecatedTypeFamilyDeprecatedTypeSynonymDuplicateRecordFieldsExamplesExtensionsFunArgsGADTRecordsHashHiddenInstancesHiddenInstancesBHyperlinksIgnoreExportsImplicitParamsInstancesMathMinimalModuleWithWarningNamedDocNestingNoLayoutNonGreedyOperatorsOrphanInstancesOrphanInstancesClassOrphanInstancesTypePR643PR643_1PatternSynsPromotedTypesPropertiesPruneWithWarningQuasiExprQuasiQuoteSpuriousSuperclassConstraintsTHTH2TableTestThreadedThreaded_THTicket112Ticket61Ticket75TitledPictureTypeFamiliesTypeFamilies2TypeOperatorsUnicodeVisible Date: Wed, 27 Dec 2017 19:10:32 +0100 Subject: Make it responsive - It makes small screens taking more space than larger ones - fixes a few issues present in small screens currently - make it look good across different screen sizes. --- .../html/NewOcean.std-theme/new-ocean.css | 71 +++++++++++++++++++--- 1 file changed, 61 insertions(+), 10 deletions(-) (limited to 'haddock-api/resources/html/NewOcean.std-theme') diff --git a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css index f1523143..4191c8b0 100644 --- a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css +++ b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css @@ -54,6 +54,59 @@ body.js-enabled .hide-when-js-enabled { /* @end */ + +/* @group responsive */ + +@media only screen and (min-width: 950px) { + #page-header { + text-align: left; + text-align: left; + } + + #content { + width: 60vw; + } + + #package-header .caption { + margin: 0 0 0 20vw; + } + + ul.links { + margin: 0px 20vw 0 0; + } + +} + +@media only screen and (max-width: 950px) { + #page-header { + text-align: center; + } + + #content { + width: 80vw; + } + + #package-header .caption { + margin: 0 0 0 10vw; + } + + ul.links { + margin: 0px 10vw 0 0; + } +} + +@media only screen and (max-width: 500px) { + #module-header table.info { + float: none; + top: 0; + margin: 0 auto; + overflow: hidden; + max-width: 80vw; + } +} + +/* @end */ + /* @group Fonts & Sizes */ /* Basic technique & IE workarounds from YUI 3 @@ -137,12 +190,15 @@ ul + p { margin-top: 2em; } +ul.links, #package-header p.caption { + padding-top: 3px; +} + ul.links { list-style: none; text-align: left; float: right; - display: inline-table; - margin: 0 22vw 0 1em; + font-size: 13px; } ul.links li { @@ -227,16 +283,15 @@ pre { /* @group Page Structure */ #content { - margin: 0 auto; + margin: 3em auto 0 auto; padding: 0; - width: 55vw; } #package-header { background: rgb(94, 81, 132); border-bottom: 5px solid rgba(69, 59, 97, 0.5); color: #ddd; - padding: 0.6em 0 0.2em 0; + padding: 8px 0; position: relative; text-align: left; margin: 0 auto; @@ -245,15 +300,11 @@ pre { #package-header .caption { background: url(hslogo-16.png) no-repeat 0em; color: white; - margin: 0; - margin-left: 22.5vw; font-weight: normal; font-style: normal; - padding-left: 2em; + padding-left: 35px; } -#package-header a:link, #package-header a:visited { color: white; } - #module-header .caption { color: rgb(94, 81, 132); font-weight: bold; -- cgit v1.2.3 From 6a7c5fef87106a92e710413259262ab2b1e78005 Mon Sep 17 00:00:00 2001 From: Nuno Alexandre Date: Sat, 3 Feb 2018 21:39:30 +0100 Subject: Make the style consistent with hackage Several things are addressed here: - better responsive behaviour on the header - better space usage - consistent colors overall - other nit PR comments --- .../html/NewOcean.std-theme/new-ocean.css | 106 ++++++++++++--------- haddock-api/src/Haddock/Backends/Xhtml.hs | 4 +- haddock-api/src/Haddock/Backends/Xhtml/Layout.hs | 4 +- 3 files changed, 66 insertions(+), 48 deletions(-) (limited to 'haddock-api/resources/html/NewOcean.std-theme') diff --git a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css index 4191c8b0..8a7fdf97 100644 --- a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css +++ b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css @@ -37,8 +37,8 @@ dd { } a { text-decoration: none; } -a[href]:link { color: rgb(196,69,29); } -a[href]:visited { color: rgb(171,105,84); } +a[href]:link {color: #9C5791;} +a[href]:visited {color: #5E3558;} a[href]:hover { text-decoration:underline; } a[href].def:link, a[href].def:visited { color: rgba(69, 59, 97, 0.8); } @@ -57,45 +57,68 @@ body.js-enabled .hide-when-js-enabled { /* @group responsive */ -@media only screen and (min-width: 950px) { - #page-header { - text-align: left; - text-align: left; - } +#package-header .caption { + margin: 0px 1em 0 2em; +} +@media only screen and (min-width: 1280px) { #content { width: 60vw; + max-width: 1450px; + min-width: 830px; } +} - #package-header .caption { - margin: 0 0 0 20vw; +@media only screen and (max-width: 1280px) { + #content { + width: 75vw; } +} - ul.links { - margin: 0px 20vw 0 0; +@media only screen and (max-width: 950px) { + #content { + width: 88vw; } - } -@media only screen and (max-width: 950px) { - #page-header { - text-align: center; + +/* menu for wider screens + + Display the package name at the left and the menu links at the right, + inline with each other: + The package name Source . Contents . Index +*/ +@media only screen and (min-width: 1000px) { + #package-header .caption { + display: inline-block; + margin: 3px 1em 2px 2em; } - #content { - width: 80vw; + #package-header ul.links { + float: right; + margin: 3px 2em 2px 1em; } +} +/* menu for smaller screens + +Display the package name on top of the menu links and center both elements: + The package name + Source . Contents . Index +*/ +@media only screen and (max-width: 1000px) { #package-header .caption { - margin: 0 0 0 10vw; + display: block; + margin: 4px 0; + text-align: center; } - ul.links { - margin: 0px 10vw 0 0; + #package-header ul.links { + float: none; + text-align: center; + margin: 0.6em 0 0 0; } -} -@media only screen and (max-width: 500px) { #module-header table.info { float: none; top: 0; @@ -107,6 +130,7 @@ body.js-enabled .hide-when-js-enabled { /* @end */ + /* @group Fonts & Sizes */ /* Basic technique & IE workarounds from YUI 3 @@ -115,7 +139,7 @@ body.js-enabled .hide-when-js-enabled { */ body { - font: 300 13px/1.85 "Merriweather Sans", sans-serif; + font: 400 16px/1.6 'Open Sans', sans-serif; *font-size:small; /* for IE */ *font:x-small; /* for IE in quirks mode */ } @@ -150,18 +174,17 @@ pre, code, kbd, samp, tt, .src { } #module-header .caption sup { - font-size: 70%; + font-size: 80%; font-weight: normal; } +#package-header #page-menu a:link, #package-header #page-menu a:visited { color: white; } + + .info { font-size: 85%; /* 11pt */ } -#table-of-contents, #synopsis { - /* font-size: 85%; /* 11pt */ -} - /* @end */ @@ -169,11 +192,11 @@ pre, code, kbd, samp, tt, .src { .caption, h1, h2, h3, h4, h5, h6, summary { font-weight: bold; - color: rgb(78,98,114); - color: rgb(142, 80, 132); + color: #5E5184; margin: 2em 0 1em 0; } + * + h1, * + h2, * + h3, * + h4, * + h5, * + h6 { margin-top: 2em; } @@ -190,15 +213,10 @@ ul + p { margin-top: 2em; } -ul.links, #package-header p.caption { - padding-top: 3px; -} - ul.links { list-style: none; text-align: left; - float: right; - font-size: 13px; + font-size: 1em; } ul.links li { @@ -258,7 +276,7 @@ details[open] > summary { pre { padding: 17px; margin: 1em 0 2em 0; - background-color: rgba(0, 0, 0, .025); + background-color: rgba(0, 0, 0, .033); overflow: auto; border-bottom: 0.25em solid white; /* white border adds some space below the box to compensate @@ -291,22 +309,21 @@ pre { background: rgb(94, 81, 132); border-bottom: 5px solid rgba(69, 59, 97, 0.5); color: #ddd; - padding: 8px 0; + padding: 0.6em 0 0.2em 0; position: relative; text-align: left; margin: 0 auto; + overflow: hidden; } #package-header .caption { - background: url(hslogo-16.png) no-repeat 0em; color: white; - font-weight: normal; font-style: normal; - padding-left: 35px; + font-size: 1.1rem; + font-weight: bold; } #module-header .caption { - color: rgb(94, 81, 132); font-weight: bold; border-bottom: 1px solid #ddd; } @@ -414,11 +431,12 @@ div#style-menu-holder { #synopsis { display: block; position: fixed; - right: 0; height: 80%; - top: 10%; + top: 9vh; + right: 10px; padding: 0; max-width: 75%; + z-index: 1; /* Ensure that synopsis covers everything (including MathJAX markup) */ z-index: 1; } diff --git a/haddock-api/src/Haddock/Backends/Xhtml.hs b/haddock-api/src/Haddock/Backends/Xhtml.hs index 0264b7f7..6f1f1f60 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml.hs @@ -130,8 +130,8 @@ headHtml docTitle themes mathjax_url = script ! [src mjUrl, thetype "text/javascript"] << noHtml ] where - fontUrl = "https://fonts.googleapis.com/css?family=Merriweather+Sans:300,300i,400,700" - mjUrl = maybe "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML" id mathjax_url + fontUrl = "https://fonts.googleapis.com/css?family=Open+Sans:400,400i,700" + mjUrl = fromMaybe "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML" mathjax_url srcButton :: SourceURLs -> Maybe Interface -> Maybe Html srcButton (Just src_base_url, _, _, _) Nothing = diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs b/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs index 1c44ffda..bdf989ed 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs @@ -74,8 +74,8 @@ sectionName = paragraph ! [theclass "caption"] -- If it would have otherwise been empty, then give it the class ".empty". nonEmptySectionName :: Html -> Html nonEmptySectionName c - | isNoHtml c = paragraph ! [theclass "caption empty"] $ spaceHtml - | otherwise = paragraph ! [theclass "caption"] $ c + | isNoHtml c = thediv ! [theclass "caption empty"] $ spaceHtml + | otherwise = thediv ! [theclass "caption"] $ c divPackageHeader, divContent, divModuleHeader, divFooter, -- cgit v1.2.3 From 440ceaf57a8bf0a8d421cad259e8a6e677282b81 Mon Sep 17 00:00:00 2001 From: Nuno Alexandre Date: Sun, 4 Feb 2018 19:30:51 +0100 Subject: Improve synopsis style and code - Use CSS3 instead of loading pictures to show "+" and "-" symbols - Drop redundant code --- .../html/NewOcean.std-theme/new-ocean.css | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'haddock-api/resources/html/NewOcean.std-theme') diff --git a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css index 8a7fdf97..4d336296 100644 --- a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css +++ b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css @@ -237,23 +237,23 @@ ul.links li a { .show { display: inherit; } .clear { clear: both; } -.collapser { - background-image: url(minus.gif); - background-repeat: no-repeat; +.collapser:before, .expander:before { + font-size: 0.9em; + color: #5E5184; + display: inline-block; + padding-right: 7px; +} + +.collapser:before { + content: '-' } -.expander { - background-image: url(plus.gif); - background-repeat: no-repeat; +.expander:before { + content: "+"; } + .collapser, .expander { - padding-left: 14px; - margin-left: -14px; cursor: pointer; } -p.caption.collapser, -p.caption.expander { - background-position: 0 0.4em; -} .instance.collapser, .instance.expander { margin-left: 0px; @@ -306,7 +306,7 @@ pre { } #package-header { - background: rgb(94, 81, 132); + background: #5E5184; border-bottom: 5px solid rgba(69, 59, 97, 0.5); color: #ddd; padding: 0.6em 0 0.2em 0; -- cgit v1.2.3 From 3354c3cc34166dc263114694de314ed3ca99c664 Mon Sep 17 00:00:00 2001 From: Nuno Alexandre Date: Mon, 5 Feb 2018 21:10:53 +0100 Subject: Decrease space between code blocks There was too much space between code blocks as pointed out by reviewers. --- .../resources/html/NewOcean.std-theme/new-ocean.css | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'haddock-api/resources/html/NewOcean.std-theme') diff --git a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css index 4d336296..fe6300fe 100644 --- a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css +++ b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css @@ -274,14 +274,14 @@ details[open] > summary { } pre { - padding: 17px; - margin: 1em 0 2em 0; + padding: 1rem; + margin: 0px; background-color: rgba(0, 0, 0, .033); overflow: auto; - border-bottom: 0.25em solid white; - /* white border adds some space below the box to compensate - for visual extra space that paragraphs have between baseline - and the bounding box */ +} + +pre + pre { + margin-top: 0.4em; } .src { @@ -319,7 +319,7 @@ pre { #package-header .caption { color: white; font-style: normal; - font-size: 1.1rem; + font-size: 1rem; font-weight: bold; } -- cgit v1.2.3 From b3d29825f5807f74be3e3d6b6318dad0bbcedb42 Mon Sep 17 00:00:00 2001 From: Nuno Alexandre Date: Thu, 8 Feb 2018 21:29:20 +0100 Subject: Address several PR comments - Darken text color like done for hackage - Move synopsis to left side - Make table of contents stick to the left on wide screens - Wrap links to avoid page overflow - Improve expand/collapse buttons - Fix issue with content size on mobile devices - Fix issue with font-size on landscape mode - Increase width of the content - Change colors of table of contents and synopsis - Etc --- .../html/NewOcean.std-theme/new-ocean.css | 121 +++++++++++++-------- 1 file changed, 78 insertions(+), 43 deletions(-) (limited to 'haddock-api/resources/html/NewOcean.std-theme') diff --git a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css index fe6300fe..a3b75dc7 100644 --- a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css +++ b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css @@ -11,10 +11,20 @@ html { body { background: #fefefe; - color: rgba(69, 59, 97, 0.95); + color: #221D30; text-align: left; min-height: 100%; position: relative; + -webkit-text-size-adjust: 100%; + -webkit-font-feature-settings: "kern" 1; + -moz-font-feature-settings: "kern" 1; + -o-font-feature-settings: "kern" 1; + font-feature-settings: "kern" 1; + font-kerning: normal; +} + +#content a { + overflow-wrap: break-word; } p { @@ -63,21 +73,36 @@ body.js-enabled .hide-when-js-enabled { @media only screen and (min-width: 1280px) { #content { - width: 60vw; + width: 65vw; max-width: 1450px; - min-width: 830px; + } + + #table-of-contents { + position: fixed; + left: 10px; + max-width: 10vw; + top: 10.2em; } } @media only screen and (max-width: 1280px) { #content { - width: 75vw; + width: 80vw; } } -@media only screen and (max-width: 950px) { +@media only screen and (max-width: 1000px) { #content { - width: 88vw; + width: 93vw; + } + + #synopsis { + display: block; + padding: 0; + position: relative; + margin: 4em 0; + border-bottom: 1px dashed #5E5184; + width: 100%; } } @@ -98,6 +123,22 @@ body.js-enabled .hide-when-js-enabled { float: right; margin: 3px 2em 2px 1em; } + + #synopsis { + display: block; + position: fixed; + top: 5em; + left: 10px; + padding: 0.25em; + max-width: 65vw; + /* Ensure that synopsis covers everything (including MathJAX markup) */ + z-index: 1; + } + + #synopsis .show { + border: 1px solid #5E5184; + padding: 0.7em; + } } /* menu for smaller screens @@ -150,10 +191,6 @@ h3 { font-size: 116%; /* 15pt */ } h4 { font-size: 100%; /* 13pt */ } h5 { font-size: 100%; /* 13pt */ } -select, input, button, textarea { - font:99% sans-serif; -} - table { font-size:inherit; font:100%; @@ -238,17 +275,17 @@ ul.links li a { .clear { clear: both; } .collapser:before, .expander:before { - font-size: 0.9em; + font-size: 1.2em; color: #5E5184; display: inline-block; padding-right: 7px; } .collapser:before { - content: '-' + content: '⊗'; } .expander:before { - content: "+"; + content: "⊕"; } .collapser, .expander { @@ -276,7 +313,7 @@ details[open] > summary { pre { padding: 1rem; margin: 0px; - background-color: rgba(0, 0, 0, .033); + background-color: #f7f7f7; overflow: auto; } @@ -342,7 +379,8 @@ table.info { } .info th { - padding: 0 1em 0 0; + padding: 0 1em 0 0; + text-align: right; } div#style-menu-holder { @@ -398,14 +436,15 @@ div#style-menu-holder { /* @group Front Matter */ +#synopsis .caption, +#table-of-contents .caption { + font-size: 1rem; +} + #table-of-contents { - float: right; - clear: right; - background: #faf9dc; - border: 1px solid #d8d7ad; - padding: 0.5em 1em; - max-width: 20em; - margin: 0.5em 0 1em 1em; + background: #f7f7f7; + padding: 1em; + margin: 1em 0 2em 0; } #table-of-contents .caption { @@ -428,19 +467,6 @@ div#style-menu-holder { display: none; } -#synopsis { - display: block; - position: fixed; - height: 80%; - top: 9vh; - right: 10px; - padding: 0; - max-width: 75%; - z-index: 1; - /* Ensure that synopsis covers everything (including MathJAX markup) */ - z-index: 1; -} - #synopsis summary { display: block; float: left; @@ -470,7 +496,7 @@ div#style-menu-holder { #synopsis ul, #synopsis ul li.src { - background-color: #faf9dc; + background-color: #f7f7f7; white-space: nowrap; list-style: none; margin-left: 0; @@ -480,7 +506,9 @@ div#style-menu-holder { /* @group Main Content */ -#interface div.top { margin: 2em 0; } +#interface div.top + div.top { margin-top: 0.6em; } + +#interface p + div.top, #interface h1 + div.top, #interface h2 + div.top, #interface h3 + div.top, @@ -600,11 +628,6 @@ div#style-menu-holder { border-top: 1px solid #ccc; } -.subs, .doc { - /* use this selector for one level of indent */ - padding-left: 2em; -} - .warning { color: red; } @@ -726,7 +749,19 @@ div#style-menu-holder { } :target { - background-color: #ffff00; + background: -webkit-linear-gradient(top, transparent 0%, transparent 65%, #fbf36d 60%, #fbf36d 100%); + background: -moz-linear-gradient(top, transparent 0%, transparent 65%, #fbf36d 60%, #fbf36d 100%); + background: -o-linear-gradient(top, transparent 0%, transparent 65%, #fbf36d 60%, #fbf36d 100%); + background: -ms-linear-gradient(top, transparent 0%, transparent 65%, #fbf36d 60%, #fbf36d 100%); + background: linear-gradient(to bottom, transparent 0%, transparent 65%, #fbf36d 60%, #fbf36d 100%); +} + +:target:hover { + background: -webkit-linear-gradient(top, transparent 0%, transparent 0%, #fbf36d 0%, #fbf36d 100%); + background: -moz-linear-gradient(top, transparent 0%, transparent 0%, #fbf36d 0%, #fbf36d 100%); + background: -o-linear-gradient(top, transparent 0%, transparent 0%, #fbf36d 0%, #fbf36d 100%); + background: -ms-linear-gradient(top, transparent 0%, transparent 0%, #fbf36d 0%, #fbf36d 100%); + background: linear-gradient(to bottom, transparent 0%, transparent 0%, #fbf36d 0%, #fbf36d 100%); } /* @end */ -- cgit v1.2.3 From 19344526243780dca32413208c82dab1c3636ea4 Mon Sep 17 00:00:00 2001 From: Nuno Alexandre Date: Fri, 9 Feb 2018 08:11:12 +0100 Subject: Make synopsis scrollable on wide screens MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the synopsis is longer than the screen, you can’t see its end and you can't scroll down either, making the content unreachable. --- haddock-api/resources/html/NewOcean.std-theme/new-ocean.css | 1 + 1 file changed, 1 insertion(+) (limited to 'haddock-api/resources/html/NewOcean.std-theme') diff --git a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css index a3b75dc7..45775494 100644 --- a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css +++ b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css @@ -138,6 +138,7 @@ body.js-enabled .hide-when-js-enabled { #synopsis .show { border: 1px solid #5E5184; padding: 0.7em; + max-height: 65vh; } } -- cgit v1.2.3 From fb7aaf0f48399607b8781f2d611cd3186936e72e Mon Sep 17 00:00:00 2001 From: Nuno Alexandre Date: Sat, 17 Feb 2018 20:31:14 +0100 Subject: Improve information density - Reduce font size - Improve space between and within code blocks - Improve alignments - Improve spacing within sub-blocks --- .../html/NewOcean.std-theme/new-ocean.css | 122 +++++++++++++-------- 1 file changed, 74 insertions(+), 48 deletions(-) (limited to 'haddock-api/resources/html/NewOcean.std-theme') diff --git a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css index 45775494..09bf0c95 100644 --- a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css +++ b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css @@ -73,39 +73,58 @@ body.js-enabled .hide-when-js-enabled { @media only screen and (min-width: 1280px) { #content { - width: 65vw; + width: 62vw; max-width: 1450px; } #table-of-contents { position: fixed; - left: 10px; max-width: 10vw; top: 10.2em; } -} -@media only screen and (max-width: 1280px) { - #content { - width: 80vw; + #synopsis { + display: block; + position: fixed; + top: 5em; + max-width: 65vw; + /* Ensure that synopsis covers everything (including MathJAX markup) */ + z-index: 1; } + + #synopsis, #table-of-contents { + left: 2em; + } + + #synopsis .show { + border: 1px solid #5E5184; + padding: 0.7em; + max-height: 65vh; + } + } -@media only screen and (max-width: 1000px) { +@media only screen and (max-width: 1280px) { #content { - width: 93vw; + width: 80vw; } #synopsis { display: block; padding: 0; position: relative; - margin: 4em 0; + margin: 0; border-bottom: 1px dashed #5E5184; width: 100%; } } +@media only screen and (max-width: 1000px) { + #content { + width: 93vw; + } +} + /* menu for wider screens @@ -123,23 +142,6 @@ body.js-enabled .hide-when-js-enabled { float: right; margin: 3px 2em 2px 1em; } - - #synopsis { - display: block; - position: fixed; - top: 5em; - left: 10px; - padding: 0.25em; - max-width: 65vw; - /* Ensure that synopsis covers everything (including MathJAX markup) */ - z-index: 1; - } - - #synopsis .show { - border: 1px solid #5E5184; - padding: 0.7em; - max-height: 65vh; - } } /* menu for smaller screens @@ -181,7 +183,7 @@ Display the package name on top of the menu links and center both elements: */ body { - font: 400 16px/1.6 'Open Sans', sans-serif; + font: 400 15px/1.5 'Open Sans', sans-serif; *font-size:small; /* for IE */ *font:x-small; /* for IE in quirks mode */ } @@ -199,8 +201,6 @@ table { pre, code, kbd, samp, tt, .src { font-family:monospace; - *font-size:108%; - line-height: 1.54em; } .links, .link { @@ -219,8 +219,8 @@ pre, code, kbd, samp, tt, .src { #package-header #page-menu a:link, #package-header #page-menu a:visited { color: white; } -.info { - font-size: 85%; /* 11pt */ +.info { + font-size: 90%; } @@ -254,7 +254,7 @@ ul + p { ul.links { list-style: none; text-align: left; - font-size: 1em; + font-size: 0.95em; } ul.links li { @@ -277,7 +277,7 @@ ul.links li a { .collapser:before, .expander:before { font-size: 1.2em; - color: #5E5184; + color: #9C5791; display: inline-block; padding-right: 7px; } @@ -312,18 +312,22 @@ details[open] > summary { } pre { - padding: 1rem; - margin: 0px; + padding: 0.5rem 1rem; + margin: 1em 0 0 0; background-color: #f7f7f7; overflow: auto; } +pre + p { + margin-top: 1em; +} + pre + pre { - margin-top: 0.4em; + margin-top: 0.5em; } .src { - background: #f0f0f0; + background: #f4f4f4; padding: 0.2em 0.5em; } @@ -372,7 +376,7 @@ table.info { border: 1px solid #ddd; color: rgb(78,98,114); background-color: #fff; - max-width: 40%; + max-width: 60%; border-spacing: 0; position: relative; top: -0.78em; @@ -430,7 +434,7 @@ div#style-menu-holder { position: absolute; width: 100%; height: 3em; - margin-top: 3em; + margin-top: 6em; } /* @end */ @@ -445,7 +449,8 @@ div#style-menu-holder { #table-of-contents { background: #f7f7f7; padding: 1em; - margin: 1em 0 2em 0; + margin: 0; + margin-top: 1em; } #table-of-contents .caption { @@ -457,7 +462,7 @@ div#style-menu-holder { list-style: none; margin: 0; margin-top: 10px; - font-size: 95%; + font-size: 14px; } #table-of-contents ul ul { @@ -503,11 +508,17 @@ div#style-menu-holder { margin-left: 0; } +#interface td.src { + white-space: nowrap; +} + /* @end */ /* @group Main Content */ -#interface div.top + div.top { margin-top: 0.6em; } +#interface div.top + div.top { + margin-top: 3em; +} #interface p + div.top, #interface h1 + div.top, @@ -520,14 +531,13 @@ div#style-menu-holder { #interface .src .selflink, #interface .src .link { float: right; - color: #919191; - background: #f0f0f0; - padding: 0 0.5em 0.2em; - margin: 0 -0.5em 0 0; + color: #888; + padding: 0 7px; -moz-user-select: none; + font-weight: bold; + line-height: 30px; } #interface .src .selflink { - border-left: 1px solid #919191; margin: 0 -0.5em 0 0.5em; } @@ -608,6 +618,20 @@ div#style-menu-holder { margin: 0; } +.subs .subs .caption { + margin-top: 16px !important; + margin-bottom: 0px !important; +} + +.subs .subs .caption + .src { + margin: 0px; + margin-top: 8px; +} + +.subs .subs .src + .src { + margin-top: 8px; +} + /* Render short-style data instances */ .inst ul { height: 100%; @@ -626,7 +650,9 @@ div#style-menu-holder { } .top p.src { - border-top: 1px solid #ccc; + border-bottom: 3px solid #e5e5e5; + line-height: 2rem; + margin-bottom: 1em; } .warning { -- cgit v1.2.3 From 09fd5bf0a2e17ed51c7bd570ee01810e10e5543b Mon Sep 17 00:00:00 2001 From: NunoAlexandre Date: Tue, 20 Mar 2018 12:07:39 +0100 Subject: Minor adjustments Bring in some adjustments made to hackage: - link colors - page header show everything when package title is too long --- .../resources/html/NewOcean.std-theme/new-ocean.css | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'haddock-api/resources/html/NewOcean.std-theme') diff --git a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css index 09bf0c95..fc99a662 100644 --- a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css +++ b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css @@ -47,8 +47,8 @@ dd { } a { text-decoration: none; } -a[href]:link {color: #9C5791;} -a[href]:visited {color: #5E3558;} +a[href]:link {color: #9E358F;} +a[href]:visited {color: #805A75;} a[href]:hover { text-decoration:underline; } a[href].def:link, a[href].def:visited { color: rgba(69, 59, 97, 0.8); } @@ -73,7 +73,7 @@ body.js-enabled .hide-when-js-enabled { @media only screen and (min-width: 1280px) { #content { - width: 62vw; + width: 70vw; max-width: 1450px; } @@ -133,6 +133,14 @@ body.js-enabled .hide-when-js-enabled { The package name Source . Contents . Index */ @media only screen and (min-width: 1000px) { + #package-header { + text-align: left; + overflow: visible; + white-space: nowrap; + display: inline-table; + width: 100%; + } + #package-header .caption { display: inline-block; margin: 3px 1em 2px 2em; -- cgit v1.2.3 From acd40e506c364bee17a95759aaf0dc583bb0d1ea Mon Sep 17 00:00:00 2001 From: NunoAlexandre Date: Tue, 20 Mar 2018 12:30:19 +0100 Subject: Fix responsive triggers overlap issue The min and max width triggers have the same values, which caused the style resolution to take an intersection of both style declarations when the screen resolution had the size of the limts (say 1280px), causing an odd behaviour and look. --- haddock-api/resources/html/NewOcean.std-theme/new-ocean.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'haddock-api/resources/html/NewOcean.std-theme') diff --git a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css index fc99a662..d9d249ce 100644 --- a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css +++ b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css @@ -73,7 +73,7 @@ body.js-enabled .hide-when-js-enabled { @media only screen and (min-width: 1280px) { #content { - width: 70vw; + width: 63vw; max-width: 1450px; } @@ -104,7 +104,7 @@ body.js-enabled .hide-when-js-enabled { } -@media only screen and (max-width: 1280px) { +@media only screen and (max-width: 1279px) { #content { width: 80vw; } @@ -119,7 +119,7 @@ body.js-enabled .hide-when-js-enabled { } } -@media only screen and (max-width: 1000px) { +@media only screen and (max-width: 999px) { #content { width: 93vw; } @@ -158,7 +158,7 @@ Display the package name on top of the menu links and center both elements: The package name Source . Contents . Index */ -@media only screen and (max-width: 1000px) { +@media only screen and (max-width: 999px) { #package-header .caption { display: block; margin: 4px 0; -- cgit v1.2.3 From 313ff833faa22522e68129ca48bf08609e4b51ca Mon Sep 17 00:00:00 2001 From: NunoAlexandre Date: Tue, 20 Mar 2018 17:51:53 +0100 Subject: Fix issue with menu alignment on firefox Reported and described here: https://github.com/haskell/haddock/pull/721#issuecomment-374668869 --- haddock-api/resources/html/NewOcean.std-theme/new-ocean.css | 1 + 1 file changed, 1 insertion(+) (limited to 'haddock-api/resources/html/NewOcean.std-theme') diff --git a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css index d9d249ce..63443f19 100644 --- a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css +++ b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css @@ -144,6 +144,7 @@ body.js-enabled .hide-when-js-enabled { #package-header .caption { display: inline-block; margin: 3px 1em 2px 2em; + float: left; } #package-header ul.links { -- cgit v1.2.3 From 17c6dfeefb80d5764a6b63b527623cc93bd4958c Mon Sep 17 00:00:00 2001 From: Nuno Alexandre Date: Sat, 14 Apr 2018 11:29:37 +0200 Subject: Update font to PT Sans Also migrate some general text related changes from hackage. --- .../html/NewOcean.std-theme/new-ocean.css | 34 +++++++++++++--------- 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'haddock-api/resources/html/NewOcean.std-theme') diff --git a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css index 63443f19..f3666e4f 100644 --- a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css +++ b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css @@ -11,16 +11,16 @@ html { body { background: #fefefe; - color: #221D30; + color: #333; text-align: left; - min-height: 100%; + min-height: 100vh; position: relative; -webkit-text-size-adjust: 100%; - -webkit-font-feature-settings: "kern" 1; - -moz-font-feature-settings: "kern" 1; - -o-font-feature-settings: "kern" 1; - font-feature-settings: "kern" 1; - font-kerning: normal; + -webkit-font-feature-settings: "kern" 1, "liga" 0; + -moz-font-feature-settings: "kern" 1, "liga" 0; + -o-font-feature-settings: "kern" 1, "liga" 0; + font-feature-settings: "kern" 1, "liga" 0; + letter-spacing: 0.0015rem; } #content a { @@ -144,7 +144,6 @@ body.js-enabled .hide-when-js-enabled { #package-header .caption { display: inline-block; margin: 3px 1em 2px 2em; - float: left; } #package-header ul.links { @@ -191,11 +190,20 @@ Display the package name on top of the menu links and center both elements: http://yui.yahooapis.com/3.1.1/build/cssfonts/fonts.css */ -body { - font: 400 15px/1.5 'Open Sans', sans-serif; - *font-size:small; /* for IE */ - *font:x-small; /* for IE in quirks mode */ -} + body, button { + font: 400 17px/1.43 'PT Sans', + /* Fallback Font Stack */ + -apple-system, + BlinkMacSystemFont, + 'Segoe UI', + Roboto, + Oxygen-Sans, + Cantarell, + 'Helvetica Neue', + sans-serif; + *font-size: medium; /* for IE */ + *font:x-small; /* for IE in quirks mode */ + } h1 { font-size: 146.5%; /* 19pt */ } h2 { font-size: 131%; /* 17pt */ } -- cgit v1.2.3 From 7a0246da8fb0e5178c5e4e9af47d75a02455e56a Mon Sep 17 00:00:00 2001 From: Nuno Alexandre Date: Sat, 14 Apr 2018 11:59:49 +0200 Subject: Use 'flex' to fix header alignment --- .../html/NewOcean.std-theme/new-ocean.css | 66 ++++++++++++++++++---- 1 file changed, 55 insertions(+), 11 deletions(-) (limited to 'haddock-api/resources/html/NewOcean.std-theme') diff --git a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css index f3666e4f..2fb6ee65 100644 --- a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css +++ b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css @@ -135,20 +135,27 @@ body.js-enabled .hide-when-js-enabled { @media only screen and (min-width: 1000px) { #package-header { text-align: left; - overflow: visible; white-space: nowrap; - display: inline-table; - width: 100%; + height: 40px; + padding: 4px 1.5em 0px 1.5em; + + display: flex; + justify-content: space-between; + align-items: center; } #package-header .caption { display: inline-block; - margin: 3px 1em 2px 2em; + margin: 0; } #package-header ul.links { - float: right; - margin: 3px 2em 2px 1em; + margin: 0; + display: inline-table; + } + + #package-header .caption + ul.links { + margin-left: 1em; } } @@ -159,16 +166,49 @@ Display the package name on top of the menu links and center both elements: Source . Contents . Index */ @media only screen and (max-width: 999px) { + #package-header { + text-align: center; + padding: 6px 0 4px 0; + overflow: hidden; + } + + #package-header ul.links { + display: block; + text-align: center; + margin: 0; + + /* Hide scrollbar but allow scrolling menu links horizontally */ + white-space: nowrap; + overflow-x: auto; + overflow-y: hidden; + margin-bottom: -17px; + height: 50px; + } + #package-header .caption { display: block; margin: 4px 0; text-align: center; } - #package-header ul.links { - float: none; - text-align: center; - margin: 0.6em 0 0 0; + #package-header ul.links::-webkit-scrollbar { + display: none; + } + + #package-header ul.links li:first-of-type { + padding-left: 1em; + } + + #package-header ul.links li:last-of-type { + /* + The last link of the menu should offer the same distance to the right + as the #package-header enforces at the left. + */ + padding-right: 1em; + } + + #package-header .caption + ul.links { + padding-top: 9px; } #module-header table.info { @@ -274,6 +314,10 @@ ul.links { font-size: 0.95em; } +#package-header ul.links, #package-header ul.links button { + font-size: 1rem; +} + ul.links li { display: inline; white-space: nowrap; @@ -368,8 +412,8 @@ pre + pre { background: #5E5184; border-bottom: 5px solid rgba(69, 59, 97, 0.5); color: #ddd; - padding: 0.6em 0 0.2em 0; position: relative; + font-size: 1.2em; text-align: left; margin: 0 auto; overflow: hidden; -- cgit v1.2.3 From f3538ac7cc86682e6edba8a0c5c20dd09fc944d9 Mon Sep 17 00:00:00 2001 From: Nuno Alexandre Date: Sat, 14 Apr 2018 14:14:33 +0200 Subject: Misc of tweaks - Update link colors to hackage scheme - Tune spacing between content elements - Update footer style - Fix and improve code blocks identation --- .../html/NewOcean.std-theme/new-ocean.css | 42 ++++++++++++++++------ 1 file changed, 32 insertions(+), 10 deletions(-) (limited to 'haddock-api/resources/html/NewOcean.std-theme') diff --git a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css index 2fb6ee65..1728eb9e 100644 --- a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css +++ b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css @@ -47,8 +47,8 @@ dd { } a { text-decoration: none; } -a[href]:link {color: #9E358F;} -a[href]:visited {color: #805A75;} +a[href]:link { color: #9E358F; } +a[href]:visited {color: #6F5F9C; } a[href]:hover { text-decoration:underline; } a[href].def:link, a[href].def:visited { color: rgba(69, 59, 97, 0.8); } @@ -300,12 +300,24 @@ h1 + h2, h2 + h3, h3 + h4, h4 + h5, h5 + h6 { margin-top: inherit; } -p + ul { - margin-top: 1em; +ul li + li { + margin-top: 0.2rem; } ul + p { - margin-top: 2em; + margin-top: 0.93em; +} + +p + ul { + margin-top: 0.5em; +} + +p { + margin-top: 0.7rem; +} + +ul, ol { + margin: 0.8em 0 0.8em 2em; } ul.links { @@ -487,15 +499,16 @@ div#style-menu-holder { } #footer { - background: #ddd; + background: #ededed; border-top: 1px solid #aaa; padding: 0.5em 0; - color: #666; + color: #222; text-align: center; - position: absolute; width: 100%; height: 3em; - margin-top: 6em; + margin-top: 3em; + position: relative; + clear: both; } /* @end */ @@ -507,6 +520,10 @@ div#style-menu-holder { font-size: 1rem; } +#synopsis, #table-of-contents { + font-size: 16px; +} + #table-of-contents { background: #f7f7f7; padding: 1em; @@ -527,7 +544,7 @@ div#style-menu-holder { } #table-of-contents ul ul { - margin-left: 2em; + margin-left: 1.5em; } #description .caption { @@ -651,6 +668,11 @@ div#style-menu-holder { visibility: hidden; } +.subs { + padding-left: 1em; + border-left: 1px solid gainsboro; +} + .subs ul { list-style: none; display: table; -- cgit v1.2.3 From 1f28a9a7964b92e30534f27724ee26fca87283f6 Mon Sep 17 00:00:00 2001 From: Nuno Alexandre Date: Sat, 14 Apr 2018 14:42:57 +0200 Subject: Improve code blocks styling - Fix and improve spacing - Improve colors and borders --- .../html/NewOcean.std-theme/new-ocean.css | 32 +++++++++++++++++----- 1 file changed, 25 insertions(+), 7 deletions(-) (limited to 'haddock-api/resources/html/NewOcean.std-theme') diff --git a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css index 1728eb9e..ca1d2aaf 100644 --- a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css +++ b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css @@ -416,7 +416,7 @@ pre + pre { /* @group Page Structure */ #content { - margin: 3em auto 0 auto; + margin: 3em auto 6em auto; padding: 0; } @@ -595,7 +595,7 @@ div#style-menu-holder { /* @group Main Content */ #interface div.top + div.top { - margin-top: 3em; + margin-top: 1em; } #interface p + div.top, @@ -669,8 +669,13 @@ div#style-menu-holder { } .subs { - padding-left: 1em; - border-left: 1px solid gainsboro; + padding-left: 1em; + border-left: 1px solid gainsboro; + margin-bottom: 1em; +} + +.top .subs { + margin-bottom: 0.6em; } .subs ul { @@ -701,9 +706,22 @@ div#style-menu-holder { margin: 0; } +.subs .subs p.src { + border: none; + background-color: #f8f8f8; +} + +.top > .subs:last-of-type { + margin-bottom: 2em; +} + .subs .subs .caption { - margin-top: 16px !important; - margin-bottom: 0px !important; + margin-top: 1em ; + margin-bottom: 0px; +} + +.subs p.caption { + margin-top: 0; } .subs .subs .caption + .src { @@ -712,7 +730,7 @@ div#style-menu-holder { } .subs .subs .src + .src { - margin-top: 8px; + margin: 7px 0 0 0; } /* Render short-style data instances */ -- cgit v1.2.3 From a69311708493efe8524aed0e9d19365f79f2fab3 Mon Sep 17 00:00:00 2001 From: Alec Theriault Date: Wed, 24 Oct 2018 17:31:09 -0700 Subject: Resurrect the style-switcher This fixes #810. Looks like things were broken during the quickjump refactor of the JS. For the (git) record: I do not think the style switcher is a good idea. I'm fixing it for the same reason @mzero added it; as an answer to "rumblings from some that they didn't want their pixels changed on bit" --- .../resources/html/Classic.theme/xhaddock.css | 1 + .../html/NewOcean.std-theme/new-ocean.css | 9 +- haddock-api/resources/html/haddock-bundle.min.js | 2 +- haddock-api/resources/html/js-src/style-menu.ts | 116 ------------------- haddock-api/resources/html/js-src/style-menu.tsx | 126 +++++++++++++++++++++ haddock-api/resources/html/quick-jump.min.js | 2 +- 6 files changed, 134 insertions(+), 122 deletions(-) delete mode 100644 haddock-api/resources/html/js-src/style-menu.ts create mode 100644 haddock-api/resources/html/js-src/style-menu.tsx (limited to 'haddock-api/resources/html/NewOcean.std-theme') diff --git a/haddock-api/resources/html/Classic.theme/xhaddock.css b/haddock-api/resources/html/Classic.theme/xhaddock.css index b8164815..e7488cd2 100644 --- a/haddock-api/resources/html/Classic.theme/xhaddock.css +++ b/haddock-api/resources/html/Classic.theme/xhaddock.css @@ -153,6 +153,7 @@ div#style-menu-holder { text-align: center; right: 0; padding: 2px 2px 1px; + top: 1.25em; } #style-menu li { diff --git a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css index ca1d2aaf..e390f225 100644 --- a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css +++ b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css @@ -138,6 +138,7 @@ body.js-enabled .hide-when-js-enabled { white-space: nowrap; height: 40px; padding: 4px 1.5em 0px 1.5em; + overflow: visible; display: flex; justify-content: space-between; @@ -336,7 +337,7 @@ ul.links li { padding: 0; } -ul.links li + li:before { +ul.links > li + li:before { content: '\00B7'; } @@ -428,7 +429,6 @@ pre + pre { font-size: 1.2em; text-align: left; margin: 0 auto; - overflow: hidden; } #package-header .caption { @@ -480,16 +480,17 @@ div#style-menu-holder { } #style-menu li { - display: list-item; + display: inline-block; border-style: none; margin: 0; padding: 0; color: #000; list-style-type: none; + border-top: 1px solid #919191 } #style-menu li + li { - border-top: 1px solid #919191; + border-left: 1px solid #919191; } #style-menu a { diff --git a/haddock-api/resources/html/haddock-bundle.min.js b/haddock-api/resources/html/haddock-bundle.min.js index 1061714b..7881dc10 100644 --- a/haddock-api/resources/html/haddock-bundle.min.js +++ b/haddock-api/resources/html/haddock-bundle.min.js @@ -1,2 +1,2 @@ -!function e(t,n,o){function r(s,a){if(!n[s]){if(!t[s]){var l="function"==typeof require&&require;if(!a&&l)return l(s,!0);if(i)return i(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[s]={exports:{}};t[s][0].call(u.exports,function(e){var n=t[s][1][e];return r(n||e)},u,u.exports,e,t,n,o)}return n[s].exports}for(var i="function"==typeof require&&require,s=0;s element with id '"+e+"'");return t}function r(e){for(var t=e.target,n=t.id,r=o(n),i=r.element.open,s=0,l=r.toggles;s0&&(d[n.id]={element:n,openByDefault:!!n.open,toggles:[]},n.addEventListener("toggle",r))}}function s(e){var t=o(e).element;t.open=!t.open}function a(){var e=Object.keys(p);document.cookie="toggled="+encodeURIComponent(e.join("+"))}function l(){var e=h.getCookie("toggled");if(e)for(var t=0,n=e.split("+");t=0&&e.followActiveLink()),"s"===t.key&&"input"!==t.target.tagName.toLowerCase()&&(t.preventDefault(),e.show())})},t.prototype.hide=function(){this.setState({isVisible:!1,searchString:""})},t.prototype.show=function(){this.state.isVisible||(this.focusPlease=!0,this.setState({isVisible:!0,activeLinkIndex:-1}))},t.prototype.toggleVisibility=function(){this.state.isVisible?this.hide():this.show()},t.prototype.navigateLinks=function(e){var t=Math.max(-1,Math.min(this.linkIndex-1,this.state.activeLinkIndex+e));this.navigatedByKeyboard=!0,this.setState({activeLinkIndex:t})},t.prototype.followActiveLink=function(){this.activeLinkAction&&this.activeLinkAction()},t.prototype.updateResults=function(){var e=this.input&&this.input.value||"",t={};this.state.fuse.search(e).forEach(function(e){var n=e.item.module;(t[n]||(t[n]=[])).push(e)});var n=[];for(var o in t)!function(e){var o=t[e],r=0;o.forEach(function(e){r+=1/e.score}),n.push({module:e,totalScore:1/r,items:o})}(o);n.sort(function(e,t){return e.totalScore-t.totalScore}),this.setState({searchString:e,isVisible:!0,moduleResults:n})},t.prototype.componentDidUpdate=function(){if(this.searchResults&&this.activeLink&&this.navigatedByKeyboard){var e=this.activeLink.getClientRects()[0],t=this.searchResults.getClientRects()[0].top;e.bottom>window.innerHeight?this.searchResults.scrollTop+=e.bottom-window.innerHeight+80:e.top=0}function s(e,t){var n=o(e.className||"");n.indexOf(" "+t+" ")<0&&(e.className=r(n+" "+t))}function a(e,t){var n=o(e.className||"");n=n.replace(" "+t+" "," "),e.className=r(n)}function l(e,t,n,o){return null==o&&(o=!i(e,t)),o?(a(e,n),s(e,t)):(a(e,t),s(e,n)),o}function c(e){var t=document.getElementById("page-menu");if(t&&t.firstChild){var n=t.firstChild.cloneNode(!1);n.innerHTML=e,t.appendChild(n)}}function u(){return Array.prototype.slice.call(document.getElementsByTagName("link")).filter(function(e){return-1!=e.rel.indexOf("style")&&e.title})}function h(){var e=u(),t="";e.forEach(function(e){t+="
  • "+e.title+"
  • "}),e.length>1&&c("")}function d(e){for(var t=u(),n=null,o=0;on)return i(e,this.pattern,o);var r=this.options,a=r.location,l=r.distance,c=r.threshold,u=r.findAllMatches,h=r.minMatchCharLength;return s(e,this.pattern,this.patternAlphabet,{location:a,distance:l,threshold:c,findAllMatches:u,minMatchCharLength:h})}}]),e}();e.exports=l},function(e,t,n){"use strict";var o=n(0),r=function e(t,n,r){if(n){var i=n.indexOf("."),s=n,a=null;-1!==i&&(s=n.slice(0,i),a=n.slice(i+1));var l=t[s];if(null!==l&&void 0!==l)if(a||"string"!=typeof l&&"number"!=typeof l)if(o(l))for(var c=0,u=l.length;c0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=[],o=-1,r=-1,i=0,s=e.length;i=t&&n.push([o,r]),o=-1)}return e[i-1]&&i-o>=t&&n.push([o,i-1]),n}},function(e,t,n){"use strict";e.exports=function(e){for(var t={},n=e.length,o=0;o2&&void 0!==arguments[2]?arguments[2]:/ +/g,r=new RegExp(t.replace(o,"\\$&").replace(n,"|")),i=e.match(r),s=!!i,a=[];if(s)for(var l=0,c=i.length;l=E;P-=1){var R=P-1,U=n[e.charAt(R)];if(U&&(b[R]=1),j[P]=(j[P+1]<<1|1)&U,0!==I&&(j[P]|=(L[P+1]|L[P])<<1|1|L[P+1]),j[P]&N&&(C=o(t,{errors:I,currentLocation:R,expectedLocation:g,distance:c}))<=y){if(y=C,(_=R)<=g)break;E=Math.max(1,2*g-_)}}if(o(t,{errors:I+1,currentLocation:g,expectedLocation:g,distance:c})>y)break;L=j}return{isMatch:_>=0,score:0===C?.001:C,matchedIndices:r(b,v)}}},function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"",t=[];if(this.options.tokenize)for(var n=e.split(this.options.tokenSeparator),o=0,r=n.length;o0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1],n=this.list,o={},r=[];if("string"==typeof n[0]){for(var i=0,s=n.length;i1)throw new Error("Key weight has to be > 0 and <= 1");p=p.name}else a[p]={weight:1};this._analyze({key:p,value:this.options.getFn(u,p),record:u,index:l},{resultMap:o,results:r,tokenSearchers:e,fullSearcher:t})}return{weights:a,results:r}}},{key:"_analyze",value:function(e,t){var n=e.key,o=e.arrayIndex,r=void 0===o?-1:o,i=e.value,s=e.record,l=e.index,c=t.tokenSearchers,u=void 0===c?[]:c,h=t.fullSearcher,d=void 0===h?[]:h,p=t.resultMap,f=void 0===p?{}:p,v=t.results,g=void 0===v?[]:v;if(void 0!==i&&null!==i){var m=!1,y=-1,_=0;if("string"==typeof i){this._log("\nKey: "+(""===n?"-":n));var k=d.search(i);if(this._log('Full text: "'+i+'", score: '+k.score),this.options.tokenize){for(var b=i.split(this.options.tokenSeparator),x=[],w=0;w-1&&(E=(E+y)/2),this._log("Score average:",E);var T=!this.options.tokenize||!this.options.matchAllTokens||_>=u.length;if(this._log("\nCheck Matches: "+T),(m||k.isMatch)&&T){var j=f[l];j?j.output.push({key:n,arrayIndex:r,value:i,score:E,matchedIndices:k.matchedIndices}):(f[l]={item:s,output:[{key:n,arrayIndex:r,value:i,score:E,matchedIndices:k.matchedIndices}]},g.push(f[l]))}}else if(a(i))for(var P=0,R=i.length;P-1&&(s.arrayIndex=i.arrayIndex),t.matches.push(s)}}}),this.options.includeScore&&n.push(function(e,t){t.score=e.score});for(var o=0,r=e.length;o2;)A.push(arguments[s]);for(n&&null!=n.children&&(A.length||A.push(n.children),delete n.children);A.length;)if((r=A.pop())&&void 0!==r.pop)for(s=r.length;s--;)A.push(r[s]);else"boolean"==typeof r&&(r=null),(i="function"!=typeof t)&&(null==r?r="":"number"==typeof r?r=String(r):"string"!=typeof r&&(i=!1)),i&&o?a[a.length-1]+=r:a===O?a=[r]:a.push(r),o=i;var l=new e;return l.nodeName=t,l.children=a,l.attributes=null==n?void 0:n,l.key=null==n?void 0:n.key,void 0!==I.vnode&&I.vnode(l),l}function o(e,t){for(var n in t)e[n]=t[n];return e}function r(e){!e.__d&&(e.__d=!0)&&1==j.push(e)&&(I.debounceRendering||E)(i)}function i(){var e,t=j;for(j=[];e=t.pop();)e.__d&&L(e)}function s(e,t,n){return"string"==typeof t||"number"==typeof t?void 0!==e.splitText:"string"==typeof t.nodeName?!e._componentConstructor&&a(e,t.nodeName):n||e._componentConstructor===t.nodeName}function a(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function l(e){var t=o({},e.attributes);t.children=e.children;var n=e.nodeName.defaultProps;if(void 0!==n)for(var r in n)void 0===t[r]&&(t[r]=n[r]);return t}function c(e,t){var n=t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e);return n.__n=e,n}function u(e){var t=e.parentNode;t&&t.removeChild(e)}function h(e,t,n,o,r){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),o&&o(e);else if("class"!==t||r)if("style"===t){if(o&&"string"!=typeof o&&"string"!=typeof n||(e.style.cssText=o||""),o&&"object"==typeof o){if("string"!=typeof n)for(var i in n)i in o||(e.style[i]="");for(var i in o)e.style[i]="number"==typeof o[i]&&!1===T.test(i)?o[i]+"px":o[i]}}else if("dangerouslySetInnerHTML"===t)o&&(e.innerHTML=o.__html||"");else if("o"==t[0]&&"n"==t[1]){var s=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),o?n||e.addEventListener(t,p,s):e.removeEventListener(t,p,s),(e.__l||(e.__l={}))[t]=o}else if("list"!==t&&"type"!==t&&!r&&t in e)d(e,t,null==o?"":o),null!=o&&!1!==o||e.removeAttribute(t);else{var a=r&&t!==(t=t.replace(/^xlink\:?/,""));null==o||!1===o?a?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof o&&(a?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),o):e.setAttribute(t,o))}else e.className=o||""}function d(e,t,n){try{e[t]=n}catch(e){}}function p(e){return this.__l[e.type](I.event&&I.event(e)||e)}function f(){for(var e;e=P.pop();)I.afterMount&&I.afterMount(e),e.componentDidMount&&e.componentDidMount()}function v(e,t,n,o,r,i){R++||(U=null!=r&&void 0!==r.ownerSVGElement,D=null!=e&&!("__preactattr_"in e));var s=g(e,t,n,o,i);return r&&s.parentNode!==r&&r.appendChild(s),--R||(D=!1,i||f()),s}function g(e,t,n,o,r){var i=e,s=U;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||r)?e.nodeValue!=t&&(e.nodeValue=t):(i=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(i,e),y(e,!0))),i.__preactattr_=!0,i;var l=t.nodeName;if("function"==typeof l)return C(e,t,n,o);if(U="svg"===l||"foreignObject"!==l&&U,l=String(l),(!e||!a(e,l))&&(i=c(l,U),e)){for(;e.firstChild;)i.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(i,e),y(e,!0)}var u=i.firstChild,h=i.__preactattr_,d=t.children;if(null==h){h=i.__preactattr_={};for(var p=i.attributes,f=p.length;f--;)h[p[f].name]=p[f].value}return!D&&d&&1===d.length&&"string"==typeof d[0]&&null!=u&&void 0!==u.splitText&&null==u.nextSibling?u.nodeValue!=d[0]&&(u.nodeValue=d[0]):(d&&d.length||null!=u)&&m(i,d,n,o,D||null!=h.dangerouslySetInnerHTML),k(i,t.attributes,h),U=s,i}function m(e,t,n,o,r){var i,a,l,c,h,d=e.childNodes,p=[],f={},v=0,m=0,_=d.length,k=0,b=t?t.length:0;if(0!==_)for(L=0;L<_;L++){var x=d[L],w=x.__preactattr_;null!=(S=b&&w?x._component?x._component.__k:w.key:null)?(v++,f[S]=x):(w||(void 0!==x.splitText?!r||x.nodeValue.trim():r))&&(p[k++]=x)}if(0!==b)for(L=0;L2?[].slice.call(arguments,2):e.children)},Component:N,render:function(e,t,n){return v(n,e,{},!1,t,!1)},rerender:i,options:I};void 0!==t?t.exports=F:self.preact=F}()},{}]},{},[3]); +!function i(s,a,l){function c(t,e){if(!a[t]){if(!s[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(u)return u(t,!0);var o=new Error("Cannot find module '"+t+"'");throw o.code="MODULE_NOT_FOUND",o}var r=a[t]={exports:{}};s[t][0].call(r.exports,function(e){return c(s[t][1][e]||e)},r,r.exports,i,s,a,l)}return a[t].exports}for(var u="function"==typeof require&&require,e=0;e element with id '"+e+"'");return t}function o(e){for(var t,n=e.target,o=n.id,r=u(o),i=r.element.open,s=0,a=r.toggles;swindow.innerHeight?this.searchResults.scrollTop+=e.bottom-window.innerHeight+80:e.topn)return u(e,this.pattern,o);var r=this.options,i=r.location,s=r.distance,a=r.threshold,l=r.findAllMatches,c=r.minMatchCharLength;return h(e,this.pattern,this.patternAlphabet,{location:i,distance:s,threshold:a,findAllMatches:l,minMatchCharLength:c})}}]),y}();e.exports=r},function(e,t,n){"use strict";var u=n(0);e.exports=function(e,t){return function e(t,n,o){if(n){var r=n.indexOf("."),i=n,s=null;-1!==r&&(i=n.slice(0,r),s=n.slice(r+1));var a=t[i];if(null!=a)if(s||"string"!=typeof a&&"number"!=typeof a)if(u(a))for(var l=0,c=a.length;l 0 and <= 1");p=p.name}else a[p]={weight:1};this._analyze({key:p,value:this.options.getFn(u,p),record:u,index:l},{resultMap:o,results:r,tokenSearchers:e,fullSearcher:t})}return{weights:a,results:r}}},{key:"_analyze",value:function(e,t){var n=e.key,o=e.arrayIndex,r=void 0===o?-1:o,i=e.value,s=e.record,a=e.index,l=t.tokenSearchers,c=void 0===l?[]:l,u=t.fullSearcher,h=void 0===u?[]:u,d=t.resultMap,p=void 0===d?{}:d,f=t.results,v=void 0===f?[]:f;if(null!=i){var g=!1,m=-1,y=0;if("string"==typeof i){this._log("\nKey: "+(""===n?"-":n));var _=h.search(i);if(this._log('Full text: "'+i+'", score: '+_.score),this.options.tokenize){for(var k=i.split(this.options.tokenSeparator),b=[],x=0;x=c.length;if(this._log("\nCheck Matches: "+j),(g||_.isMatch)&&j){var E=p[a];E?E.output.push({key:n,arrayIndex:r,value:i,score:I,matchedIndices:_.matchedIndices}):(p[a]={item:s,output:[{key:n,arrayIndex:r,value:i,score:I,matchedIndices:_.matchedIndices}]},v.push(p[a]))}}else if(U(i))for(var T=0,P=i.length;T= 0; -} - -function addClass(elem: Element, value: string) { - const className = spaced(elem.className || ""); - if ( className.indexOf( " " + value + " " ) < 0 ) { - elem.className = trim(className + " " + value); - } -} - -function removeClass(elem: Element, value: string) { - let className = spaced(elem.className || ""); - className = className.replace(" " + value + " ", " "); - elem.className = trim(className); -} - -function toggleClass(elem: Element, valueOn: string, valueOff: string, bool?: boolean): boolean { - if (bool == null) { bool = ! hasClass(elem, valueOn); } - if (bool) { - removeClass(elem, valueOff); - addClass(elem, valueOn); - } - else { - removeClass(elem, valueOn); - addClass(elem, valueOff); - } - return bool; -} - -function makeClassToggle(valueOn: string, valueOff: string): (elem: Element, bool?: boolean) => boolean { - return function(elem, bool) { - return toggleClass(elem, valueOn, valueOff, bool); - } -} - -const toggleShow = makeClassToggle("show", "hide"); - -function addMenuItem(html: string) { - const menu = document.getElementById("page-menu"); - if (menu && menu.firstChild) { - const btn = menu.firstChild.cloneNode(false) as Element; - btn.innerHTML = html; - menu.appendChild(btn); - } -} - -function styles(): HTMLLinkElement[] { - const es = Array.prototype.slice.call(document.getElementsByTagName("link")); - return es.filter((a: HTMLLinkElement) => a.rel.indexOf("style") != -1 && a.title); -} - -function addStyleMenu() { - const as = styles(); - let btns = ""; - as.forEach((a) => { - btns += "
  • " - + a.title + "
  • " - }); - if (as.length > 1) { - const h = "
    " - + "Style ▾" - + "
      " + btns + "
    " - + "
    "; - addMenuItem(h); - } -} - -function setActiveStyleSheet(title: string) { - const as = styles(); - let found: null | HTMLLinkElement = null; - for(let i = 0; i < as.length; i++) { - const a = as[i]; - a.disabled = true; - // need to do this always, some browsers are edge triggered - if(a.title == title) { - found = a; - } - } - if (found) { - found.disabled = false; - setCookie("haddock-style", title); - } - else { - as[0].disabled = false; - clearCookie("haddock-style"); - } - styleMenu(false); -} - -function resetStyle() { - const s = getCookie("haddock-style"); - if (s) setActiveStyleSheet(s); -} - -function styleMenu(show?: boolean) { - const m = document.getElementById('style-menu'); - if (m) toggleShow(m, show); -} - -export function init() { - addStyleMenu(); - resetStyle(); -} \ No newline at end of file diff --git a/haddock-api/resources/html/js-src/style-menu.tsx b/haddock-api/resources/html/js-src/style-menu.tsx new file mode 100644 index 00000000..bab840ca --- /dev/null +++ b/haddock-api/resources/html/js-src/style-menu.tsx @@ -0,0 +1,126 @@ +// Haddock JavaScript utilities + +import {getCookie, setCookie, clearCookie} from "./cookies"; +import preact = require("preact"); + +const { h, Component } = preact; +const rspace = /\s\s+/g, + rtrim = /^\s+|\s+$/g; + +function spaced(s: string) { return (" " + s + " ").replace(rspace, " "); } +function trim(s: string) { return s.replace(rtrim, ""); } + +function hasClass(elem: Element, value: string) { + const className = spaced(elem.className || ""); + return className.indexOf( " " + value + " " ) >= 0; +} + +function addClass(elem: Element, value: string) { + const className = spaced(elem.className || ""); + if ( className.indexOf( " " + value + " " ) < 0 ) { + elem.className = trim(className + " " + value); + } +} + +function removeClass(elem: Element, value: string) { + let className = spaced(elem.className || ""); + className = className.replace(" " + value + " ", " "); + elem.className = trim(className); +} + +function toggleClass(elem: Element, valueOn: string, valueOff: string, bool?: boolean): boolean { + if (bool == null) { bool = ! hasClass(elem, valueOn); } + if (bool) { + removeClass(elem, valueOff); + addClass(elem, valueOn); + } + else { + removeClass(elem, valueOn); + addClass(elem, valueOff); + } + return bool; +} + +function makeClassToggle(valueOn: string, valueOff: string): (elem: Element, bool?: boolean) => boolean { + return function(elem, bool) { + return toggleClass(elem, valueOn, valueOff, bool); + } +} + +const toggleShow = makeClassToggle("show", "hide"); + +function styles(): HTMLLinkElement[] { + const es = Array.prototype.slice.call(document.getElementsByTagName("link")); + return es.filter((a: HTMLLinkElement) => a.rel.indexOf("style") != -1 && a.title); +} + +class StyleMenuButton extends Component { + + render(props: { stys: string[] }) { + function action() { + styleMenu(); + return false; + }; + + return
  • + Style ▾ +
      + {props.stys.map((sty) => { + function action() { + setActiveStyleSheet(sty); + return false; + }; + + return
    • {sty}
    • ; + })} +
    +
  • ; + } + +} + +function addStyleMenu() { + const stys = styles().map((s) => s.title); + if (stys.length > 1) { + const pageMenu = document.querySelector('#page-menu') as HTMLUListElement; + const dummy = document.createElement('li'); + pageMenu.appendChild(dummy); + preact.render(, pageMenu, dummy); + } +} + +function setActiveStyleSheet(title: string) { + const as = styles(); + let found: null | HTMLLinkElement = null; + for(let i = 0; i < as.length; i++) { + const a = as[i]; + a.disabled = true; + // need to do this always, some browsers are edge triggered + if(a.title == title) { + found = a; + } + } + if (found) { + found.disabled = false; + setCookie("haddock-style", title); + } + else { + as[0].disabled = false; + clearCookie("haddock-style"); + } +} + +function resetStyle() { + const s = getCookie("haddock-style"); + if (s) setActiveStyleSheet(s); +} + +function styleMenu(show?: boolean) { + const m = document.getElementById('style-menu'); + if (m) toggleShow(m, show); +} + +export function init() { + addStyleMenu(); + resetStyle(); +} diff --git a/haddock-api/resources/html/quick-jump.min.js b/haddock-api/resources/html/quick-jump.min.js index c03e0836..06c35c74 100644 --- a/haddock-api/resources/html/quick-jump.min.js +++ b/haddock-api/resources/html/quick-jump.min.js @@ -1,2 +1,2 @@ -!function e(t,n,o){function r(s,a){if(!n[s]){if(!t[s]){var l="function"==typeof require&&require;if(!a&&l)return l(s,!0);if(i)return i(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[s]={exports:{}};t[s][0].call(u.exports,function(e){var n=t[s][1][e];return r(n||e)},u,u.exports,e,t,n,o)}return n[s].exports}for(var i="function"==typeof require&&require,s=0;s=0&&e.followActiveLink()),"s"===t.key&&"input"!==t.target.tagName.toLowerCase()&&(t.preventDefault(),e.show())})},t.prototype.hide=function(){this.setState({isVisible:!1,searchString:""})},t.prototype.show=function(){this.state.isVisible||(this.focusPlease=!0,this.setState({isVisible:!0,activeLinkIndex:-1}))},t.prototype.toggleVisibility=function(){this.state.isVisible?this.hide():this.show()},t.prototype.navigateLinks=function(e){var t=Math.max(-1,Math.min(this.linkIndex-1,this.state.activeLinkIndex+e));this.navigatedByKeyboard=!0,this.setState({activeLinkIndex:t})},t.prototype.followActiveLink=function(){this.activeLinkAction&&this.activeLinkAction()},t.prototype.updateResults=function(){var e=this.input&&this.input.value||"",t={};this.state.fuse.search(e).forEach(function(e){var n=e.item.module;(t[n]||(t[n]=[])).push(e)});var n=[];for(var o in t)!function(e){var o=t[e],r=0;o.forEach(function(e){r+=1/e.score}),n.push({module:e,totalScore:1/r,items:o})}(o);n.sort(function(e,t){return e.totalScore-t.totalScore}),this.setState({searchString:e,isVisible:!0,moduleResults:n})},t.prototype.componentDidUpdate=function(){if(this.searchResults&&this.activeLink&&this.navigatedByKeyboard){var e=this.activeLink.getClientRects()[0],t=this.searchResults.getClientRects()[0].top;e.bottom>window.innerHeight?this.searchResults.scrollTop+=e.bottom-window.innerHeight+80:e.topn)return i(e,this.pattern,o);var r=this.options,a=r.location,l=r.distance,c=r.threshold,u=r.findAllMatches,h=r.minMatchCharLength;return s(e,this.pattern,this.patternAlphabet,{location:a,distance:l,threshold:c,findAllMatches:u,minMatchCharLength:h})}}]),e}();e.exports=l},function(e,t,n){"use strict";var o=n(0),r=function e(t,n,r){if(n){var i=n.indexOf("."),s=n,a=null;-1!==i&&(s=n.slice(0,i),a=n.slice(i+1));var l=t[s];if(null!==l&&void 0!==l)if(a||"string"!=typeof l&&"number"!=typeof l)if(o(l))for(var c=0,u=l.length;c0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=[],o=-1,r=-1,i=0,s=e.length;i=t&&n.push([o,r]),o=-1)}return e[i-1]&&i-o>=t&&n.push([o,i-1]),n}},function(e,t,n){"use strict";e.exports=function(e){for(var t={},n=e.length,o=0;o2&&void 0!==arguments[2]?arguments[2]:/ +/g,r=new RegExp(t.replace(o,"\\$&").replace(n,"|")),i=e.match(r),s=!!i,a=[];if(s)for(var l=0,c=i.length;l=O;E-=1){var R=E-1,U=n[e.charAt(R)];if(U&&(b[R]=1),P[E]=(P[E+1]<<1|1)&U,0!==I&&(P[E]|=(L[E+1]|L[E])<<1|1|L[E+1]),P[E]&N&&(C=o(t,{errors:I,currentLocation:R,expectedLocation:_,distance:c}))<=m){if(m=C,(y=R)<=_)break;O=Math.max(1,2*_-y)}}if(o(t,{errors:I+1,currentLocation:_,expectedLocation:_,distance:c})>m)break;L=P}return{isMatch:y>=0,score:0===C?.001:C,matchedIndices:r(b,v)}}},function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"",t=[];if(this.options.tokenize)for(var n=e.split(this.options.tokenSeparator),o=0,r=n.length;o0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1],n=this.list,o={},r=[];if("string"==typeof n[0]){for(var i=0,s=n.length;i1)throw new Error("Key weight has to be > 0 and <= 1");d=d.name}else a[d]={weight:1};this._analyze({key:d,value:this.options.getFn(u,d),record:u,index:l},{resultMap:o,results:r,tokenSearchers:e,fullSearcher:t})}return{weights:a,results:r}}},{key:"_analyze",value:function(e,t){var n=e.key,o=e.arrayIndex,r=void 0===o?-1:o,i=e.value,s=e.record,l=e.index,c=t.tokenSearchers,u=void 0===c?[]:c,h=t.fullSearcher,p=void 0===h?[]:h,d=t.resultMap,f=void 0===d?{}:d,v=t.results,_=void 0===v?[]:v;if(void 0!==i&&null!==i){var g=!1,m=-1,y=0;if("string"==typeof i){this._log("\nKey: "+(""===n?"-":n));var k=p.search(i);if(this._log('Full text: "'+i+'", score: '+k.score),this.options.tokenize){for(var b=i.split(this.options.tokenSeparator),x=[],w=0;w-1&&(O=(O+m)/2),this._log("Score average:",O);var j=!this.options.tokenize||!this.options.matchAllTokens||y>=u.length;if(this._log("\nCheck Matches: "+j),(g||k.isMatch)&&j){var P=f[l];P?P.output.push({key:n,arrayIndex:r,value:i,score:O,matchedIndices:k.matchedIndices}):(f[l]={item:s,output:[{key:n,arrayIndex:r,value:i,score:O,matchedIndices:k.matchedIndices}]},_.push(f[l]))}}else if(a(i))for(var E=0,R=i.length;E-1&&(s.arrayIndex=i.arrayIndex),t.matches.push(s)}}}),this.options.includeScore&&n.push(function(e,t){t.score=e.score});for(var o=0,r=e.length;o2;)A.push(arguments[s]);for(n&&null!=n.children&&(A.length||A.push(n.children),delete n.children);A.length;)if((r=A.pop())&&void 0!==r.pop)for(s=r.length;s--;)A.push(r[s]);else"boolean"==typeof r&&(r=null),(i="function"!=typeof t)&&(null==r?r="":"number"==typeof r?r=String(r):"string"!=typeof r&&(i=!1)),i&&o?a[a.length-1]+=r:a===T?a=[r]:a.push(r),o=i;var l=new e;return l.nodeName=t,l.children=a,l.attributes=null==n?void 0:n,l.key=null==n?void 0:n.key,void 0!==I.vnode&&I.vnode(l),l}function o(e,t){for(var n in t)e[n]=t[n];return e}function r(e){!e.__d&&(e.__d=!0)&&1==P.push(e)&&(I.debounceRendering||O)(i)}function i(){var e,t=P;for(P=[];e=t.pop();)e.__d&&L(e)}function s(e,t,n){return"string"==typeof t||"number"==typeof t?void 0!==e.splitText:"string"==typeof t.nodeName?!e._componentConstructor&&a(e,t.nodeName):n||e._componentConstructor===t.nodeName}function a(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function l(e){var t=o({},e.attributes);t.children=e.children;var n=e.nodeName.defaultProps;if(void 0!==n)for(var r in n)void 0===t[r]&&(t[r]=n[r]);return t}function c(e,t){var n=t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e);return n.__n=e,n}function u(e){var t=e.parentNode;t&&t.removeChild(e)}function h(e,t,n,o,r){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),o&&o(e);else if("class"!==t||r)if("style"===t){if(o&&"string"!=typeof o&&"string"!=typeof n||(e.style.cssText=o||""),o&&"object"==typeof o){if("string"!=typeof n)for(var i in n)i in o||(e.style[i]="");for(var i in o)e.style[i]="number"==typeof o[i]&&!1===j.test(i)?o[i]+"px":o[i]}}else if("dangerouslySetInnerHTML"===t)o&&(e.innerHTML=o.__html||"");else if("o"==t[0]&&"n"==t[1]){var s=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),o?n||e.addEventListener(t,d,s):e.removeEventListener(t,d,s),(e.__l||(e.__l={}))[t]=o}else if("list"!==t&&"type"!==t&&!r&&t in e)p(e,t,null==o?"":o),null!=o&&!1!==o||e.removeAttribute(t);else{var a=r&&t!==(t=t.replace(/^xlink\:?/,""));null==o||!1===o?a?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof o&&(a?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),o):e.setAttribute(t,o))}else e.className=o||""}function p(e,t,n){try{e[t]=n}catch(e){}}function d(e){return this.__l[e.type](I.event&&I.event(e)||e)}function f(){for(var e;e=E.pop();)I.afterMount&&I.afterMount(e),e.componentDidMount&&e.componentDidMount()}function v(e,t,n,o,r,i){R++||(U=null!=r&&void 0!==r.ownerSVGElement,D=null!=e&&!("__preactattr_"in e));var s=_(e,t,n,o,i);return r&&s.parentNode!==r&&r.appendChild(s),--R||(D=!1,i||f()),s}function _(e,t,n,o,r){var i=e,s=U;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||r)?e.nodeValue!=t&&(e.nodeValue=t):(i=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(i,e),m(e,!0))),i.__preactattr_=!0,i;var l=t.nodeName;if("function"==typeof l)return C(e,t,n,o);if(U="svg"===l||"foreignObject"!==l&&U,l=String(l),(!e||!a(e,l))&&(i=c(l,U),e)){for(;e.firstChild;)i.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(i,e),m(e,!0)}var u=i.firstChild,h=i.__preactattr_,p=t.children;if(null==h){h=i.__preactattr_={};for(var d=i.attributes,f=d.length;f--;)h[d[f].name]=d[f].value}return!D&&p&&1===p.length&&"string"==typeof p[0]&&null!=u&&void 0!==u.splitText&&null==u.nextSibling?u.nodeValue!=p[0]&&(u.nodeValue=p[0]):(p&&p.length||null!=u)&&g(i,p,n,o,D||null!=h.dangerouslySetInnerHTML),k(i,t.attributes,h),U=s,i}function g(e,t,n,o,r){var i,a,l,c,h,p=e.childNodes,d=[],f={},v=0,g=0,y=p.length,k=0,b=t?t.length:0;if(0!==y)for(L=0;L2?[].slice.call(arguments,2):e.children)},Component:N,render:function(e,t,n){return v(n,e,{},!1,t,!1)},rerender:i,options:I};void 0!==t?t.exports=F:self.preact=F}()},{}]},{},[1]); +!function i(s,a,l){function c(t,e){if(!a[t]){if(!s[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(u)return u(t,!0);var o=new Error("Cannot find module '"+t+"'");throw o.code="MODULE_NOT_FOUND",o}var r=a[t]={exports:{}};s[t][0].call(r.exports,function(e){return c(s[t][1][e]||e)},r,r.exports,i,s,a,l)}return a[t].exports}for(var u="function"==typeof require&&require,e=0;ewindow.innerHeight?this.searchResults.scrollTop+=e.bottom-window.innerHeight+80:e.topn)return u(e,this.pattern,o);var r=this.options,i=r.location,s=r.distance,a=r.threshold,l=r.findAllMatches,c=r.minMatchCharLength;return h(e,this.pattern,this.patternAlphabet,{location:i,distance:s,threshold:a,findAllMatches:l,minMatchCharLength:c})}}]),m}();e.exports=r},function(e,t,n){"use strict";var u=n(0);e.exports=function(e,t){return function e(t,n,o){if(n){var r=n.indexOf("."),i=n,s=null;-1!==r&&(i=n.slice(0,r),s=n.slice(r+1));var a=t[i];if(null!=a)if(s||"string"!=typeof a&&"number"!=typeof a)if(u(a))for(var l=0,c=a.length;l 0 and <= 1");d=d.name}else a[d]={weight:1};this._analyze({key:d,value:this.options.getFn(u,d),record:u,index:l},{resultMap:o,results:r,tokenSearchers:e,fullSearcher:t})}return{weights:a,results:r}}},{key:"_analyze",value:function(e,t){var n=e.key,o=e.arrayIndex,r=void 0===o?-1:o,i=e.value,s=e.record,a=e.index,l=t.tokenSearchers,c=void 0===l?[]:l,u=t.fullSearcher,h=void 0===u?[]:u,p=t.resultMap,d=void 0===p?{}:p,f=t.results,v=void 0===f?[]:f;if(null!=i){var g=!1,_=-1,m=0;if("string"==typeof i){this._log("\nKey: "+(""===n?"-":n));var y=h.search(i);if(this._log('Full text: "'+i+'", score: '+y.score),this.options.tokenize){for(var k=i.split(this.options.tokenSeparator),b=[],x=0;x=c.length;if(this._log("\nCheck Matches: "+O),(g||y.isMatch)&&O){var P=d[a];P?P.output.push({key:n,arrayIndex:r,value:i,score:T,matchedIndices:y.matchedIndices}):(d[a]={item:s,output:[{key:n,arrayIndex:r,value:i,score:T,matchedIndices:y.matchedIndices}]},v.push(d[a]))}}else if(U(i))for(var j=0,E=i.length;j Date: Wed, 24 Oct 2018 17:38:07 -0700 Subject: Fix copy-pasta error in data-files --- haddock-api/haddock-api.cabal | 10 +++++----- .../resources/html/NewOcean.std-theme/hslogo-16.png | Bin 1684 -> 0 bytes 2 files changed, 5 insertions(+), 5 deletions(-) delete mode 100644 haddock-api/resources/html/NewOcean.std-theme/hslogo-16.png (limited to 'haddock-api/resources/html/NewOcean.std-theme') diff --git a/haddock-api/haddock-api.cabal b/haddock-api/haddock-api.cabal index 70e4c2cc..d5c976b6 100644 --- a/haddock-api/haddock-api.cabal +++ b/haddock-api/haddock-api.cabal @@ -29,11 +29,11 @@ data-files: html/Classic.theme/minus.gif html/Classic.theme/plus.gif html/Classic.theme/xhaddock.css - html/Ocean.std-theme/hslogo-16.png - html/Ocean.std-theme/minus.gif - html/Ocean.std-theme/ocean.css - html/Ocean.std-theme/plus.gif - html/Ocean.std-theme/synopsis.png + html/Ocean.theme/hslogo-16.png + html/Ocean.theme/minus.gif + html/Ocean.theme/ocean.css + html/Ocean.theme/plus.gif + html/Ocean.theme/synopsis.png html/NewOcean.std-theme/hslogo-16.png html/NewOcean.std-theme/minus.gif html/NewOcean.std-theme/new-ocean.css diff --git a/haddock-api/resources/html/NewOcean.std-theme/hslogo-16.png b/haddock-api/resources/html/NewOcean.std-theme/hslogo-16.png deleted file mode 100644 index 0ff8579f..00000000 Binary files a/haddock-api/resources/html/NewOcean.std-theme/hslogo-16.png and /dev/null differ -- cgit v1.2.3 From ed1a0c923823b1372928e3ee3b9e41c1df517fc3 Mon Sep 17 00:00:00 2001 From: Alec Theriault Date: Wed, 24 Oct 2018 20:42:14 -0700 Subject: Fix the synopsis button Here's these changes are supposed to do: * put the synopsis back on the right side * properly have it on the edge of the screen on wide screens * adjust the background of the synopsis to match the button (otherwise the grey blends in with what is underneath) * get rid of the dotted purple line * the synopsis contents are now scrollable even when in wide screens (this has been a long-standing bug) --- haddock-api/resources/html/NewOcean.std-theme/new-ocean.css | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'haddock-api/resources/html/NewOcean.std-theme') diff --git a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css index e390f225..85d3c4d2 100644 --- a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css +++ b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css @@ -86,13 +86,17 @@ body.js-enabled .hide-when-js-enabled { #synopsis { display: block; position: fixed; + float: left; top: 5em; + bottom: 1em; + right: 0; max-width: 65vw; + overflow-y: scroll; /* Ensure that synopsis covers everything (including MathJAX markup) */ z-index: 1; } - #synopsis, #table-of-contents { + #table-of-contents { left: 2em; } @@ -114,7 +118,6 @@ body.js-enabled .hide-when-js-enabled { padding: 0; position: relative; margin: 0; - border-bottom: 1px dashed #5E5184; width: 100%; } } @@ -554,7 +557,7 @@ div#style-menu-holder { #synopsis summary { display: block; - float: left; + float: right; width: 29px; color: rgba(255,255,255,0); height: 110px; @@ -565,7 +568,7 @@ div#style-menu-holder { } #synopsis details[open] > summary { - background: url(synopsis.png) no-repeat -64px -8px; + background: url(synopsis.png) no-repeat -75px -8px; } #synopsis ul { @@ -581,7 +584,7 @@ div#style-menu-holder { #synopsis ul, #synopsis ul li.src { - background-color: #f7f7f7; + background-color: rgb(250,247,224); white-space: nowrap; list-style: none; margin-left: 0; -- cgit v1.2.3 From 6a5ebcc1511779f8ee7cae8cd45308ffd449b71a Mon Sep 17 00:00:00 2001 From: Alec Theriault Date: Thu, 25 Oct 2018 21:05:13 -0700 Subject: Don't hide bullets in method docs I think thst CSS was meant only to deal with fields and the effect on bullets was accidental. Fixes #926. --- haddock-api/resources/html/NewOcean.std-theme/new-ocean.css | 4 ++-- haddock-api/resources/html/Ocean.theme/ocean.css | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'haddock-api/resources/html/NewOcean.std-theme') diff --git a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css index 85d3c4d2..6751d15b 100644 --- a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css +++ b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css @@ -682,13 +682,13 @@ div#style-menu-holder { margin-bottom: 0.6em; } -.subs ul { +.subs.fields ul { list-style: none; display: table; margin: 0; } -.subs ul li { +.subs.fields ul li { display: table-row; } diff --git a/haddock-api/resources/html/Ocean.theme/ocean.css b/haddock-api/resources/html/Ocean.theme/ocean.css index ddedcace..32c68927 100644 --- a/haddock-api/resources/html/Ocean.theme/ocean.css +++ b/haddock-api/resources/html/Ocean.theme/ocean.css @@ -466,13 +466,13 @@ div#style-menu-holder { visibility: hidden; } -.subs ul { +.subs.fields ul { list-style: none; display: table; margin: 0; } -.subs ul li { +.subs.fields ul li { display: table-row; } -- cgit v1.2.3 From 949fe2d9eda0338dde8c0d3e98d0ebe7e2876205 Mon Sep 17 00:00:00 2001 From: Alec Theriault Date: Thu, 25 Oct 2018 22:02:07 -0700 Subject: Indent more things + slightly smaller font --- haddock-api/resources/html/NewOcean.std-theme/new-ocean.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'haddock-api/resources/html/NewOcean.std-theme') diff --git a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css index 6751d15b..8416176c 100644 --- a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css +++ b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css @@ -235,7 +235,7 @@ Display the package name on top of the menu links and center both elements: */ body, button { - font: 400 17px/1.43 'PT Sans', + font: 400 15px/1.4 'PT Sans', /* Fallback Font Stack */ -apple-system, BlinkMacSystemFont, @@ -672,7 +672,7 @@ div#style-menu-holder { visibility: hidden; } -.subs { +.subs, .top > .doc, .subs > .doc { padding-left: 1em; border-left: 1px solid gainsboro; margin-bottom: 1em; -- cgit v1.2.3 From f909ffd8353d6463fd5dd184998a32aa98d5c922 Mon Sep 17 00:00:00 2001 From: Alec Theriault Date: Fri, 26 Oct 2018 09:10:59 -0700 Subject: Make 'Contents' in NewOcean scrollable This only happens if the contents block on the left is so big that it doesn't fit (vertically) on the page. If that happens, we want it to be scrollable. --- haddock-api/resources/html/NewOcean.std-theme/new-ocean.css | 2 ++ 1 file changed, 2 insertions(+) (limited to 'haddock-api/resources/html/NewOcean.std-theme') diff --git a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css index 8416176c..de68d995 100644 --- a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css +++ b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css @@ -81,6 +81,8 @@ body.js-enabled .hide-when-js-enabled { position: fixed; max-width: 10vw; top: 10.2em; + bottom: 1em; + overflow-y: scroll; } #synopsis { -- cgit v1.2.3 From 74f791936f28b175265994494412698e90d0e85f Mon Sep 17 00:00:00 2001 From: Alec Theriault Date: Fri, 26 Oct 2018 09:36:46 -0700 Subject: Revert "Make 'Contents' in NewOcean scrollable" This reverts commit f909ffd8353d6463fd5dd184998a32aa98d5c922. I missed the fact this also forces the 'Contents' to always go down to the bottom of the page. --- haddock-api/resources/html/NewOcean.std-theme/new-ocean.css | 2 -- 1 file changed, 2 deletions(-) (limited to 'haddock-api/resources/html/NewOcean.std-theme') diff --git a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css index de68d995..8416176c 100644 --- a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css +++ b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css @@ -81,8 +81,6 @@ body.js-enabled .hide-when-js-enabled { position: fixed; max-width: 10vw; top: 10.2em; - bottom: 1em; - overflow-y: scroll; } #synopsis { -- cgit v1.2.3 From 2a46036ea4e2e6bb6505ebbfd3e4609aeb7c3845 Mon Sep 17 00:00:00 2001 From: Alec Theriault Date: Wed, 7 Nov 2018 10:22:31 -0800 Subject: Fix issues around plus/minus * swap the minimize unicode to something more intuitive * use new unicode expander/collapser for instance lists * address some alignment issues in the "index" page --- ghc.mk | 3 --- haddock-api/haddock-api.cabal | 3 --- haddock-api/resources/html/NewOcean.std-theme/minus.gif | Bin 56 -> 0 bytes .../resources/html/NewOcean.std-theme/new-ocean.css | 14 ++++++-------- haddock-api/resources/html/NewOcean.std-theme/plus.gif | Bin 59 -> 0 bytes haddock-api/src/Haddock/Backends/Xhtml.hs | 1 + haddock-api/src/Haddock/Backends/Xhtml/Layout.hs | 7 ++++--- 7 files changed, 11 insertions(+), 17 deletions(-) delete mode 100644 haddock-api/resources/html/NewOcean.std-theme/minus.gif delete mode 100644 haddock-api/resources/html/NewOcean.std-theme/plus.gif (limited to 'haddock-api/resources/html/NewOcean.std-theme') diff --git a/ghc.mk b/ghc.mk index a10fd61a..d3b02b6e 100644 --- a/ghc.mk +++ b/ghc.mk @@ -45,10 +45,7 @@ utils/haddock_dist_DATA_FILES += html/Ocean.theme/minus.gif utils/haddock_dist_DATA_FILES += html/Ocean.theme/ocean.css utils/haddock_dist_DATA_FILES += html/Ocean.theme/plus.gif utils/haddock_dist_DATA_FILES += html/Ocean.theme/synopsis.png -utils/haddock_dist_DATA_FILES += html/NewOcean.std-theme/hslogo-16.png -utils/haddock_dist_DATA_FILES += html/NewOcean.std-theme/minus.gif utils/haddock_dist_DATA_FILES += html/NewOcean.std-theme/new-ocean.css -utils/haddock_dist_DATA_FILES += html/NewOcean.std-theme/plus.gif utils/haddock_dist_DATA_FILES += html/NewOcean.std-theme/synopsis.png utils/haddock_dist_DATA_FILES += html/solarized.css utils/haddock_dist_DATA_FILES += html/highlight.js diff --git a/haddock-api/haddock-api.cabal b/haddock-api/haddock-api.cabal index d5c976b6..a410f436 100644 --- a/haddock-api/haddock-api.cabal +++ b/haddock-api/haddock-api.cabal @@ -34,10 +34,7 @@ data-files: html/Ocean.theme/ocean.css html/Ocean.theme/plus.gif html/Ocean.theme/synopsis.png - html/NewOcean.std-theme/hslogo-16.png - html/NewOcean.std-theme/minus.gif html/NewOcean.std-theme/new-ocean.css - html/NewOcean.std-theme/plus.gif html/NewOcean.std-theme/synopsis.png latex/haddock.sty diff --git a/haddock-api/resources/html/NewOcean.std-theme/minus.gif b/haddock-api/resources/html/NewOcean.std-theme/minus.gif deleted file mode 100644 index 1deac2fe..00000000 Binary files a/haddock-api/resources/html/NewOcean.std-theme/minus.gif and /dev/null differ diff --git a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css index 8416176c..7568032f 100644 --- a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css +++ b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css @@ -352,7 +352,7 @@ ul.links li a { .show { display: inherit; } .clear { clear: both; } -.collapser:before, .expander:before { +.collapser:before, .expander:before, .noexpander:before { font-size: 1.2em; color: #9C5791; display: inline-block; @@ -360,11 +360,15 @@ ul.links li a { } .collapser:before { - content: '⊗'; + content: '⊖'; } .expander:before { content: "⊕"; } +.noexpander:before { + content: "⊕"; + visibility: hidden; +} .collapser, .expander { cursor: pointer; @@ -380,12 +384,6 @@ ul.links li a { summary { cursor: pointer; outline: none; - list-style-image: url(plus.gif); - list-style-position: outside; -} - -details[open] > summary { - list-style-image: url(minus.gif); } pre { diff --git a/haddock-api/resources/html/NewOcean.std-theme/plus.gif b/haddock-api/resources/html/NewOcean.std-theme/plus.gif deleted file mode 100644 index 2d15c141..00000000 Binary files a/haddock-api/resources/html/NewOcean.std-theme/plus.gif and /dev/null differ diff --git a/haddock-api/src/Haddock/Backends/Xhtml.hs b/haddock-api/src/Haddock/Backends/Xhtml.hs index 2b8bdd69..2206b7dc 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml.hs @@ -324,6 +324,7 @@ mkNode pkg qual ss p (Node s leaf _pkg srcPkg short ts) = cBtn = case (ts, leaf) of (_:_, Just _) -> thespan ! collapseControl p "" << spaceHtml + ([] , Just _) -> thespan ! [theclass "noexpander"] << spaceHtml (_, _ ) -> noHtml -- We only need an explicit collapser button when the module name -- is also a leaf, and so is a link to a module page. Indeed, the diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs b/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs index 10a6d499..c935bc5f 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs @@ -195,17 +195,18 @@ subEquations :: Maybe Package -> Qualification -> [SubDecl] -> Html subEquations pkg qual = divSubDecls "equations" "Equations" . subTable pkg qual --- | Generate sub table for instance declarations, with source +-- | Generate collapsible sub table for instance declarations, with source subInstances :: Maybe Package -> Qualification -> String -- ^ Class name, used for anchor generation -> LinksInfo -> Bool -> [(SubDecl, Maybe Module, Located DocName)] -> Html subInstances pkg qual nm lnks splice = maybe noHtml wrap . instTable where - wrap contents = subSection (collapseDetails id_ DetailsOpen (summary +++ contents)) + wrap contents = subSection (hdr +++ collapseDetails id_ DetailsOpen (summary +++ contents)) instTable = subTableSrc pkg qual lnks splice subSection = thediv ! [theclass "subs instances"] - summary = thesummary << "Instances" + hdr = h4 ! collapseControl id_ "instances" << "Instances" + summary = thesummary ! [ theclass "hide-when-js-enabled" ] << "Instances details" id_ = makeAnchorId $ "i:" ++ nm -- cgit v1.2.3 From ad157c408cd7ad4badec71a84551a836a343f27b Mon Sep 17 00:00:00 2001 From: Alec Theriault Date: Wed, 7 Nov 2018 13:31:19 -0800 Subject: Allow "Contents" summary to scroll in a fixed div In the unfortunate event that the "Contents" summary doesn't fit vertically (like in the "Prelude"), it will be scrollable. --- .../resources/html/NewOcean.std-theme/new-ocean.css | 18 ++++++++---------- haddock-api/src/Haddock/Backends/Xhtml.hs | 4 ++-- haddock-api/src/Haddock/Backends/Xhtml/Layout.hs | 5 +++-- 3 files changed, 13 insertions(+), 14 deletions(-) (limited to 'haddock-api/resources/html/NewOcean.std-theme') diff --git a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css index 7568032f..906b3954 100644 --- a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css +++ b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css @@ -81,6 +81,9 @@ body.js-enabled .hide-when-js-enabled { position: fixed; max-width: 10vw; top: 10.2em; + left: 2em; + bottom: 1em; + overflow-y: scroll; } #synopsis { @@ -96,10 +99,6 @@ body.js-enabled .hide-when-js-enabled { z-index: 1; } - #table-of-contents { - left: 2em; - } - #synopsis .show { border: 1px solid #5E5184; padding: 0.7em; @@ -518,7 +517,7 @@ div#style-menu-holder { /* @group Front Matter */ #synopsis .caption, -#table-of-contents .caption { +#contents-list .caption { font-size: 1rem; } @@ -526,26 +525,25 @@ div#style-menu-holder { font-size: 16px; } -#table-of-contents { +#contents-list { background: #f7f7f7; padding: 1em; margin: 0; - margin-top: 1em; } -#table-of-contents .caption { +#contents-list .caption { text-align: left; margin: 0; } -#table-of-contents ul { +#contents-list ul { list-style: none; margin: 0; margin-top: 10px; font-size: 14px; } -#table-of-contents ul ul { +#contents-list ul ul { margin-left: 1.5em; } diff --git a/haddock-api/src/Haddock/Backends/Xhtml.hs b/haddock-api/src/Haddock/Backends/Xhtml.hs index 2206b7dc..e2fdc509 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml.hs @@ -633,9 +633,9 @@ ppModuleContents pkg qual exports orphan | null sections && not orphan = noHtml | otherwise = contentsDiv where - contentsDiv = divTableOfContents << ( + contentsDiv = divTableOfContents << (divContentsList << ( sectionName << "Contents" +++ - unordList (sections ++ orphanSection)) + unordList (sections ++ orphanSection))) (sections, _leftovers{-should be []-}) = process 0 exports orphanSection diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs b/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs index c935bc5f..25d8b07a 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs @@ -15,7 +15,7 @@ module Haddock.Backends.Xhtml.Layout ( divPackageHeader, divContent, divModuleHeader, divFooter, divTableOfContents, divDescription, divSynopsis, divInterface, - divIndex, divAlphabet, divModuleList, + divIndex, divAlphabet, divModuleList, divContentsList, sectionName, nonEmptySectionName, @@ -80,7 +80,7 @@ nonEmptySectionName c divPackageHeader, divContent, divModuleHeader, divFooter, divTableOfContents, divDescription, divSynopsis, divInterface, - divIndex, divAlphabet, divModuleList + divIndex, divAlphabet, divModuleList, divContentsList :: Html -> Html divPackageHeader = sectionDiv "package-header" @@ -88,6 +88,7 @@ divContent = sectionDiv "content" divModuleHeader = sectionDiv "module-header" divFooter = sectionDiv "footer" divTableOfContents = sectionDiv "table-of-contents" +divContentsList = sectionDiv "contents-list" divDescription = sectionDiv "description" divSynopsis = sectionDiv "synopsis" divInterface = sectionDiv "interface" -- cgit v1.2.3 From 4a5648b24e007a2c5aad023ab1bf113be9866b1d Mon Sep 17 00:00:00 2001 From: Alec Theriault Date: Wed, 7 Nov 2018 18:12:54 -0800 Subject: overflow-y 'scroll' -> 'auto' --- haddock-api/resources/html/NewOcean.std-theme/new-ocean.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'haddock-api/resources/html/NewOcean.std-theme') diff --git a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css index 906b3954..456052f1 100644 --- a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css +++ b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css @@ -83,7 +83,7 @@ body.js-enabled .hide-when-js-enabled { top: 10.2em; left: 2em; bottom: 1em; - overflow-y: scroll; + overflow-y: auto; } #synopsis { @@ -94,7 +94,7 @@ body.js-enabled .hide-when-js-enabled { bottom: 1em; right: 0; max-width: 65vw; - overflow-y: scroll; + overflow-y: auto; /* Ensure that synopsis covers everything (including MathJAX markup) */ z-index: 1; } -- cgit v1.2.3 From 63abb6c197ae513eac6d171c589b129feb004413 Mon Sep 17 00:00:00 2001 From: Alec Theriault Date: Thu, 8 Nov 2018 19:39:29 -0800 Subject: Space out functions more Also, functions and data decls now have the same space before and after them. --- haddock-api/resources/html/NewOcean.std-theme/new-ocean.css | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'haddock-api/resources/html/NewOcean.std-theme') diff --git a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css index 456052f1..92600fd7 100644 --- a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css +++ b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css @@ -291,7 +291,7 @@ pre, code, kbd, samp, tt, .src { .caption, h1, h2, h3, h4, h5, h6, summary { font-weight: bold; color: #5E5184; - margin: 2em 0 1em 0; + margin: 1.5em 0 1em 0; } @@ -595,7 +595,7 @@ div#style-menu-holder { /* @group Main Content */ #interface div.top + div.top { - margin-top: 1em; + margin-top: 1.5em; } #interface p + div.top, @@ -711,10 +711,6 @@ div#style-menu-holder { background-color: #f8f8f8; } -.top > .subs:last-of-type { - margin-bottom: 2em; -} - .subs .subs .caption { margin-top: 1em ; margin-bottom: 0px; -- cgit v1.2.3 From 6e281ee1dfc994c40775eda044992980738d044e Mon Sep 17 00:00:00 2001 From: Alec Theriault Date: Sat, 10 Nov 2018 14:21:40 -0800 Subject: Replace oplus/ominus expander/collapser icons with triangles --- haddock-api/resources/html/NewOcean.std-theme/new-ocean.css | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'haddock-api/resources/html/NewOcean.std-theme') diff --git a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css index 92600fd7..5450ae2e 100644 --- a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css +++ b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css @@ -359,13 +359,13 @@ ul.links li a { } .collapser:before { - content: '⊖'; + content: '▿'; } .expander:before { - content: "⊕"; + content: '▹'; } .noexpander:before { - content: "⊕"; + content: '▿'; visibility: hidden; } -- cgit v1.2.3