mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Added support for announcement bar
This commit is contained in:
parent
68272079c3
commit
eb968dfec0
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -378,13 +378,13 @@ kbd {
|
|||||||
overflow: hidden; }
|
overflow: hidden; }
|
||||||
|
|
||||||
html {
|
html {
|
||||||
height: 100%;
|
min-height: 100%;
|
||||||
font-size: 125%;
|
font-size: 125%;
|
||||||
overflow-x: hidden; }
|
overflow-x: hidden; }
|
||||||
|
|
||||||
body {
|
body {
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 100%;
|
min-height: 100%;
|
||||||
font-size: 0.5rem; }
|
font-size: 0.5rem; }
|
||||||
|
|
||||||
hr {
|
hr {
|
||||||
@ -406,7 +406,6 @@ hr {
|
|||||||
display: table;
|
display: table;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding-top: 2.4rem;
|
|
||||||
table-layout: fixed; }
|
table-layout: fixed; }
|
||||||
|
|
||||||
.md-main {
|
.md-main {
|
||||||
@ -563,7 +562,8 @@ hr {
|
|||||||
color: rgba(0, 0, 0, 0.26); }
|
color: rgba(0, 0, 0, 0.26); }
|
||||||
|
|
||||||
.md-header {
|
.md-header {
|
||||||
position: fixed;
|
position: -webkit-sticky;
|
||||||
|
position: sticky;
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
File diff suppressed because one or more lines are too long
2
material/assets/stylesheets/app.min.css
vendored
2
material/assets/stylesheets/app.min.css
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -95,6 +95,11 @@
|
|||||||
{{ lang.t('skip.link.title') }}
|
{{ lang.t('skip.link.title') }}
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if self.announcement() %}
|
||||||
|
<div class="md-announcement" data-md-component="announcement">
|
||||||
|
{% block announcement %}{% endblock %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
{% block header %}
|
{% block header %}
|
||||||
{% include "partials/header.html" %}
|
{% include "partials/header.html" %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -53,7 +53,7 @@ export function watchHeader(
|
|||||||
): Observable<HeaderState> {
|
): Observable<HeaderState> {
|
||||||
return defer(() => {
|
return defer(() => {
|
||||||
const sticky = getComputedStyle(el)
|
const sticky = getComputedStyle(el)
|
||||||
.getPropertyValue("position") === "fixed"
|
.getPropertyValue("position") === "sticky"
|
||||||
|
|
||||||
/* Return header as hot observable */
|
/* Return header as hot observable */
|
||||||
return of({
|
return of({
|
||||||
|
@ -35,7 +35,7 @@ $md-toggle__drawer--checked:
|
|||||||
// Stretch container to viewport and set base font-size to 10px for simple
|
// Stretch container to viewport and set base font-size to 10px for simple
|
||||||
// calculations base on relative ems (rems)
|
// calculations base on relative ems (rems)
|
||||||
html {
|
html {
|
||||||
height: 100%;
|
min-height: 100%;
|
||||||
// Hack: normally, we would set the base font-size to 62.5%, so we can base
|
// Hack: normally, we would set the base font-size to 62.5%, so we can base
|
||||||
// all calculations on 10px, but Chromium and Chrome define a minimal font
|
// all calculations on 10px, but Chromium and Chrome define a minimal font
|
||||||
// size of 12 if the system language is set to Chinese. For this reason we
|
// size of 12 if the system language is set to Chinese. For this reason we
|
||||||
@ -63,7 +63,7 @@ html {
|
|||||||
// Stretch body to container and leave room for footer
|
// Stretch body to container and leave room for footer
|
||||||
body {
|
body {
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 100%;
|
min-height: 100%;
|
||||||
// Hack: reset font-size to 10px, so the spacing for all inline elements is
|
// Hack: reset font-size to 10px, so the spacing for all inline elements is
|
||||||
// correct again. Otherwise the spacing would be based on 20px.
|
// correct again. Otherwise the spacing would be based on 20px.
|
||||||
font-size: 0.5rem; // stylelint-disable-line unit-whitelist
|
font-size: 0.5rem; // stylelint-disable-line unit-whitelist
|
||||||
@ -110,7 +110,6 @@ hr {
|
|||||||
display: table;
|
display: table;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding-top: px2rem(48px);
|
|
||||||
table-layout: fixed;
|
table-layout: fixed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
// Application header (stays always on top)
|
// Application header (stays always on top)
|
||||||
.md-header {
|
.md-header {
|
||||||
position: fixed;
|
position: sticky;
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user