|
@import "compass/reset"; |
|
@import "compass"; |
|
@import "compass/css3"; |
|
|
|
$font_text: 'Merriweather', serif; // The closest to Guardian font I found |
|
$font_title: 'Playfair Display', serif; // The closest to the National font I found |
|
$font_clear: 'Roboto', sans-serif; // Used for clear display of numbers (e.g. dates) and clickable "button" type elements |
|
|
|
$font_code: 'Anonymous Pro', monospace; // Used for code examples, monospace font |
|
|
|
$color_highlight: #c82502; // Highlight color in the template, this case dark red |
|
$color_faded: #888; // Un-emphasis color, grayish, e.g. used for date and button labels |
|
$color_callout: #c88; // Faded color for gutter-callout element (<em>) |
|
$color_actionbar_border: #d5d7d8; // Border color for the action button bar |
|
|
|
$em_callout_width: 11em; // Width of the out-side-of-text callout element |
|
$em_callout_width_article_right_margin: 14em; // The spacing given to callout element by main text |
|
$em_callout_width_article_right_margin_default: 1em; // The default right margin for the article (optional, should be controlled by container) |
|
|
|
// Controls responive design constraints for modern mobile devices |
|
// See: https://css-tricks.com/snippets/css/media-queries-for-standard-devices/ |
|
// And: https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries |
|
$media_mobile_phone_width: 500px; |
|
$media_mobile_tablet_width: 800px; |
|
|
|
body { |
|
//font: font-style font-variant font-weight font-size/line-height font-family |
|
font: normal normal 400 1em $font_text; |
|
|
|
min-width:360px; // Reasonable minimum size for modern mobile devices |
|
|
|
// Temporary development constraints, remove in prod |
|
margin:50px 10px; |
|
@media (max-width: $media_mobile_tablet_width) { |
|
margin:0; |
|
} |
|
} |
|
|
|
#blog |
|
{ |
|
//font: font-style font-variant font-weight font-size/line-height font-family |
|
font: normal normal 400 1em $font_text; |
|
|
|
min-width:360px; // Reasonable minimum size for modern mobile devices |
|
|
|
// Temporary development constraints, remove in prod |
|
//min-width: 600px; |
|
|
|
display: block; // Ensure that the div fills the parent space |
|
width: auto!important; // 'auto' is important, otherwise the div elements will be to large and clipped by the column layout |
|
min-width: 360px; |
|
overflow: hidden; // Necessary to ensure that the associated images don't overlap ajacent posts |
|
|
|
// Avoid entries breaking between columns within an entry |
|
// from: http://stackoverflow.com/a/7785711/779521 |
|
-webkit-column-break-inside: avoid; /* Chrome, Safari */ |
|
-moz-column-break-inside:avoid; /* Theoretically FF 20+ */ |
|
-moz-page-break-inside:avoid; /* Theoretically FF 20+ */ |
|
page-break-inside: avoid; /* Theoretically FF 20+ */ |
|
break-inside: avoid-column; /* IE 11 */ |
|
|
|
// Default anchor styling is same as text |
|
// this is to avoid named anchors to inherit style |
|
a, a.named_anchor { |
|
text-decoration: inherit; |
|
font-style: inherit; |
|
color: inherit; |
|
} |
|
|
|
} |
|
|
|
#title { |
|
h1 { |
|
font: normal normal 700 4em $font_title; |
|
letter-spacing: -0.06em; |
|
margin-bottom: 0.05em; |
|
line-height: 1em; |
|
} |
|
.byline { |
|
font: normal normal 400 1.3em $font_title; |
|
margin-bottom: .8em; |
|
letter-spacing: -0.04em; |
|
} |
|
.pubdate { |
|
font: normal normal 400 1em $font_clear; |
|
color: $color_faded; |
|
text-transform: uppercase; |
|
margin-bottom: 1em; |
|
.pubtime:before |
|
{ |
|
font-family: 'FontAwesome'; |
|
font-size: .8em; |
|
content:'\f054'; |
|
margin: 0em .5em; |
|
color: $color_highlight; |
|
} |
|
hr { |
|
border: 0; |
|
border-bottom: 4px double $color_faded; |
|
//height: 0.15em; |
|
//@include background-image( linear-gradient(to right, #000, #fff)); |
|
} |
|
} |
|
.topic { |
|
font: normal normal 900 .8em $font_text; |
|
text-transform: uppercase; |
|
color: $color_highlight; |
|
margin-bottom: 1em; |
|
} |
|
|
|
// Constraints for tablet devices |
|
@media (max-width: $media_mobile_tablet_width) { |
|
h1 { font-size: 3em; } |
|
.byline { font-size: 1em; } |
|
.topic { font-size: 0.8em; } |
|
.pubdate {font-size: 0.8em; } |
|
} |
|
|
|
// Constraints for phone devices |
|
@media (max-width: $media_mobile_phone_width) { |
|
h1 { font-size: 2.5em; } |
|
.byline { font-size: 0.8em; } |
|
.topic { font-size: 0.6em; } |
|
.pubdate {font-size: 0.6em; } |
|
} |
|
} |
|
|
|
#actions{ |
|
font-family: $font_clear; |
|
padding: 0.5em; |
|
margin: 1.5em 0em; |
|
border-top: $color_actionbar_border 1px solid; |
|
border-bottom: $color_actionbar_border 1px solid; |
|
|
|
a:link { |
|
font-size: 0.8em; |
|
text-transform: uppercase; |
|
text-decoration:none; |
|
@include transition(color 300ms ease-out); |
|
line-height: inherit; |
|
color: $color_faded; |
|
|
|
&:hover { color: black; } |
|
} |
|
|
|
// The icons |
|
.fa{ |
|
font-size: 1.3em; |
|
color: $color_highlight; |
|
} |
|
|
|
ul{ |
|
margin: 0; |
|
} |
|
|
|
li:first-child { |
|
border-left: 0; |
|
} |
|
|
|
li{ |
|
vertical-align: middle; |
|
border-left: $color_actionbar_border 1px solid; |
|
display:inline-block; |
|
padding: 0.2em 1.5em; |
|
line-height: 1.2em; |
|
text-align: center!important; |
|
|
|
// Breaks the text to a new line |
|
span:before{ |
|
content:"\A"; |
|
white-space:pre; |
|
} |
|
} |
|
|
|
// Constraints for tablet devices |
|
@media (max-width: $media_mobile_tablet_width) { |
|
margin: 1.5em 0em; |
|
.fa{ font-size: 1em; &:hover { color: black; } } |
|
li span{display:none;} |
|
} |
|
|
|
// Constraints for phone devices |
|
@media (max-width: $media_mobile_phone_width) { |
|
margin: 1em 0em; |
|
.fa{ font-size: 0.9em; &:hover { color: black; } } |
|
li span{display:none;} |
|
} |
|
} |
|
|
|
// Code segments |
|
.prettyprint |
|
{ |
|
font: normal normal 400 1em/1em $font_code; |
|
padding: 0.8em; |
|
margin-bottom:2em; |
|
@include border-radius(8px); |
|
|
|
// Constraints for tablet devices |
|
@media (max-width: $media_mobile_tablet_width) { |
|
font-size: 0.8em; |
|
padding: 0.5em; |
|
margin-bottom:1em; |
|
@include border-radius(0px); |
|
} |
|
|
|
// Constraints for phone devices |
|
@media (max-width: $media_mobile_phone_width) { |
|
font-size: 0.75em; |
|
padding: 0.2em; |
|
} |
|
} |
|
|
|
#article { |
|
font: normal normal 400 1em/2em $font_text; |
|
line-height: 2em; |
|
margin-right: $em_callout_width_article_right_margin; |
|
min-width:360px; |
|
|
|
a, a:link { |
|
text-decoration: none; |
|
background: #eee; |
|
cursor: pointer; |
|
padding: 0 0.2em; |
|
color: $color_highlight; |
|
|
|
&:hover{ |
|
color: #666; |
|
} |
|
|
|
// The "Try Me" demo button style |
|
&.tryme { |
|
font: normal normal 700 1.0em $font_clear; |
|
letter-spacing: 0.03em; |
|
text-transform: uppercase; |
|
color: #fff; |
|
background: #a22; |
|
display:inline-block; |
|
padding: .8em 1.8em; |
|
margin-bottom: .8em; |
|
text-decoration: none; |
|
|
|
&:after |
|
{ |
|
font: normal normal 400 1em FontAwesome; |
|
vertical-align: middle; |
|
margin-left: 0.75em; |
|
text-align: bottom; |
|
color: yellow; |
|
content: '\f054'; // Chevron right |
|
} |
|
|
|
// Show three chevrons when mouse is hovering |
|
&:hover, &:active { |
|
&:after { content: '\f054 \f054 \f054'; } |
|
} |
|
} |
|
} |
|
|
|
#content |
|
{ |
|
h1, h2, h3, h4 { font-weight: 900; font-size: 1.25em; } |
|
i { font-style:italic; } |
|
b { font-weight: 900; } |
|
p { |
|
margin-bottom:2em; |
|
line-height: 2em; |
|
} |
|
|
|
// Drop cap the first letter in each paragraph |
|
p:first-child:first-letter { |
|
font-weight: 900; |
|
float: left; |
|
font-size: 5em; |
|
line-height: 1em; |
|
padding: 0.1em 0.1em 0.1em 0em; //top, right, bottom, left |
|
} |
|
} |
|
|
|
/* em in text will cause a floating box*/ |
|
em { |
|
border-top: .4em solid $color_callout; |
|
padding: 1em; |
|
font-size: 0.9em; |
|
line-height:1.5em; |
|
color: $color_faded; |
|
width: $em_callout_width; |
|
position:absolute; |
|
right: 2em; |
|
letter-spacing: -0.07em; |
|
} |
|
|
|
// Constraints for tablet devices |
|
@media (max-width: $media_mobile_tablet_width) { |
|
font-size: 0.8em; |
|
line-height: 1.5em; |
|
a.tryme { @include border-radius(3px);} |
|
#content { |
|
p:first-child:first-letter { font-size: 3.7em; } |
|
p { margin-bottom:1em; } |
|
} |
|
} |
|
|
|
// Constraints for phone devices |
|
@media (max-width: $media_mobile_phone_width) { |
|
font-size: 0.7em; |
|
line-height: 1.3em; |
|
a.tryme { @include border-radius(2px);} |
|
#content { |
|
p:first-child:first-letter { font-size: 2.1em; } |
|
p { margin-bottom:1em; } |
|
} |
|
// Hide the callouts in the smallest screen format |
|
em {display:none;} |
|
margin-right: $em_callout_width_article_right_margin_default; |
|
} |
|
} |
|
|
|
/* |
|
Individual styles |
|
*/ |
|
|
|
blockquote{ |
|
box-sizing: inherit; |
|
padding: 0; |
|
display:block; |
|
margin: 1em 3em; |
|
position: relative; |
|
|
|
/*Font*/ |
|
font: normal normal 300 1.6em/1.3em $font_text; |
|
letter-spacing: -0.08em; |
|
color: #666; |
|
text-align: justify; |
|
|
|
i { font-style: italic; } |
|
|
|
// Constraints for tablet devices |
|
@media (max-width: $media_mobile_tablet_width) { |
|
margin: 2em; |
|
font-size: 1.2em; |
|
} |
|
|
|
// Constraints for phone devices |
|
@media (max-width: $media_mobile_phone_width) { |
|
margin: 1.5em; |
|
font-size: 1em; |
|
} |
|
} |