feat(style): use Bootstrap table style

This commit is contained in:
George Cushen committed 2022-02-16 21:52:48 +00:00
1 parent 9982c23440
commit 8e2b1cc26b
4 files changed
+19 -48

No files matched your search

+3
View File
@@ -201,6 +201,9 @@ function fixHugoOutput() {
// Fix Goldmark task lists (remove bullet points). // Fix Goldmark task lists (remove bullet points).
$("input[type='checkbox'][disabled]").parents('ul').addClass('task-list'); $("input[type='checkbox'][disabled]").parents('ul').addClass('task-list');
// Bootstrap table style is opt-in and Goldmark doesn't add it.
$("table").addClass('.table');
} }
// Get an element's siblings. // Get an element's siblings.
@@ -175,6 +175,16 @@ article .article-metadata {
content: '\00B7'; content: '\00B7';
} }
caption {
// Override Bootstrap alignment
text-align: center;
}
// Note default light caption inherited from Bootstrap
.dark caption {
color: rgba(255, 255, 255, 0.8);
}
/************************************************* /*************************************************
* Content widgets * Content widgets
**************************************************/ **************************************************/
@@ -4,8 +4,8 @@
/* Based on Bootstrap's `table-responsive` style. */ /* Based on Bootstrap's `table-responsive` style. */
table { table {
display: block; //display: block;
width: 100%; //width: 100%;
overflow-x: scroll; overflow-x: scroll;
margin-bottom: 1rem; margin-bottom: 1rem;
font-size: 0.8rem; font-size: 0.8rem;
@@ -15,48 +15,6 @@ table {
word-break: normal; word-break: normal;
} }
table > thead > tr > th, .dark .table {
table > tbody > tr > th, color: white;
table > tfoot > tr > th,
table > thead > tr > td,
table > tbody > tr > td,
table > tfoot > tr > td {
padding: 8px;
line-height: 1.43;
vertical-align: top;
border-top: 1px solid #ddd;
}
table > thead > tr > th {
vertical-align: bottom;
border-bottom: 2px solid #ddd;
}
table > caption + thead > tr:first-child > th,
table > colgroup + thead > tr:first-child > th,
table > thead:first-child > tr:first-child > th,
table > caption + thead > tr:first-child > td,
table > colgroup + thead > tr:first-child > td,
table > thead:first-child > tr:first-child > td {
border-top: 0;
}
table > tbody + tbody {
border-top: 2px solid #ddd;
}
table table {
background-color: #fff;
}
/* Table Striped */
table > tbody > tr:nth-child(odd) > td,
table > tbody > tr:nth-child(odd) > th {
background-color: #f9f9f9;
}
/* Table Hover */
table > tbody > tr:hover > td,
table > tbody > tr:hover > th {
background-color: #e5e5e5;
} }
+2 -2
View File
@@ -4,7 +4,7 @@
{{ $src := .Get "path" }} {{ $src := .Get "path" }}
{{ $delimiter := .Get "delimiter" | default "," }} {{ $delimiter := .Get "delimiter" | default "," }}
{{ $useHeaderRow := .Get "header" | default true }} {{ $useHeaderRow := (eq (lower (.Get "header")) "true") | default true }}
{{ $caption := .Get "caption" }} {{ $caption := .Get "caption" }}
{{ $is_remote := strings.HasPrefix $src "http" }} {{ $is_remote := strings.HasPrefix $src "http" }}
@@ -13,7 +13,7 @@
{{ end }} {{ end }}
{{ $rows := getCSV $delimiter $src }} {{ $rows := getCSV $delimiter $src }}
<table> <table class="table">
{{ if $useHeaderRow }} {{ if $useHeaderRow }}
{{ $headerRow := index $rows 0 }} {{ $headerRow := index $rows 0 }}
{{ $rows = after 1 $rows }} {{ $rows = after 1 $rows }}