Skip to content
This repository has been archived by the owner on Jan 15, 2019. It is now read-only.

Commit

Permalink
Merge pull request #372 from anevins12/fix/css-coding-standards
Browse files Browse the repository at this point in the history
356: CSS selectors as per coding standards
  • Loading branch information
allancole authored Nov 9, 2018
2 parents 2417833 + 968c352 commit 301400a
Show file tree
Hide file tree
Showing 10 changed files with 138 additions and 88 deletions.
37 changes: 17 additions & 20 deletions sass/blocks/_blocks.scss
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,12 @@
outline: none;

&:hover {
cursor: pointer;
}

&:hover, &:focus {
background: $color__background-button-hover;
cursor: pointer;
}

&:focus {
background: $color__background-button-hover;
outline: thin dotted;
outline-offset: -4px;
}
Expand Down Expand Up @@ -304,10 +302,10 @@
line-height: 1.6;
text-transform: none;
color: $color__text-light;
/*
* This requires a rem-based font size calculation instead of our normal em-based one,
* because the cite tag sometimes gets wrapped in a p tag. This is equivalent to $font-size_xs.

/*
* This requires a rem-based font size calculation instead of our normal em-based one,
* because the cite tag sometimes gets wrapped in a p tag. This is equivalent to $font-size_xs.
*/
font-size: calc(1rem / (1.25 * #{$font__size-ratio}));
}
Expand Down Expand Up @@ -390,9 +388,9 @@
}

cite {
/*
* This requires a rem-based font size calculation instead of our normal em-based one,
* because the cite tag sometimes gets wrapped in a p tag. This is equivalent to $font-size_xs.
/*
* This requires a rem-based font size calculation instead of our normal em-based one,
* because the cite tag sometimes gets wrapped in a p tag. This is equivalent to $font-size_xs.
*/
font-size: calc(1rem / (1.25 * #{$font__size-ratio}));
}
Expand All @@ -411,9 +409,9 @@

cite,
footer {
/*
* This requires a rem-based font size calculation instead of our normal em-based one,
* because the cite tag sometimes gets wrapped in a p tag. This is equivalent to $font-size_xs.
/*
* This requires a rem-based font size calculation instead of our normal em-based one,
* because the cite tag sometimes gets wrapped in a p tag. This is equivalent to $font-size_xs.
*/
font-size: calc(1rem / (1.25 * #{$font__size-ratio}));
}
Expand Down Expand Up @@ -443,7 +441,7 @@

&.alignfull img {
width: 100vw;

@include media(tablet) {
margin-left: auto;
margin-right: auto;
Expand Down Expand Up @@ -581,7 +579,8 @@
//! Table
.wp-block-table {

td, th {
th,
td {
border-color: $color__text-light;
}
}
Expand Down Expand Up @@ -609,14 +608,12 @@
}

&:hover {
cursor: pointer;
}

&:hover, &:focus {
background: $color__background-button-hover;
cursor: pointer;
}

&:focus {
background: $color__background-button-hover;
outline: thin dotted;
outline-offset: -4px;
}
Expand Down
10 changes: 8 additions & 2 deletions sass/elements/_elements.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,18 @@ a:focus {
text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
h1,
h2,
h3,
h4,
h5,
h6 {
clear: both;
margin: $size__spacing-unit 0;
}

h1:not(.site-title), h2 {
h1:not(.site-title),
h2 {
@include post-section-dash;
}

Expand Down
3 changes: 2 additions & 1 deletion sass/elements/_tables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ table {
border-collapse: collapse;
width: 100%;

td, th {
td,
th {
padding: 0.5em;
border: 1px solid $color__text-light;
word-break: break-all;
Expand Down
6 changes: 3 additions & 3 deletions sass/navigation/_next-previous.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
.post-navigation {

margin: calc(3 * 1rem) 0;

@include media(tablet) {
margin: calc(3 * 1rem) $size__site-margins;
max-width: calc(6 * (100vw / 12));
}

@include media(desktop) {
margin: calc(3 * 1rem) 0;
max-width: 100%;
Expand All @@ -21,7 +21,7 @@
max-width: 100%;
display: flex;
flex-direction: column;

@include media(tablet) {
margin: 0;
}
Expand Down
18 changes: 9 additions & 9 deletions sass/site/header/_site-featured-image.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Featured image styles

.site-header.featured-image {

/* Hide overflow for overflowing featured image */
overflow: hidden;

Expand Down Expand Up @@ -63,7 +63,7 @@

/* Entry header */
.site-featured-image {

/* First layer: grayscale. */
.post-thumbnail img {
height: auto;
Expand All @@ -76,7 +76,7 @@
transform: translateX(-50%) translateY(-50%);
width: auto;
z-index: 1;

@supports ( object-fit: cover ) {
height: 100%;
left: 0;
Expand All @@ -85,15 +85,15 @@
transform: none;
width: 100%;
}

/* When image filters are active, make it grayscale to colorize it blue. */
.image-filters-enabled & {
filter: grayscale(100%);
}
}

.entry-header {

margin-top: calc( 4 * #{$size__spacing-unit});
margin-bottom: 0;
margin-left: 0;
Expand Down Expand Up @@ -232,8 +232,8 @@
}

/* Third layer: multiply. */
/* When image filters are inactive, a black overlay is added. */
.site-featured-image:after {
/* When image filters are inactive, a black overlay is added. */
.site-featured-image:after {
background: #000;
mix-blend-mode: multiply;
opacity: .7;
Expand Down Expand Up @@ -272,7 +272,7 @@
* but smooth effect when resizing the screen.
*/
transition: opacity 1200ms ease-in-out;
opacity: 0.7;
opacity: 0.7;
z-index: 5;

/* When image filters are active, a blue overlay is added. */
Expand Down
4 changes: 2 additions & 2 deletions sass/site/primary/_posts-and-pages.scss
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@
width: 100%;
}
}

}

.image-filters-enabled & {
Expand Down Expand Up @@ -160,7 +159,8 @@
}
}

&:before, &:after {
&:before,
&:after, {
position: absolute;
display: block;
width: 100%;
Expand Down
13 changes: 10 additions & 3 deletions sass/typography/_copy.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ p {
-moz-osx-font-smoothing: grayscale;
}

dfn, cite, em, i {
dfn,
cite,
em,
i {
font-style: italic;
}

Expand All @@ -23,7 +26,10 @@ pre {
overflow: auto;
}

code, kbd, tt, var {
code,
kbd,
tt,
var {
font-size: $font__size-sm;
font-family: $font__code;
}
Expand All @@ -33,7 +39,8 @@ abbr, acronym {
cursor: help;
}

mark, ins {
mark,
ins {
background: #fff9c0;
text-decoration: none;
}
Expand Down
7 changes: 6 additions & 1 deletion sass/typography/_headings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ h2.author-title,
.comment-author .fn,
.no-comments,
.site-title,
h1, h2, h3, h4, h5, h6 {
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: $font__heading;
font-weight: 700;
letter-spacing: -0.02em;
Expand Down
Loading

0 comments on commit 301400a

Please sign in to comment.