mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Fixed inconsistencies in table-styling
This commit is contained in:
parent
de3bd8d665
commit
8f48f0bce6
3
material/assets/javascripts/application-0dae3d4464.js
Normal file
3
material/assets/javascripts/application-0dae3d4464.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
material/assets/stylesheets/application-a7dac97dbb.css
Normal file
1
material/assets/stylesheets/application-a7dac97dbb.css
Normal file
File diff suppressed because one or more lines are too long
@ -1,5 +1,3 @@
|
||||
'
|
||||
'
|
||||
{% import "partials/language.html" as lang %}
|
||||
<!DOCTYPE html>
|
||||
<html class="no-js">
|
||||
@ -36,7 +34,7 @@
|
||||
<script src="{{ base_url }}/assets/javascripts/modernizr-56ade86843.js"></script>
|
||||
{% endblock %}
|
||||
{% block styles %}
|
||||
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-4b280ca4d9.css">
|
||||
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-a7dac97dbb.css">
|
||||
{% if config.extra.palette %}
|
||||
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-02ce7adcc2.palette.css">
|
||||
{% endif %}
|
||||
@ -143,7 +141,7 @@
|
||||
{% endblock %}
|
||||
</div>
|
||||
{% block scripts %}
|
||||
<script src="{{ base_url }}/assets/javascripts/application-f7ac33b6fb.js"></script>
|
||||
<script src="{{ base_url }}/assets/javascripts/application-0dae3d4464.js"></script>
|
||||
<script>app.initialize({url:{base:"{{ base_url }}"}})</script>
|
||||
{% for path in extra_javascript %}
|
||||
<script src="{{ path }}"></script>
|
||||
|
@ -48,14 +48,17 @@ export const initialize = config => {
|
||||
/* Wrap all data tables for better overflow scrolling */
|
||||
const tables = document.querySelectorAll("table:not([class])")
|
||||
Array.prototype.forEach.call(tables, table => {
|
||||
const wrap = document.createElement("div")
|
||||
wrap.classList.add("md-typeset__table")
|
||||
const wrap = (
|
||||
<div class="md-typeset__scrollwrap">
|
||||
<div class="md-typeset__table"></div>
|
||||
</div>
|
||||
)
|
||||
if (table.nextSibling) {
|
||||
table.parentNode.insertBefore(wrap, table.nextSibling)
|
||||
} else {
|
||||
table.parentNode.appendChild(wrap)
|
||||
}
|
||||
wrap.appendChild(table)
|
||||
wrap.children[0].appendChild(table)
|
||||
})
|
||||
|
||||
/* Force 1px scroll offset to trigger overflow scrolling */
|
||||
|
@ -367,18 +367,18 @@ kbd {
|
||||
table:not([class]) {
|
||||
@include z-depth(2);
|
||||
|
||||
margin: 2em 0;
|
||||
display: inline-block;
|
||||
max-width: 100%;
|
||||
border-radius: 0.2rem;
|
||||
font-size: ms(-1);
|
||||
overflow: hidden;
|
||||
overflow: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
|
||||
// Semi-cool overflow solution, in case JavaScript is not available
|
||||
.no-js & {
|
||||
display: inline-block;
|
||||
max-width: 100%;
|
||||
margin: 0.8em 0;
|
||||
overflow: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
// Due to margin collapse because of the necessary inline-block hack, we
|
||||
// cannot increase the bottom margin on the table, so we just increase the
|
||||
// top margin on the following element
|
||||
& + * {
|
||||
margin-top: 1.5em;
|
||||
}
|
||||
|
||||
// Table headings and cells
|
||||
@ -414,16 +414,25 @@ kbd {
|
||||
}
|
||||
}
|
||||
|
||||
// Data table wrapper, in case JavaScript is available
|
||||
.md-typeset__table {
|
||||
margin: 1.6em -1.6rem;
|
||||
// Wrapper for scrolling on overflow
|
||||
&__scrollwrap {
|
||||
margin: 1em -1.6rem;
|
||||
overflow-x: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
// Data table wrapper, in case JavaScript is available
|
||||
.md-typeset__table {
|
||||
display: inline-block;
|
||||
margin-bottom: 0.5em;
|
||||
padding: 0 1.6rem;
|
||||
|
||||
// Data tables
|
||||
table {
|
||||
display: inline-block;
|
||||
margin: 0 1.6rem;
|
||||
display: table;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,4 @@
|
||||
'
|
||||
'<!--
|
||||
<!--
|
||||
Copyright (c) 2016-2017 Martin Donath <martin.donath@squidfunk.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
|
Loading…
Reference in New Issue
Block a user