X-Git-Url: https://git.draconx.ca/gitweb/homepage.git/blobdiff_plain/b585d7ee7724970904ba0bd77d84c2337159b4b3..bc4daa2900c702913be7dc3e46441b192f44772a:/content/style.scss diff --git a/content/style.scss b/content/style.scss index 79d4ffb..22df5d9 100644 --- a/content/style.scss +++ b/content/style.scss @@ -26,9 +26,12 @@ $linkactivecolour: #ff0000; $linkvisitedcolour: #800080; $ruledefaultcolour: #d3d3d3; +$rulestrongcolour: #696969; $annotationcolour: #708090; +$tableshadecolour: #f5f5f5; + @mixin header_size($maxwidth, $fontsize) { font-size: $fontsize; max-width: 1em * ($maxwidth / $fontsize); @@ -47,20 +50,24 @@ a:active { color: $linkactivecolour; } h1 { @include header_size(60em, 2em); } h2 { @include header_size(60em, 1.5em); } +h5 { @include header_size(60em, 1em); } + +p>img { max-width: 40em; width: 100%; height: auto; } p, dt, dd, li { text-align: justify; + @media (max-width: 28em) { text-align: left; } padding: 0; margin: 0; } -p, div, ul, ol, dl, hr { +p, table, div, ul, ol, dl, hr { max-width: 50em; padding: 0; margin: 0; } -p, body>div { margin: 1em 0; } +p, table, body>div, h5 { margin: 1em 0; } li { margin: 0 0 0 2em; } dd { margin: 0 0 0 1em; } @@ -83,9 +90,149 @@ kbd { color: $annotationcolour; a:link, a:visited { color: inherit; } + @media not screen { visibility: hidden; } +} + +// General table styles. +table { + border: 1px solid $ruledefaultcolour; + border-collapse: collapse; + width: 100%; +} + +table>* { font-size: 0.9em; } +caption { + caption-side: top; + font-weight: bold; + font-size: 1em; + text-align: left; + margin: 0 0 0.5em 0; +} + +td, th { + vertical-align: middle; + text-align: left; + padding: 1ex; + margin: 0; +} + +thead>tr, tbody>tr { border: solid $ruledefaultcolour; } +th, thead>tr { border-bottom: 1px solid $rulestrongcolour; } +*>table, *>th { border: none; } +thead>tr { border-width: 1px; } +tbody>tr { border-width: 0 1px; } + +td + td { box-shadow: -1px 0 $backgroundcolour; } + +tbody>tr { + &:nth-of-type(even) { background-color: $tableshadecolour; } + &:last-child { border-bottom: solid 1px $ruledefaultcolour; } +} + +// Specific table styles +table.cc { + &>tr>*:first-child, &>*>tr>*:first-child { + &+* { text-align: center; } + text-align: center; + } +} + +$sortcols: name, date, size; +@each $col in $sortcols { + #filelist-#{$col}-sort { + &:checked { + & ~ table.filelist { + /* Update table header state */ + th.#{$col} { + label~label { + display: -moz-inline-box !important; + display: inline-block !important; + } + label { display: none; } + } + + /* Show only appropriate items from the sort body (forward) */ + tbody+tbody>tr.#{$col} { display: table-row; } + tbody+tbody>tr { display: none; } + } + + & ~ #filelist-#{$col}-rev:checked ~ table.filelist { + /* Show only appropriate items from sort body (reversed) */ + tbody+tbody>tr.#{$col}rev { display: table-row; } + tbody+tbody>tr { display: none; } + } + + /* Unhide associated checkbox for keyboard navigation */ + & ~ #filelist-#{$col}-rev { display: block !important; } + } + + &:focus ~ table.filelist th>label~label>span { + border: 1px dotted; + padding: 0; + } + + display: block !important; + position: absolute; + z-index: -1; + opacity: 0; + } + + #filelist-#{$col}-rev { + &:checked ~ table.filelist { + /* Update table header state */ + th.#{$col} { + img+img { + display: -moz-inline-box !important; + display: inline !important; + } + img { display: none; } + } + } + + &:focus ~ table.filelist th>label~label>img { + border: 1px dotted; + padding: 0; + } + + position: absolute; + z-index: -2; + opacity: 0; + } } -@media not screen { - .permalink { visibility: hidden; } + +/* Enable the sorted tables only when non-default option is selected */ +#filelist-name-rev, #filelist-date-sort, #filelist-size-sort { + &:checked~table.filelist>tbody { + &+tbody { display: table-row-group !important; } + display: none; + } +} + +table.filelist { + &>tr>*:first-child, &>*>tr>*:first-child { + &+td { min-width: 50%; } + width: 0; + } + + th>label>* { padding: 1px; } + th>label, th>label>* { + white-space: nowrap; + vertical-align: middle; + display: -moz-inline-box; + display: inline-block; + cursor: pointer; + } + th img { margin-left: 0.5ex; } + + tbody+tbody { + border-bottom: solid 1px $ruledefaultcolour; + } + + img { + display: block; + height: 1.5em; + width: auto; + } } // Site header rules @@ -107,14 +254,13 @@ kbd { } // Site footer rules -#footer { +#footer, #article-info { text-align: center; max-width: 44em; padding: 0 3em; margin: 0; p { - color: $annotationcolour; display: inline-block; font-size: 0.8em; max-width: 100%; @@ -122,6 +268,9 @@ kbd { } } +#footer p { color: $annotationcolour; } +#article-info p { font-style: italic; } + // "unordered" lists with explicit ordering in content ul.ordered > { li { list-style: none; } @@ -143,6 +292,3 @@ ul.ordered > { #sitetitle * { float: none; } #footer { padding: 0 1em; } } -@media (max-width: 28em) { - * { text-align: left; } -}