From: Jeremy Thomas Date: Sat, 29 Jul 2017 13:59:10 +0000 (+0100) Subject: Optimize message docs X-Git-Tag: 0.5.0~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e2f716de5f2cd951e9b58d13a1d909bcb32f52e;p=thirdparty%2Fbulma.git Optimize message docs --- diff --git a/docs/_javascript/main.js b/docs/_javascript/main.js index a58bd3cbf..c9fe455af 100644 --- a/docs/_javascript/main.js +++ b/docs/_javascript/main.js @@ -11,7 +11,7 @@ document.addEventListener('DOMContentLoaded', () => { const target = $el.getAttribute('href'); const $target = document.getElementById(target.substring(1)); $target.scrollIntoView(true); - window.history.replaceState(null, document.title, `${window.location.origin}${window.location.pathname}${target}`); + // window.history.replaceState(null, document.title, `${window.location.origin}${window.location.pathname}${target}`); return false; }); }); @@ -152,4 +152,27 @@ document.addEventListener('DOMContentLoaded', () => { return Array.prototype.slice.call(document.querySelectorAll(selector), 0); } + let latestKnownScrollY = 0; + let ticking = false; + + function scrollUpdate() { + ticking = false; + // do stuff + } + + + function onScroll() { + latestKnownScrollY = window.scrollY; + scrollRequestTick(); + } + + function scrollRequestTick() { + if(!ticking) { + requestAnimationFrame(scrollUpdate); + } + ticking = true; + } + + window.addEventListener('scroll', onScroll, false); + }); diff --git a/docs/css/bulma-docs.css b/docs/css/bulma-docs.css index 12cbaf6ea..bacf89581 100644 --- a/docs/css/bulma-docs.css +++ b/docs/css/bulma-docs.css @@ -3510,7 +3510,7 @@ a.tag:hover { .title { color: #363636; font-size: 2rem; - font-weight: 700; + font-weight: 600; line-height: 1.125; } diff --git a/docs/documentation/components/message.html b/docs/documentation/components/message.html index f70380945..aac9f5f90 100644 --- a/docs/documentation/components/message.html +++ b/docs/documentation/components/message.html @@ -210,29 +210,29 @@ variables: -
+ {% include heading.html name="Colors" %} -

Message body only

-
-

You can omit the message header:

-
- {{message_body_example}} + {{message_colors_example}}
- {% highlight html %}{{message_body_example}}{% endhighlight %} + {% highlight html %}{{message_colors_example}}{% endhighlight %}
- {% include heading.html name="Colors" %} +
+

Message body only

+
+

You can omit the message header:

+
- {{message_colors_example}} + {{message_body_example}}
- {% highlight html %}{{message_colors_example}}{% endhighlight %} + {% highlight html %}{{message_body_example}}{% endhighlight %}
diff --git a/docs/lib/main.js b/docs/lib/main.js index 482e2cf0e..99a897370 100644 --- a/docs/lib/main.js +++ b/docs/lib/main.js @@ -13,7 +13,7 @@ document.addEventListener('DOMContentLoaded', function () { var target = $el.getAttribute('href'); var $target = document.getElementById(target.substring(1)); $target.scrollIntoView(true); - window.history.replaceState(null, document.title, '' + window.location.origin + window.location.pathname + target); + // window.history.replaceState(null, document.title, `${window.location.origin}${window.location.pathname}${target}`); return false; }); }); @@ -153,4 +153,26 @@ document.addEventListener('DOMContentLoaded', function () { function getAll(selector) { return Array.prototype.slice.call(document.querySelectorAll(selector), 0); } + + var latestKnownScrollY = 0; + var ticking = false; + + function scrollUpdate() { + ticking = false; + // do stuff + } + + function onScroll() { + latestKnownScrollY = window.scrollY; + scrollRequestTick(); + } + + function scrollRequestTick() { + if (!ticking) { + requestAnimationFrame(scrollUpdate); + } + ticking = true; + } + + window.addEventListener('scroll', onScroll, false); }); \ No newline at end of file diff --git a/sass/elements/title.sass b/sass/elements/title.sass index b604e8083..f9a50c5f2 100755 --- a/sass/elements/title.sass +++ b/sass/elements/title.sass @@ -1,6 +1,6 @@ $title-color: $grey-darker !default $title-size: $size-3 !default -$title-weight: $weight-bold !default +$title-weight: $weight-semibold !default $title-strong-color: inherit !default $title-strong-weight: inherit !default