css: Refactor and improve

This commit is contained in:
George Cushen 2016-09-22 01:57:22 +01:00
commit c397cd7ce2

View file

@ -3,47 +3,47 @@
* https://github.com/gcushen/hugo-academic * https://github.com/gcushen/hugo-academic
**************************************************/ **************************************************/
/************************************************* /*************************************************
* Core * Core
**************************************************/ **************************************************/
html { html {
box-sizing: border-box; box-sizing: border-box;
} }
*, *,
*::after, *::after,
*::before { *::before {
box-sizing: inherit; box-sizing: inherit;
} }
.row:after, .row:after,
.row:before { .row:before {
content: " "; content: " ";
display: table; display: table;
} }
html, html,
body, body,
p { p {
font-family: 'Merriweather', serif; font-family: 'Merriweather', serif;
font-size: 16px; font-size: 16px;
line-height: 1.65; line-height: 1.65;
min-height: 100%; min-height: 100%;
} }
body { body {
/* Offset body content by navbar height. */ /* Offset body content by navbar height. */
margin-top: 71px; margin-top: 71px;
padding-top: 0; padding-top: 0;
} }
@media screen and (max-width: 768px) { @media screen and (max-width: 768px) {
body { body {
/* Offset body content by navbar height. */ /* Offset body content by navbar height. */
margin-top: 51px; margin-top: 51px;
padding-top: 0; padding-top: 0;
} }
} }
h1, h1,
@ -53,88 +53,90 @@ h4,
h5, h5,
h6, h6,
.navbar-default { .navbar-default {
font-family: 'Lato', sans-serif; font-family: 'Lato', sans-serif;
font-weight: 400; font-weight: 400;
line-height: 1.25; line-height: 1.25;
text-rendering: optimizeLegibility; text-rendering: optimizeLegibility;
} }
h1 { h1 {
margin-bottom: 21px; margin-bottom: 21px;
font-size: 48px; font-size: 48px;
} }
h3 { h3 {
margin-bottom: 11px; margin-bottom: 11px;
font-weight: 700; font-weight: 700;
} }
h4 { h4 {
font-weight: 700; font-weight: 700;
} }
a, a:visited, a,
a:visited,
h3.article-title a:hover { h3.article-title a:hover {
color: #0095eb; color: #0095eb;
text-decoration:none; text-decoration: none;
transition:color 0.6s ease; transition: color 0.6s ease;
} }
a:hover { a:hover {
color: #005181; color: #005181;
} }
img, img,
video { video {
height: auto; height: auto;
max-width: 100%; max-width: 100%;
display: block; display: block;
} }
body { body {
counter-reset: captions; counter-reset: captions;
} }
figcaption:before { figcaption:before {
font-weight: 700; font-weight: 700;
text-transform: uppercase; text-transform: uppercase;
content: "Figure " counter(captions) ": "; content: "Figure " counter(captions) ": ";
} }
figcaption { figcaption {
display: block; display: block;
margin-top: 0.75em; margin-top: 0.75em;
line-height: 1.25; line-height: 1.25;
font-size: 1rem; font-size: 1rem;
margin-bottom: 1.65rem; margin-bottom: 1.65rem;
font-family: 'Lato', sans-serif; font-family: 'Lato', sans-serif;
counter-increment: captions; counter-increment: captions;
} }
figcaption h4 { figcaption h4 {
display: inline-block; display: inline-block;
font-size: 1rem; font-size: 1rem;
font-weight: 400; font-weight: 400;
margin: 0; margin: 0;
} }
pre, pre,
code { code {
font-family: 'Roboto Mono', 'Courier New', 'Courier', monospace; font-family: 'Roboto Mono', 'Courier New', 'Courier', monospace;
} }
pre { pre {
margin: 0 0 1.5rem; margin: 0 0 1.5rem;
overflow: auto; overflow: auto;
} }
.space-below { .space-below {
margin-bottom: 50px; margin-bottom: 50px;
} }
@media screen and (max-width: 768px) { @media screen and (max-width: 768px) {
.space-below { .space-below {
margin-bottom: 10px; margin-bottom: 10px;
} }
} }
/************************************************* /*************************************************
@ -142,32 +144,33 @@ pre {
**************************************************/ **************************************************/
.home-section { .home-section {
background-color: rgb(255, 255, 255); background-color: rgb(255, 255, 255);
padding: 110px 0 110px 0; padding: 110px 0 110px 0;
} }
@media screen and (max-width: 768px) { @media screen and (max-width: 768px) {
.home-section { .home-section {
padding: 60px 0 60px 0; padding: 60px 0 60px 0;
} }
} }
.home-section:first-of-type { .home-section:first-of-type {
padding-top: 0; padding-top: 0;
} }
.home-section:nth-of-type(even) { .home-section:nth-of-type(even) {
background-color: rgb(247, 247, 247); background-color: rgb(247, 247, 247);
} }
.section-heading h1 { .section-heading h1 {
margin: 0 0 10px 0; margin: 0 0 10px 0;
} }
.section-heading p { .section-heading p {
font-family: 'Lato', sans-serif; font-family: 'Lato', sans-serif;
font-weight: 400; font-weight: 400;
font-size: 1.1rem; font-size: 1.1rem;
color: #b2b2b2; color: #b2b2b2;
} }
/************************************************* /*************************************************
@ -175,81 +178,81 @@ pre {
**************************************************/ **************************************************/
#profile { #profile {
text-align: center; text-align: center;
padding: 30px 10px; padding: 30px 10px;
position: relative; position: relative;
} }
#profile .portrait { #profile .portrait {
background-image: url('../img/portrait.jpg'); background-image: url('../img/portrait.jpg');
width: 200px; width: 200px;
height: 200px; height: 200px;
margin: 0 auto; margin: 0 auto;
border-radius: 50%; border-radius: 50%;
background-size: cover; background-size: cover;
-webkit-background-size: cover; -webkit-background-size: cover;
-moz-background-size: cover; -moz-background-size: cover;
} }
#profile .portrait-title h2 { #profile .portrait-title h2 {
font-size: 1.75em; font-size: 1.75em;
font-weight: 300; font-weight: 300;
color: #000000; color: #000000;
margin: 20px 0 10px 0; margin: 20px 0 10px 0;
} }
#profile .portrait-title h3 { #profile .portrait-title h3 {
font-size: 1.13em; font-size: 1.13em;
font-weight: 300; font-weight: 300;
color: #AAAAAA; color: #AAAAAA;
margin: 0px 0 10px 0; margin: 0px 0 10px 0;
} }
#profile ul.social-icon { #profile ul.social-icon {
display: inline-flex; display: inline-flex;
flex-direction: row; flex-direction: row;
flex-wrap: wrap; flex-wrap: wrap;
list-style: none; list-style: none;
padding: 0; padding: 0;
margin-top: 30px; margin-top: 30px;
} }
#profile .social-icon li { #profile .social-icon li {
margin-right: 10px; margin-right: 10px;
} }
#profile .social-icon li:last-of-type { #profile .social-icon li:last-of-type {
margin-right: 0; margin-right: 0;
} }
#profile .social-icon li:hover { #profile .social-icon li:hover {
transform: scale(1.2) transform: scale(1.2)
} }
.big-icon { .big-icon {
font-size: 40px; font-size: 40px;
} }
ul.ul-edu { ul.ul-edu {
list-style: none; list-style: none;
} }
ul.ul-edu li { ul.ul-edu li {
position: relative; position: relative;
padding: 0px 15px 4px 3px; padding: 0px 15px 4px 3px;
color: #333333; color: #333333;
} }
ul.ul-edu li .description p { ul.ul-edu li .description p {
margin: 0; margin: 0;
} }
ul.ul-edu li .description p.course { ul.ul-edu li .description p.course {
font-size: 1em; font-size: 1em;
} }
ul.ul-edu li .description p.institution { ul.ul-edu li .description p.institution {
font-size: 0.88em; font-size: 0.88em;
} }
/************************************************* /*************************************************
@ -257,48 +260,48 @@ ul.ul-edu li .description p.institution {
**************************************************/ **************************************************/
.share-box { .share-box {
float: right; float: right;
} }
ul.share { ul.share {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
flex-wrap: wrap; flex-wrap: wrap;
list-style: none; list-style: none;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
ul.share li { ul.share li {
display: inline-flex; display: inline-flex;
margin-right: 5px; margin-right: 5px;
} }
ul.share li:last-of-type { ul.share li:last-of-type {
margin-right: 0; margin-right: 0;
} }
ul.share li .fa { ul.share li .fa {
display: block; display: block;
width: 30px; width: 30px;
height: 30px; height: 30px;
line-height: 30px; line-height: 30px;
font-size: 16px; font-size: 16px;
text-align: center; text-align: center;
transition: all 150ms ease-in-out; transition: all 150ms ease-in-out;
color: #fff; color: #fff;
} }
ul.share li a { ul.share li a {
background-color: #b5c6ce; background-color: #b5c6ce;
display: block; display: block;
border-radius: 50%; border-radius: 50%;
text-decoration: none !important; text-decoration: none !important;
margin: 0; margin: 0;
} }
ul.share li:hover .fa { ul.share li:hover .fa {
transform: scale(1.4) transform: scale(1.4)
} }
/************************************************* /*************************************************
@ -306,75 +309,83 @@ ul.share li:hover .fa {
**************************************************/ **************************************************/
.article-title { .article-title {
font-size: 1.75rem; font-size: 1.75rem;
} }
h3.article-title a { .article-title a {
color: #151515; color: #151515;
transition: color 0.6s ease; transition: color 0.6s ease;
} }
.article-metadata { .article-metadata {
margin-bottom: 20px; margin-bottom: 20px;
line-height: 30px; /* Match share bar line height. */ line-height: 30px; /* Match share bar line height. */
font-size: 14px; font-size: 14px;
letter-spacing: 0.03em; letter-spacing: 0.03em;
} color: #888;
.article-metadata a:hover {
color: #0095eb;
} }
.article-metadata a { .article-metadata a {
color: #888; color: #888;
}
.article-metadata a:hover {
color: #0095eb;
} }
.article-list-item { .article-list-item {
margin-bottom: 40px; margin-bottom: 40px;
} }
.article-list-item:last-child { .article-list-item:last-child {
margin-bottom: 0 !important; margin-bottom: 0 !important;
} }
.article-list-item .article-metadata { .article-list-item .article-metadata {
margin-bottom: 5px; margin-bottom: 5px;
} }
.article-metadata .article-date, .article-metadata .article-date,
.article-metadata .article-tags { .article-metadata .article-tags {
margin-right: 10px; margin-right: 10px;
color: #888;
} }
.article-banner { .article-banner {
width: 100%; width: 100%;
height: auto; height: auto;
} }
.article-style img, .article-style img,
.article-style video { .article-style video {
box-shadow: 1px 1px 0px #edefed,-1px -1px 0px #edefed,1px -1px 0px #edefed,-1px 1px 0px #edefed; box-shadow: 1px 1px 0px #edefed, -1px -1px 0px #edefed, 1px -1px 0px #edefed, -1px 1px 0px #edefed;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
margin-top: 60px; margin-top: 60px;
margin-bottom: 60px; margin-bottom: 60px;
padding-left: 0; padding-left: 0;
padding-right: 0; padding-right: 0;
} }
.article-style figure { .article-style figure {
margin-top: 60px; margin-top: 60px;
margin-bottom: 60px; margin-bottom: 60px;
} }
.article-style figure img { .article-style figure img {
margin-top: 0; margin-top: 0;
margin-bottom: 0; margin-bottom: 0;
}
.article-style blockquote {
padding: 1.857em;
padding-bottom: 0;
border-left: 3px solid #d9d9d9;
border-bottom: 1px solid transparent;
background: #f2f2f2;
} }
#comments { #comments {
padding: 20px; padding: 20px;
} }
/************************************************* /*************************************************
@ -382,53 +393,53 @@ h3.article-title a {
**************************************************/ **************************************************/
.pub-icon { .pub-icon {
color: #03396c; color: #03396c;
font-size: 0.81em; font-size: 0.81em;
padding-top: 6px; padding-top: 6px;
} }
.pub-banner { .pub-banner {
max-width: 100%; max-width: 100%;
height: auto; height: auto;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
} }
.pub .pub-title { .pub .pub-title {
margin-bottom: 5px; margin-bottom: 5px;
} }
.pub .pub-authors { .pub .pub-authors {
font-style: italic; font-style: italic;
line-height: 30px; /* Match share bar line height. */ line-height: 30px; /* Match share bar line height. */
} }
.pub .pub-row-heading { .pub .pub-row-heading {
font-weight: bold; font-weight: bold;
} }
.pub-list-item { .pub-list-item {
margin-bottom: 40px; margin-bottom: 40px;
} }
.pub-list-item .pub-abstract { .pub-list-item .pub-abstract {
font-size: 1.13em; font-size: 1.13em;
} }
.pub-list-item .pub-authors { .pub-list-item .pub-authors {
line-height: normal; line-height: normal;
font-style: normal; font-style: normal;
font-size: 1.13em; font-size: 1.13em;
color: #3170A5; color: #3170A5;
} }
.pub-list-item .pub-publication { .pub-list-item .pub-publication {
color: #090; color: #090;
font-size: 1em; font-size: 1em;
} }
.pub-list-item .pub-links { .pub-list-item .pub-links {
padding-top: 10px; padding-top: 10px;
} }
/************************************************* /*************************************************
@ -436,26 +447,26 @@ h3.article-title a {
**************************************************/ **************************************************/
section#projects.home-section li { section#projects.home-section li {
margin-bottom: 20px; margin-bottom: 20px;
} }
section#projects.home-section li:last-of-type { section#projects.home-section li:last-of-type {
margin-bottom: 0; margin-bottom: 0;
} }
section#projects.home-section .project-title { section#projects.home-section .project-title {
display: inline-block; display: inline-block;
margin-bottom: 6px; margin-bottom: 6px;
} }
section#projects.home-section .project-summary { section#projects.home-section .project-summary {
font-size: 16px; font-size: 16px;
margin-bottom: 6px; margin-bottom: 6px;
} }
section#projects.home-section .project-tags { section#projects.home-section .project-tags {
font-size: 14px; font-size: 14px;
color: #9c9c9c; color: #9c9c9c;
} }
/************************************************* /*************************************************
@ -463,7 +474,7 @@ section#projects.home-section .project-tags {
**************************************************/ **************************************************/
#contact li span { #contact li span {
padding-left: 10px; padding-left: 10px;
} }
/************************************************* /*************************************************
@ -471,19 +482,19 @@ section#projects.home-section .project-tags {
**************************************************/ **************************************************/
footer { footer {
margin: 4rem 0 0; margin: 4rem 0 0;
padding: 2rem 0; padding: 2rem 0;
width: 100%; width: 100%;
} }
footer p { footer p {
font-size: 0.75rem; font-size: 0.75rem;
text-align: center; text-align: center;
} }
.site-footer, .site-footer,
footer a#back_to_top i { footer a#back_to_top i {
color: #899596; color: #899596;
} }
/************************************************* /*************************************************
@ -491,7 +502,7 @@ footer a#back_to_top i {
**************************************************/ **************************************************/
.btn-primary { .btn-primary {
border-color: #0095eb; border-color: #0095eb;
} }
.btn-primary:hover, .btn-primary:hover,
@ -499,7 +510,7 @@ footer a#back_to_top i {
.btn-primary:active, .btn-primary:active,
.btn-primary.active, .btn-primary.active,
.open > .dropdown-toggle.btn-primary { .open > .dropdown-toggle.btn-primary {
background: #0095eb; background: #0095eb;
} }
/************************************************* /*************************************************
@ -507,30 +518,30 @@ footer a#back_to_top i {
**************************************************/ **************************************************/
.btn-outline { .btn-outline {
background-color: transparent; background-color: transparent;
color: inherit; color: inherit;
transition: all .5s; transition: all .5s;
} }
.btn-primary.btn-outline { .btn-primary.btn-outline {
color: #0095eb; color: #0095eb;
border-color: #0095eb; border-color: #0095eb;
} }
.btn-success.btn-outline { .btn-success.btn-outline {
color: #5cb85c; color: #5cb85c;
} }
.btn-info.btn-outline { .btn-info.btn-outline {
color: #5bc0de; color: #5bc0de;
} }
.btn-warning.btn-outline { .btn-warning.btn-outline {
color: #f0ad4e; color: #f0ad4e;
} }
.btn-danger.btn-outline { .btn-danger.btn-outline {
color: #d9534f; color: #d9534f;
} }
.btn-primary.btn-outline:hover, .btn-primary.btn-outline:hover,
@ -538,7 +549,7 @@ footer a#back_to_top i {
.btn-info.btn-outline:hover, .btn-info.btn-outline:hover,
.btn-warning.btn-outline:hover, .btn-warning.btn-outline:hover,
.btn-danger.btn-outline:hover { .btn-danger.btn-outline:hover {
color: #fff; color: #fff;
} }
/************************************************* /*************************************************
@ -546,86 +557,96 @@ footer a#back_to_top i {
**************************************************/ **************************************************/
.navbar { .navbar {
min-height:60px !important; min-height: 60px !important;
} }
.navbar-default { .navbar-default {
background: #fff; background: #fff;
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,0.05); -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: 0 1px 2px rgba(0,0,0,0.05); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
} }
nav#navbar-main li { nav#navbar-main li {
font-size: 16px; font-size: 16px;
} }
.navbar-default .navbar-nav li a, .navbar-default .navbar-nav li a,
.navbar-default .navbar-nav li a:visited { .navbar-default .navbar-nav li a:visited {
white-space: nowrap; white-space: nowrap;
-webkit-transition: 0.2s ease; -webkit-transition: 0.2s ease;
transition: 0.2s ease; transition: 0.2s ease;
color: #565a5f; color: #565a5f;
} }
.navbar-default .navbar-nav li a:hover { .navbar-default .navbar-nav li a:hover {
color: #0095eb; color: #0095eb;
} }
.navbar-brand, .navbar-brand,
.navbar-nav li a { .navbar-nav li a {
line-height: 60px; line-height: 60px;
padding-top: 5px; padding-top: 5px;
padding-bottom: 5px; padding-bottom: 5px;
} }
.navbar-brand { .navbar-brand {
text-transform: uppercase; text-transform: uppercase;
font-weight: bold; font-weight: bold;
font-size: 1.2em; font-size: 1.2em;
color: #2b2b2b; color: #2b2b2b;
} }
@media screen and (max-width: 768px) { @media screen and (max-width: 768px) {
.navbar { .navbar {
min-height: 50px !important; min-height: 50px !important;
} }
.navbar-header {
float: none; .navbar-header {
min-height: inherit; float: none;
} min-height: inherit;
.navbar-left, }
.navbar-right {
float: none !important; .navbar-left,
} .navbar-right {
.navbar-toggle { float: none !important;
display: block; }
}
.navbar-collapse { .navbar-toggle {
border-top: 1px solid transparent; display: block;
box-shadow: inset 0 1px 0 rgba(255,255,255,0.1); }
}
.navbar-fixed-top { .navbar-collapse {
top: 0; border-top: 1px solid transparent;
border-width: 0 0 1px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
} }
.navbar-collapse.collapse {
display: none!important; .navbar-fixed-top {
} top: 0;
.navbar-nav { border-width: 0 0 1px;
float: none!important; }
margin-top: 7.5px;
} .navbar-collapse.collapse {
.navbar-nav>li { display: none !important;
float: none; }
}
.navbar-nav>li>a { .navbar-nav {
padding-top: 10px; float: none !important;
padding-bottom: 10px; margin-top: 7.5px;
line-height: normal; }
}
.collapse.in{ .navbar-nav > li {
display:block !important; float: none;
} }
.navbar-nav > li > a {
padding-top: 10px;
padding-bottom: 10px;
line-height: normal;
}
.collapse.in {
display: block !important;
}
} }
/************************************************* /*************************************************
@ -633,10 +654,10 @@ nav#navbar-main li {
**************************************************/ **************************************************/
table { table {
width: 100%; width: 100%;
max-width: 100%; max-width: 100%;
margin-bottom: 1rem; margin-bottom: 1rem;
font-size: 0.93rem; font-size: 0.93rem;
} }
table > thead > tr > th, table > thead > tr > th,
@ -645,15 +666,15 @@ table > tfoot > tr > th,
table > thead > tr > td, table > thead > tr > td,
table > tbody > tr > td, table > tbody > tr > td,
table > tfoot > tr > td { table > tfoot > tr > td {
padding: 8px; padding: 8px;
line-height: 1.43; line-height: 1.43;
vertical-align: top; vertical-align: top;
border-top: 1px solid #ddd; border-top: 1px solid #ddd;
} }
table > thead > tr > th { table > thead > tr > th {
vertical-align: bottom; vertical-align: bottom;
border-bottom: 2px solid #ddd; border-bottom: 2px solid #ddd;
} }
table > caption + thead > tr:first-child > th, table > caption + thead > tr:first-child > th,
@ -662,26 +683,25 @@ table > thead:first-child > tr:first-child > th,
table > caption + thead > tr:first-child > td, table > caption + thead > tr:first-child > td,
table > colgroup + thead > tr:first-child > td, table > colgroup + thead > tr:first-child > td,
table > thead:first-child > tr:first-child > td { table > thead:first-child > tr:first-child > td {
border-top: 0; border-top: 0;
} }
table > tbody + tbody { table > tbody + tbody {
border-top: 2px solid #ddd; border-top: 2px solid #ddd;
} }
table table { table table {
background-color: #fff; background-color: #fff;
} }
/* Table Striped */ /* Table Striped */
table > tbody > tr:nth-child(odd) > td, table > tbody > tr:nth-child(odd) > td,
table > tbody > tr:nth-child(odd) > th { table > tbody > tr:nth-child(odd) > th {
background-color: #f9f9f9; background-color: #f9f9f9;
} }
/* Table Hover */ /* Table Hover */
table > tbody > tr:hover > td, table > tbody > tr:hover > td,
table > tbody > tr:hover > th { table > tbody > tr:hover > th {
background-color: #e5e5e5; background-color: #e5e5e5;
} }