1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2025-01-18 17:04:09 +01:00

Refactored code container

This commit is contained in:
squidfunk 2016-09-23 20:26:27 +02:00
parent 71d022ef39
commit ffe06939a7
8 changed files with 47 additions and 10 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -56,8 +56,8 @@
</div> </div>
</div> </div>
{% endif %} {% endif %}
<div class="md-content md-content--typeset"> <div class="md-content">
<article class="md-content__inner"> <article class="md-content__inner md-typeset">
{% block content %} {% block content %}
{% if edit_uri %} {% if edit_uri %}
<a class="md-button md-button--edit" href="{{ edit_uri }}"> <a class="md-button md-button--edit" href="{{ edit_uri }}">
@ -91,7 +91,7 @@
var base_url = '{{ base_url }}'; var base_url = '{{ base_url }}';
var repo_url = '{{ repo_url }}'; var repo_url = '{{ repo_url }}';
</script> </script>
<script src="{{ base_url }}/assets/javascripts/application-409da39d08.js"></script> <script src="{{ base_url }}/assets/javascripts/application-caa33c61a6.js"></script>
{% for path in extra_javascript %} {% for path in extra_javascript %}
<script src="{{ path }}"></script> <script src="{{ path }}"></script>
{% endfor %} {% endfor %}

View File

@ -118,6 +118,19 @@ document.addEventListener('DOMContentLoaded', function() {
} }
}); });
// document.querySelector('[for="nav-3"]').addEventListener('click', function() {
// var el = document.querySelector('[for="nav-3"] + nav');
//
// // TODO: do via class and disable transforms!!!
// el.style.maxHeight = '100%';
// var rect = el.getBoundingClientRect();
// el.style.maxHeight = '0';
//
// // console.log(rect.height);
// el.style.maxHeight = '120px';
// });
// setTimeout(function() { // setTimeout(function() {
fetch('https://api.github.com/repos/squidfunk/mkdocs-material') fetch('https://api.github.com/repos/squidfunk/mkdocs-material')
.then(function(response) { .then(function(response) {

View File

@ -61,7 +61,7 @@ kbd {
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Content that is typeset // Content that is typeset
.md-content--typeset { .md-typeset {
font-size: ms(0); font-size: ms(0);
line-height: 1.6; line-height: 1.6;
@ -187,7 +187,8 @@ kbd {
color: $md-code-color; color: $md-code-color;
font-size: 85%; font-size: 85%;
line-height: 1.4; line-height: 1.4;
overflow-x: scroll; overflow: auto;
-webkit-overflow-scrolling: touch;
// Reset, if pre is inside code // Reset, if pre is inside code
> code { > code {
@ -195,6 +196,29 @@ kbd {
} }
} }
// Full-width container
> div > pre,
> pre > code {
// [mobile -]: Stretch to whole width
@include break-to-device(mobile) {
margin: 1.0em -1.6rem;
padding: 1.0rem 1.6rem;
border-radius: 0;
}
// Override native scrollbar styles
&::-webkit-scrollbar {
width: 0.4rem;
height: 0.4rem;
// Style scrollbar thumb
&-thumb {
background: $md-color-black--lighter;
}
}
}
// Keystrokes // Keystrokes
kbd { kbd {
display: inline-block; display: inline-block;

View File

@ -25,7 +25,7 @@
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Scoped in typesetted content for greater specificity // Scoped in typesetted content for greater specificity
.md-content--typeset { .md-typeset {
// Permalink // Permalink
.headerlink { .headerlink {

View File

@ -42,7 +42,7 @@
margin: 2.4rem 1.6rem; margin: 2.4rem 1.6rem;
// Hack: this is necessary for floating the edit button // Hack: this is necessary for floating the edit button
overflow: auto; // overflow: auto;
// [screen +]: Increase spacing // [screen +]: Increase spacing
@include break-from-device(screen) { @include break-from-device(screen) {

View File

@ -126,8 +126,8 @@
{% endif %} {% endif %}
<!-- Article --> <!-- Article -->
<div class="md-content md-content--typeset"> <div class="md-content">
<article class="md-content__inner"> <article class="md-content__inner md-typeset">
<!-- Content block --> <!-- Content block -->
{% block content %} {% block content %}