.@pimoore The other advantage of utilizing Sass would be that theme and plugin creators could make it super easy to custom the appearance of their offerings via proper utilization of Sass variables. I've lumped all of my theme's style sh$te into one big file at the moment as I whittle away at it until it is properly Sassified (since debugging can be a bit of a b$tch … the most I get out of @manton at the moment is the number of errors that happened to be logged) and you might get a sense of how Sass variables and partials can be leveraged by having a look at it (and this is without even touching the functions, mixins, interpolation, etc.):
/* Core Styles */
// Fonts
%eaves { font-family: mr-eaves-sans, sans-serif; }
%eaves-thin { @extend %eaves; font-weight: 100; }
%eaves-light { @extend %eaves; font-weight: 200; }
%eaves-book { @extend %eaves; font-weight: 300; }
%eaves-regular { @extend %eaves; font-weight: 400; }
%eaves-bold { @extend %eaves; font-weight: 700; }
%eaves-heavy { @extend %eaves; font-weight: 800; }
%eaves-thin-normal { @extend %eaves-thin; font-style: normal; }
%eaves-light-normal { @extend %eaves-light; font-style: normal; }
%eaves-book-normal { @extend %eaves-book; font-style: normal; }
%eaves-regular-normal { @extend %eaves-regular; font-style: normal; }
%eaves-bold-normal { @extend %eaves-bold; font-style: normal; }
%eaves-heavy { @extend %eaves-heavy; font-style: normal; }
%eaves-thin-italic { @extend %eaves-thin; font-style: italic; }
%eaves-light-italic { @extend %eaves-light; font-style: italic; }
%eaves-book-italic { @extend %eaves-book; font-style: italic; }
%eaves-regular-italic { @extend %eaves-regular; font-style: italic; }
%eaves-bold-italic { @extend %eaves-bold; font-style: italic; }
%eaves-heavy-italic { @extend %eaves-heavy; font-style: italic; }
%input { font-family: input-mono-compressed, monospace; }
%input-thin { @extend %input; font-weight: 100; }
%input-extra-light { @extend %input; font-weight: 200; }
%input-light { @extend %input; font-weight: 300; }
%input-regular { @extend %input; font-weight: 400; }
%input-medium { @extend %input; font-weight: 500; }
%input-bold { @extend %input; font-weight: 700; }
%input-black { @extend %input; font-weight: 800; }
%input-thin-normal { @extend %input-thin; font-style: normal; }
%input-extra-light-normal { @extend %input-extra-light; font-style: normal; }
%input-light-normal { @extend %input-light; font-style: normal; }
%input-regular-normal { @extend %input-regular; font-style: normal; }
%input-medium-normal { @extend %input-medium; font-style: normal; }
%input-bold-normal { @extend %input-bold; font-style: normal; }
%input-black-normal { @extend %input-black; font-style: normal; }
%input-thin-italic { @extend %input-thin; font-style: italic; }
%input-extra-light-italic { @extend %input-extra-light; font-style: italic; }
%input-light-italic { @extend %input-light; font-style: italic; }
%input-regular-italic { @extend %input-regular; font-style: italic; }
%input-medium-italic { @extend %input-medium; font-style: italic; }
%input-bold-italic { @extend %input-bold; font-style: italic; }
%input-black-italic { @extend %input-black; font-style: italic; }
// Sizes
$html-size: 24px;
$h1-size: 1.34rem; // 32.16px
$h2-size: 1.25rem; // 30px
$h3-size: 1.125rem; // 27px
$h4-size: 1rem; // 24px
$h5-size: 0.9167rem; // 22.0008px
$body-size: 1rem; // 24px
$small-size: 0.875rem; // 21px
$code-size: 0.5rem; // 12px
$nav-link-size: 0.70834; // 17.00016px
// Colors
$theme-color: #516189;
$body-text-color: #666;
$bold-text-color: #1E2025;
$aside-text-color: #BBB;
$link-text-color: #BBB;
$link-hover-color: #000;
$code-text-color: #7F7F7F;
$code-bg-color: #F5F5F5;
$header-color: #000;
$blockquote-border-color: #EEE;
$divider-color: #EEE;
$main-nav-dark-bg-color: $theme-color;
$main-nav-light-bg-color: rgba(255, 255, 255, 0.9);
$main-nav-dark-link-color: #FFF;
$main-nav-light-link-color: #000;
$pagination-color: #BBB;
$box-shadow-color: #9FADBF;
$post-meta-color: #444;
$post-meta-border-color: #EEE;
$post-meta-name-color: #AAA;
$post-meta-name-dark-color: #1E2025;
$post-title-color: #000;
$read-more-link-color: #000;
$dates-link-hover-color: #000;
// Line Heights
$body-height: 1.1;
$post-meta-height: 1.5;
$spacious-height: 1.6;
$nav-link-height: 1.35;
// Basic element styles
%reset { margin: 0; padding: 0; }
// Primary containers
html {
@extend %reset;
font-size: $html-size;
}
body {
@extend %reset;
@extend %eaves-book;
font-size: 1rem;
line-height: $body-height;
text-rendering: optimizeLegibility;
color: $body-text-color;
@media only screen
and (min-device-width: 320px)
and (max-device-width: 767px)
and (-webkit-min-device-pixel-ratio: 2)
and (orientation: landscape) {
-webkit-text-size-adjust: none;
}
}
// Headers
%header { color: $header-color; }
h1 {
@extend %header;
@extend %eaves-heavy;
font-size: $h1-size;
}
h2 {
@extend %header;
@extend %eaves-bold;
font-size: $h2-size;
&.post-title {
}
&.headline {
margin-top: 0;
margin-bottom: 50px;
}
}
h3 {
@extend %header;
@extend %eaves-regular;
font-size: $h3-size;
}
h4 {
@extend %header;
@extend %eaves-light;
font-size: $h4-size;
}
h5 {
@extend %header;
@extend %eaves-thin;
font-size: $h5-size;
}
// Font styles
b {
@extend %eaves-heavy;
color: $bold-text-color;
> i { @extend %eaves-heavy-italic; }
}
i {
@extend %eaves-book-italic;
> b { @extend %eaves-heavy-italic; }
}
strong {
@extend %eaves-bold;
color: $bold-text-color;
> em { @extend %eaves-bold-italic; }
}
em {
@extend %eaves-regular-italic;
> strong { @extend %eaves-bold-italic; }
}
sup {
vertical-align: super;
font-size: smaller;
}
small {
font-size: $small-size;
}
blockquote {
padding-left: 15px;
// margin-top: 15px;
@extend %eaves-light-italic;
border-left: 2px solid $blockquote-border-color;
}
// Lists
%list { list-style-position: inside; }
ul {
@extend %list;
list-style-type: circle;
&#post-list {
li {
list-style-type: none;
&:last-child {
margin-bottom: 0;
}
article > section.post-body {
header > h2 {
margin-top: 0;
line-height: 1.35;
a {
color: $post-title-color;
&:hover {
text-decoration: underline;
color: $theme-color;
}
}
}
a.read-more {
color: $read-more-link-color;
text-decoration: underline;
&:hover {
color: $theme-color;
}
}
}
}
> hr {
height: 1px;
background-color: $divider-color;
margin: 42px 0 48px 0;
width: 100%;
border: none;
&:last-child { display: none; }
}
a.dates-link {
text-transform: uppercase;
color: $aside-text-color;
@extend %eaves-light;
&:hover {
color: $dates-link-hover-color;
}
}
}
}
ol {
@extend %list;
list-style-type: decimal;
}
dl {
dt { @extend %eaves-regular; }
dd {
margin: 0px 0px 1em 0px;
padding: 0px 0px 0px 1em;
p {
> dl, dt, dd { margin: 0px 0px 2em 0px; }
}
}
}
// Media
%media-asset { width: 100%; max-width: 100%; height: auto; }
video {
@extend %media-asset;
}
img {
@extend %media-asset;
}
// Links
a {
text-decoration: none;
color: $link-text-color;
&:hover { color: $link-hover-color; }
}
// Code
// pre {
// white-space: pre-wrap;
// padding: 20px;
// background-color: #fdfdfd;
// overflow: auto;
// border-radius: 5px;
// background: #272b2d;
// line-height: 1.5em;
// color: #d0d4d7;
// margin-top: 15px;
// }
code {
border-radius: 5px;
display: inline-block;
padding: 5px 8px;
line-height: 1.35;
background-color: $code-bg-color;
color: $code-text-color;
font-size: $code-size;
@extend %input-regular;
}
// Dividers
hr {
border: none;
height: 2px;
margin: 34px 0 40px 0;
background: $divider-color;
width: 30%;
}
// Sections
section {
&#wrapper {
max-width: 600px;
margin: 0 auto;
padding: 25px;
article.post {
margin: 120px 0 0 0;
@media screen and (max-width: 540px) {
margin: 50px 0;
}
header {
text-align: center;
}
section.post-body {
}
}
}
&.post-body {
}
&#post-meta {
display: flex;
gap: 0 20px;
font-size: $small-size;
@extend %eaves-light-normal;
line-height: $post-meta-height;
padding: 40px 0;
margin-top: 60px;
color: $post-meta-color;
border {
bottom: 1px solid $post-meta-border-color;
top: 1px solid $post-meta-border-color;
}
@media screen and (max-width: 540px) {
padding {
top: 30px;
bottom: 30px;
}
margin-top: 60px;
}
div {
display: flex;
flex-direction: column;
span.p-name {
color: $post-meta-name-color;
@extend %eaves-thin-normal;
&.dark { color: $post-meta-name-dark-color; }
}
}
img.avatar {
height: 36px;
width: 36px;
box-shadow: 0 0 0 3px #fff, 0 0 0 4px #eee;
border-radius: 50%;
}
}
}
// Footers
footer {
&#feeds-email {
ul {
display: flex;
justify-content: center;
align-content: baseline;
gap: 20px;
}
a {
font-size: $small-size;
}
li { list-style-type: none; }
}
&#copyright {
display: flex;
justify-content: center;
padding-bottom: 20px;
}
}
div#webring { margin: 2em auto; padding: 0 0 50px 0; }
mark#theme-version-overlay {
position: absolute;
top: 0;
left: 0;
padding: 0 1em;
background-color: black;
color: white;
font-size: $h5-size;
opacity: 0.5;
@extend %eaves-book;
}
/* Navigation */
nav {
&#main-nav {
padding: 1rem 1rem 0.25rem 1rem;
margin: 0 auto;
z-index: 100;
display: flex;
gap: 0 20px;
flex-wrap: wrap;
justify-content: flex-end;
&.dark {
background: $main-nav-dark-bg-color;
a { color: $main-nav-dark-link-color; }
}
&.light {
background: $main-nav-light-bg-color;
a { color: $main-nav-light-link-color; }
}
a {
font-size: $nav-link-size;
line-height: $nav-link-height;
@extend %eaves-regular-normal;
transition: all .35s;
transition-timing-function: cubic-bezier(0.7, 0, 0.3, 1);
&:hover { box-shadow: none; }
&.selected { box-shadow: inset 0 -2px 0 $box-shadow-color; }
}
}
&#next-prev {
display: flex;
justify-content: space-between;
align-items: baseline;
margin: 2em auto;
span#empty-space { flex-grow: 2; }
nav#category-list {
flex-grow: 2;
display: flex;
gap: 2rem;
justify-content: center;
align-items: baseline;
}
}
// The main wrapper for pagination links
&.pagination {
display: flex;
margin: 3rem auto 0 auto;
font-size: $small-size;
color: $pagination-color;
justify-content: space-between;
}
}
/* Banners */
div.banner-image {
&#categories-stream-of-consciousness { background-position: 50% 5%; }
&#about { background-position: 50% 40%; }
@media screen and (max-width: 540px) {
&#categories-artsy-fartsy,
&#categories-critters { background-position: 35% 50%; }
}
}
div.category-content {
// margin-bottom: 8vw;
line-height: $spacious-height;
}
.microblog_conversation {
margin-top: 50px;
padding-top: 20px;
border-top: 0.5px solid lightgray;
}
.microblog_post {
padding-top: 20px;
padding-bottom: 20px;
}
div {
&.microblog_post + div.microblog_post {
border-top: 0.5px solid lightgray;
}
&.microblog_text p a {
text-decoration: none;
box-shadow: none;
}
}
.microblog_avatar {
border-radius: 10px;
vertical-align: middle;
}
.microblog_time {
font-size: 13px;
padding-top: 10px;
color: gray;
a {
color: gray;
text-decoration: none;
}
}
/* Profile */
.profile {
#wrapper {
margin: 0 auto;
text-align: center;
padding: 80px 0;
width: 100%;
}
#avatar {
display: inline-block;
margin-bottom: 1em;
}
}
header.h-card {
h4.p-role {
color: #aaa;
font-size: 1rem;
font-weight: 200;
line-height: 26px;
text-align: left;
display: flex;
justify-content: center;
}
p.p-note {
line-height: 26px;
text-align: left;
}
}
Which compiles into the following CSS:
/* Core Styles */
section#post-meta div span.p-name, h5, section#post-meta, blockquote, h4, ul#post-list a.dates-link, i, body, mark#theme-version-overlay, nav#main-nav a, em, h3, dl dt, strong > em, em > strong, h2, strong, b > i, i > b, h1, b {
font-family: mr-eaves-sans, sans-serif; }
section#post-meta div span.p-name, h5 {
font-weight: 100; }
section#post-meta, blockquote, h4, ul#post-list a.dates-link {
font-weight: 200; }
i, body, mark#theme-version-overlay {
font-weight: 300; }
nav#main-nav a, em, h3, dl dt {
font-weight: 400; }
strong > em, em > strong, h2, strong {
font-weight: 700; }
b > i, i > b, h1, b {
font-weight: 800; }
section#post-meta div span.p-name {
font-style: normal; }
section#post-meta {
font-style: normal; }
nav#main-nav a {
font-style: normal; }
b > i, i > b, h1, b {
font-style: normal; }
blockquote {
font-style: italic; }
i {
font-style: italic; }
em {
font-style: italic; }
strong > em, em > strong {
font-style: italic; }
b > i, i > b {
font-style: italic; }
code {
font-family: input-mono-compressed, monospace; }
code {
font-weight: 400; }
html, body {
margin: 0;
padding: 0; }
html {
font-size: 24px; }
body {
font-size: 1rem;
line-height: 1.1;
text-rendering: optimizeLegibility;
color: #666; }
@media only screen and (min-device-width: 320px) and (max-device-width: 767px) and (-webkit-min-device-pixel-ratio: 2) and (orientation: landscape) {
body {
-webkit-text-size-adjust: none; } }
h1, h2, h3, h4, h5 {
color: #000; }
h1 {
font-size: 1.34rem; }
h2 {
font-size: 1.25rem; }
h2.headline {
margin-top: 0;
margin-bottom: 50px; }
h3 {
font-size: 1.125rem; }
h4 {
font-size: 1rem; }
h5 {
font-size: 0.9167rem; }
b {
color: #1E2025; }
strong {
color: #1E2025; }
sup {
vertical-align: super;
font-size: smaller; }
small {
font-size: 0.875rem; }
blockquote {
padding-left: 15px;
border-left: 2px solid #EEE; }
ul, ol {
list-style-position: inside; }
ul {
list-style-type: circle; }
ul#post-list li {
list-style-type: none; }
ul#post-list li:last-child {
margin-bottom: 0; }
ul#post-list li article > section.post-body header > h2 {
margin-top: 0;
line-height: 1.35; }
ul#post-list li article > section.post-body header > h2 a {
color: #000; }
ul#post-list li article > section.post-body header > h2 a:hover {
text-decoration: underline;
color: #516189; }
ul#post-list li article > section.post-body a.read-more {
color: #000;
text-decoration: underline; }
ul#post-list li article > section.post-body a.read-more:hover {
color: #516189; }
ul#post-list > hr {
height: 1px;
background-color: #EEE;
margin: 42px 0 48px 0;
width: 100%;
border: none; }
ul#post-list > hr:last-child {
display: none; }
ul#post-list a.dates-link {
text-transform: uppercase;
color: #BBB; }
ul#post-list a.dates-link:hover {
color: #000; }
ol {
list-style-type: decimal; }
dl dd {
margin: 0px 0px 1em 0px;
padding: 0px 0px 0px 1em; }
dl dd p > dl, dl dd p dt, dl dd p dd {
margin: 0px 0px 2em 0px; }
video, img {
width: 100%;
max-width: 100%;
height: auto; }
a {
text-decoration: none;
color: #BBB; }
a:hover {
color: #000; }
code {
border-radius: 5px;
display: inline-block;
padding: 5px 8px;
line-height: 1.35;
background-color: #F5F5F5;
color: #7F7F7F;
font-size: 0.5rem; }
hr {
border: none;
height: 2px;
margin: 34px 0 40px 0;
background: #EEE;
width: 30%; }
section#wrapper {
max-width: 600px;
margin: 0 auto;
padding: 25px; }
section#wrapper article.post {
margin: 120px 0 0 0; }
@media screen and (max-width: 540px) {
section#wrapper article.post {
margin: 50px 0; } }
section#wrapper article.post header {
text-align: center; }
section#post-meta {
display: flex;
gap: 0 20px;
font-size: 0.875rem;
line-height: 1.5;
padding: 40px 0;
margin-top: 60px;
color: #444; }
section#post-meta border {
bottom: 1px solid #EEE;
top: 1px solid #EEE; }
@media screen and (max-width: 540px) {
section#post-meta {
margin-top: 60px; }
section#post-meta padding {
top: 30px;
bottom: 30px; } }
section#post-meta div {
display: flex;
flex-direction: column; }
section#post-meta div span.p-name {
color: #AAA; }
section#post-meta div span.p-name.dark {
color: #1E2025; }
section#post-meta img.avatar {
height: 36px;
width: 36px;
box-shadow: 0 0 0 3px #fff, 0 0 0 4px #eee;
border-radius: 50%; }
footer#feeds-email ul {
display: flex;
justify-content: center;
align-content: baseline;
gap: 20px; }
footer#feeds-email a {
font-size: 0.875rem; }
footer#feeds-email li {
list-style-type: none; }
footer#copyright {
display: flex;
justify-content: center;
padding-bottom: 20px; }
div#webring {
margin: 2em auto;
padding: 0 0 50px 0; }
mark#theme-version-overlay {
position: absolute;
top: 0;
left: 0;
padding: 0 1em;
background-color: black;
color: white;
font-size: 0.9167rem;
opacity: 0.5; }
/* Navigation */
nav#main-nav {
padding: 1rem 1rem 0.25rem 1rem;
margin: 0 auto;
z-index: 100;
display: flex;
gap: 0 20px;
flex-wrap: wrap;
justify-content: flex-end; }
nav#main-nav.dark {
background: #516189; }
nav#main-nav.dark a {
color: #FFF; }
nav#main-nav.light {
background: rgba(255, 255, 255, 0.9); }
nav#main-nav.light a {
color: #000; }
nav#main-nav a {
font-size: 0.70834;
line-height: 1.35;
transition: all .35s;
transition-timing-function: cubic-bezier(0.7, 0, 0.3, 1); }
nav#main-nav a:hover {
box-shadow: none; }
nav#main-nav a.selected {
box-shadow: inset 0 -2px 0 #9FADBF; }
nav#next-prev {
display: flex;
justify-content: space-between;
align-items: baseline;
margin: 2em auto; }
nav#next-prev span#empty-space {
flex-grow: 2; }
nav#next-prev nav#category-list {
flex-grow: 2;
display: flex;
gap: 2rem;
justify-content: center;
align-items: baseline; }
nav.pagination {
display: flex;
margin: 3rem auto 0 auto;
font-size: 0.875rem;
color: #BBB;
justify-content: space-between; }
/* Banners */
div.banner-image#categories-stream-of-consciousness {
background-position: 50% 5%; }
div.banner-image#about {
background-position: 50% 40%; }
@media screen and (max-width: 540px) {
div.banner-image#categories-artsy-fartsy, div.banner-image#categories-critters {
background-position: 35% 50%; } }
div.category-content {
line-height: 1.6; }
.microblog_conversation {
margin-top: 50px;
padding-top: 20px;
border-top: 0.5px solid lightgray; }
.microblog_post {
padding-top: 20px;
padding-bottom: 20px; }
div.microblog_post + div.microblog_post {
border-top: 0.5px solid lightgray; }
div.microblog_text p a {
text-decoration: none;
box-shadow: none; }
.microblog_avatar {
border-radius: 10px;
vertical-align: middle; }
.microblog_time {
font-size: 13px;
padding-top: 10px;
color: gray; }
.microblog_time a {
color: gray;
text-decoration: none; }
/* Profile */
.profile #wrapper {
margin: 0 auto;
text-align: center;
padding: 80px 0;
width: 100%; }
.profile #avatar {
display: inline-block;
margin-bottom: 1em; }
header.h-card h4.p-role {
color: #aaa;
font-size: 1rem;
font-weight: 200;
line-height: 26px;
text-align: left;
display: flex;
justify-content: center; }
header.h-card p.p-note {
line-height: 26px;
text-align: left; }