From 42ae3885c401656196fd8994d92e853b56e3fe98 Mon Sep 17 00:00:00 2001 From: Felix Mulder Date: Wed, 17 Feb 2016 15:46:16 +0100 Subject: Replace UTF8 glyphs with the Material Typeface This commit removes arrows and other symbols previously provided by UTF8-symbols. Instead it uses the Material Typeface that we've used for the search icon and graph symbols. review: @VladUreche, @lrytz --- .../scala/tools/nsc/doc/html/page/Entity.scala | 29 ++++++-- .../tools/nsc/doc/html/resource/lib/template.css | 82 ++++++++++++---------- .../tools/nsc/doc/html/resource/lib/template.js | 7 +- 3 files changed, 75 insertions(+), 43 deletions(-) (limited to 'src') diff --git a/src/scaladoc/scala/tools/nsc/doc/html/page/Entity.scala b/src/scaladoc/scala/tools/nsc/doc/html/page/Entity.scala index 556cc0a5a3..86251fe872 100644 --- a/src/scaladoc/scala/tools/nsc/doc/html/page/Entity.scala +++ b/src/scaladoc/scala/tools/nsc/doc/html/page/Entity.scala @@ -163,7 +163,13 @@ trait EntityPage extends HtmlPage {
-
+
+ + + + + +
Ordering @@ -540,7 +546,10 @@ trait EntityPage extends HtmlPage { mbr match { case nte: NonTemplateMemberEntity if nte.isUseCase =>
- Full Signature + + + Full Signature +
{ signature(nte.useCaseOf.get,isSelf = true) }
case _ => NodeSeq.Empty @@ -682,7 +691,10 @@ trait EntityPage extends HtmlPage { val linearization = mbr match { case dtpl: DocTemplateEntity if isSelf && !isReduced && dtpl.linearizationTemplates.nonEmpty =>
- Linear Supertypes + + + Linear Supertypes +
{ typesToHtml(dtpl.linearizationTypes, hasLinks = true, sep = scala.xml.Text(", ")) }
@@ -702,7 +714,10 @@ trait EntityPage extends HtmlPage { transitive(dtpl) if (subs.nonEmpty)
- Known Subclasses + + + Known Subclasses +
{ templatesToHtml(subs.toList.sorted(Entity.EntityOrdering), scala.xml.Text(", ")) }
@@ -719,7 +734,10 @@ trait EntityPage extends HtmlPage { val diagramSvg = generator.generate(diagram.get, tpl, this) if (diagramSvg != NodeSeq.Empty) {
- { description } + + + { description } +
{ diagramSvg }
@@ -773,6 +791,7 @@ trait EntityPage extends HtmlPage { def inside(hasLinks: Boolean, nameLink: String = ""): NodeSeq = + { mbr.flags.map(flag => inlineToHtml(flag.text) ++ scala.xml.Text(" ")) } { kindToString(mbr) } diff --git a/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/template.css b/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/template.css index a91e442621..2265f8f045 100644 --- a/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/template.css +++ b/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/template.css @@ -157,26 +157,41 @@ body.trait div#definition { user-select: none; } -.toggleContainer .toggle:before { - cursor: pointer; - padding-left: 15px; - content: "▶"; +.toggleContainer .toggle > i { position: absolute; - left: -2.7em; + left: -1.5em; top: 0em; + font-size: 1.3em; + transition: 0.1s; } -.toggleContainer .toggle.open:before { - content: "▼"; - position: absolute; - left: -2.7em; - top: 0em; +.toggleContainer .toggle.open > i { + transform: rotate(90deg); } .toggleContainer .hiddenContent { margin-top: 1.5em; } +#memberfilter > i.arrow { + position: absolute; + top: 0.45em; + left: -0.9em; + color: #fff; + font-size: 1.3em; + opacity: 0; + transition: 0.1s; + cursor: pointer; +} + +#memberfilter > i.arrow.rotate { + transform: rotate(90deg); +} + +#memberfilter:hover > i.arrow { + opacity: 1; +} + .value #definition { background-color: #103A51; /* blue */ } @@ -430,23 +445,20 @@ span.symbol > span.name { cursor: pointer; } -#template .closed:before { - content: "▶"; - position: absolute; - left: 1em; - top: 0.35em; -} - #template .opened { cursor: pointer; } -#template .opened:before { - content: "▼"; +i.unfold-arrow { + font-size: 1em; position: absolute; - left: 1em; - top: 0.35em; - color: #2C475C; + top: 0.55em; + left: 0.7em; + transition: 0.1s; +} + +#template .modifier_kind.opened > i.unfold-arrow { + transform: rotate(90deg); } #template .values .name { @@ -469,12 +481,12 @@ span.symbol > span.name { top: 0; } -.full-signature-usecase > .signature > .closed:before { - content: "" !important; -} - -.full-signature-usecase > .signature > .opened:before { - content: "" !important; +/* Hide unfold arrow where appropriate */ +#template li[fullComment=no] .modifier_kind > i.unfold-arrow, +div#definition > h4#signature > span.modifier_kind > i.unfold-arrow, +.full-signature-usecase > .signature > .closed > i.unfold-arrow, +.full-signature-usecase > .signature > .opened > i.unfold-arrow { + display: none; } #template .full-signature-usecase > .signature > .closed { @@ -810,11 +822,10 @@ div.fullcomment dl.paramcmts > dd { #memberfilter > .clear { display: none; position: absolute; - top: 0.6em; - right: -0.65em; - height: 23px; - width: 21px; + top: 0.55em; color: rgba(255, 255, 255, 0.4); + right: 0; + font-size: 1.2em; } #memberfilter > .clear:hover { @@ -860,17 +871,16 @@ div.fullcomment dl.paramcmts > dd { left: 0.7em; } -#mbrsel > div.toggle:before { +#mbrsel > div.toggle > i { cursor: pointer; - content: "▶"; position: absolute; left: 0; top: 0; color: #fff; } -#mbrsel > div.toggle.open:before { - content: "▼"; +#mbrsel > div.toggle.open > i { + transform: rotate(90deg); } #mbrsel > div#filterby { diff --git a/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/template.js b/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/template.js index 50804c029f..b0719b1ed5 100644 --- a/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/template.js +++ b/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/template.js @@ -92,7 +92,8 @@ $(document).ready(function() { return isHidden(this); }).removeClass("in").addClass("out"); - $("#mbrsel > div.toggle").click(function() { + $("#memberfilter > i.arrow").click(function() { + $(this).toggleClass("rotate"); $("#filterby").toggle(); }); @@ -311,7 +312,9 @@ $(document).ready(function() { }); $("#mbrsel-input").on("blur", function() { - $("#memberfilter > .clear").hide(); + setTimeout(function() { + $("#memberfilter > .clear").hide(); + }, 10); }); }); -- cgit v1.2.3