Skip to content
This repository has been archived by the owner on Jun 18, 2020. It is now read-only.

[Varya] Refine quote and pullquote block styles #32

Merged
merged 12 commits into from
Apr 3, 2020
70 changes: 41 additions & 29 deletions varya/assets/css/style-editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ div[data-type="core/button"] {
* - Styles for basic HTML elemants
*/
blockquote {
padding-left: var(--global--spacing-horizontal);
margin: 0;
padding: 0;
}

blockquote p {
Expand All @@ -145,8 +146,8 @@ blockquote p {
blockquote cite,
blockquote footer {
color: var(--global--color-foreground-light);
font-size: var(--global--font-size-sm);
letter-spacing: var(--global--letter-spacing-sm);
font-size: var(--global--font-size-xs);
letter-spacing: var(--global--letter-spacing-xs);
}

blockquote > * {
Expand Down Expand Up @@ -760,26 +761,24 @@ p.has-background:not(.has-background-background-color) a {
}

.wp-block-pullquote {
padding: calc( 3 * var(--global--spacing-unit)) 0;
padding: calc( 2 * var(--global--spacing-unit)) 0;
margin-left: 0;
margin-right: 0;
text-align: center;
text-align: left;
border-top-color: var(--pullquote--color-border);
border-top-width: var(--pullquote--border-width);
border-bottom-color: var(--pullquote--color-border);
border-bottom-width: var(--pullquote--border-width);
color: var(--pullquote--color-foreground);
}

.wp-block-pullquote blockquote {
padding-left: 0;
}

.wp-block-pullquote p {
font-family: var(--pullquote--font-family);
font-size: var(--heading--font-size-h4);
font-size: var(--pullquote--font-size);
font-style: var(--pullquote--font-style);
letter-spacing: var(--heading--letter-spacing-h4);
line-height: var(--heading--line-height);
line-height: var(--pullquote--line-height);
margin: 0;
}

.wp-block-pullquote a {
Expand All @@ -790,7 +789,7 @@ p.has-background:not(.has-background-background-color) a {
.wp-block-pullquote cite,
.wp-block-pullquote footer {
color: var(--global--color-foreground-light);
font-size: var(--global--font-size-sm);
font-size: var(--global--font-size-xs);
}

.wp-block-pullquote:not(.is-style-solid-color) {
Expand All @@ -800,6 +799,7 @@ p.has-background:not(.has-background-background-color) a {
.wp-block-pullquote.is-style-solid-color {
background-color: var(--pullquote--color-foreground);
color: var(--pullquote--color-background);
padding: calc( 2 * var(--global--spacing-unit));
}

.wp-block-pullquote.is-style-solid-color.alignleft blockquote,
Expand All @@ -810,7 +810,9 @@ p.has-background:not(.has-background-background-color) a {
}

.wp-block-pullquote.is-style-solid-color blockquote {
padding-left: 0;
margin: 0;
text-align: left;
max-width: 100%;
}

.wp-block-pullquote.is-style-solid-color .wp-block-pullquote__citation,
Expand All @@ -819,37 +821,47 @@ p.has-background:not(.has-background-background-color) a {
color: currentColor;
}

.wp-block-pullquote.alignwide > p,
.wp-block-pullquote.alignfull > p,
.wp-block-pullquote.alignwide blockquote,
.wp-block-pullquote.alignfull blockquote {
margin-left: auto;
margin-right: auto;
.wp-block[data-align="full"] .wp-block-pullquote:not(.is-style-solid-color) blockquote {
padding: 0 calc( 2 * var(--global--spacing-unit));
}

.wp-block-quote {
border-left-color: var(--quote--border-color);
border-left-width: var(--quote--border-width);
margin: var(--global--spacing-vertical) 0;
padding-left: var(--global--spacing-horizontal);
}

.wp-block-quote p {
font-family: var(--quote--font-family);
font-size: var(--heading--font-size-h4);
letter-spacing: var(--heading--letter-spacing-h4);
line-height: var(--global--line-height-h4);
font-size: var(--quote--font-size);
line-height: var(--global--line-height-body);
}

.wp-block-quote.is-large, .wp-block-quote.is-style-large {
border: none;
padding: 0;
border-left: var(--quote--border-width) solid var(--quote--border-color);
padding-left: var(--global--spacing-horizontal);
/* Resetting margins to match _block-container.scss */
margin-top: var(--global--spacing-vertical);
margin-bottom: var(--global--spacing-vertical);
}

.wp-block-quote.is-large p, .wp-block-quote.is-style-large p {
font-family: var(--quote--font-family);
font-size: var(--heading--font-size-h3);
letter-spacing: var(--heading--letter-spacing-h3);
line-height: var(--global--line-height-h3);
font-size: var(--quote--font-size-large);
font-style: normal;
}

.wp-block-quote.is-large.has-text-align-right, .wp-block-quote.is-style-large.has-text-align-right {
border-left: none;
border-right: var(--quote--border-width) solid var(--quote--border-color);
}

.wp-block-quote.has-text-align-right {
border-right: var(--quote--border-width) solid var(--quote--border-color);
}

.wp-block-quote.has-text-align-center {
border: none;
}

.has-background:not(.has-background-background-color) .wp-block-quote,
Expand All @@ -861,7 +873,7 @@ p.has-background:not(.has-background-background-color) a {

.wp-block-quote .wp-block-quote__citation {
color: var(--global--color-foreground-light);
font-size: var(--global--font-size-sm);
font-size: var(--global--font-size-xs);
}

.has-background:not(.has-background-background-color) .wp-block-quote .wp-block-quote__citation,
Expand Down
20 changes: 11 additions & 9 deletions varya/assets/css/variables-editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ body {
/* Line Height */
--global--line-height-base: 1;
--global--line-height-body: 1.7;
--global--line-height-heading: 1.125;
--global--line-height-heading: 1.3;
/* Colors */
--global--color-primary: #000000;
--global--color-primary-hover: #A36265;
Expand Down Expand Up @@ -125,16 +125,18 @@ body {
--list--font-family: var(--global--font-secondary);
--definition-term--font-family: var(--global--font-primary);
--pullquote--font-family: var(--global--font-primary);
--pullquote--font-size: var(--heading--font-size-h4);
--pullquote--border-width: 4px;
--pullquote--color-border: var(--global--color-foreground);
--pullquote--font-size: var(--heading--font-size-h2);
--pullquote--font-style: italic;
--pullquote--line-height: var(--global--line-height-heading);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added two variables here, not entirely sure if they're necessary.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, I like the line-height variable. The italic one might be useful too, but just need to be careful that it doesn’t interfere with any inline-italic rules set by the users (which may be a problem already).

--pullquote--border-width: 0;
--pullquote--color-border: transparent;
--pullquote--color-foreground: var(--global--color-foreground);
--pullquote--color-background: var(--global--color-background);
--quote--border-color: var(--global--color-primary);
--quote--border-width: 4px;
--quote--font-family: var(--global--font-primary);
--quote--font-size: var(--heading--font-size-h4);
--quote--font-size-large: var(--heading--font-size-h3);
--quote--border-color: var(--global--color-secondary);
--quote--border-width: 1px;
--quote--font-family: var(--global--font-secondary);
--quote--font-size: var(--global--font-size-md);
--quote--font-size-large: var(--global--font-size-lg);
--separator--border-color: var(--global--color-border);
--separator--height: 2px;
--separator--width: calc(6 * var(--global--spacing-horizontal));
Expand Down
20 changes: 11 additions & 9 deletions varya/assets/css/variables.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
/* Line Height */
--global--line-height-base: 1;
--global--line-height-body: 1.7;
--global--line-height-heading: 1.125;
--global--line-height-heading: 1.3;
Copy link
Contributor Author

@jffng jffng Mar 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I adjusted the value of this global variable to match the H1 - H3 line height from the comps.

The line heights for the headings overall need to be revisited in a follow-up PR.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coool. Makes sense 👍

/* Colors */
--global--color-primary: #000000;
--global--color-primary-hover: #A36265;
Expand Down Expand Up @@ -125,16 +125,18 @@
--list--font-family: var(--global--font-secondary);
--definition-term--font-family: var(--global--font-primary);
--pullquote--font-family: var(--global--font-primary);
--pullquote--font-size: var(--heading--font-size-h4);
--pullquote--border-width: 4px;
--pullquote--color-border: var(--global--color-foreground);
--pullquote--font-size: var(--heading--font-size-h2);
--pullquote--font-style: italic;
--pullquote--line-height: var(--global--line-height-heading);
--pullquote--border-width: 0;
--pullquote--color-border: transparent;
--pullquote--color-foreground: var(--global--color-foreground);
--pullquote--color-background: var(--global--color-background);
--quote--border-color: var(--global--color-primary);
--quote--border-width: 4px;
--quote--font-family: var(--global--font-primary);
--quote--font-size: var(--heading--font-size-h4);
--quote--font-size-large: var(--heading--font-size-h3);
--quote--border-color: var(--global--color-secondary);
--quote--border-width: 1px;
--quote--font-family: var(--global--font-secondary);
--quote--font-size: var(--global--font-size-md);
--quote--font-size-large: var(--global--font-size-lg);
--separator--border-color: var(--global--color-border);
--separator--height: 2px;
--separator--width: calc(6 * var(--global--spacing-horizontal));
Expand Down
2 changes: 1 addition & 1 deletion varya/assets/sass/abstracts/_config.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ $typescale-ratio: 1.2; // Run ratio math on 1em == $typescale-base * $typescale-
/* Line Height */
--global--line-height-base: #{$typescale-base / ( $typescale-base * 0 + 1 )};
--global--line-height-body: 1.7;
--global--line-height-heading: 1.125;
--global--line-height-heading: 1.3;

/* Colors */
--global--color-primary: #000000;
Expand Down
8 changes: 5 additions & 3 deletions varya/assets/sass/blocks/pullquote/_config.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
@mixin pullquote-variables() {
--pullquote--font-family: var(--global--font-primary);
--pullquote--font-size: var(--heading--font-size-h4);
--pullquote--border-width: 4px; // half of $baseline-unit (8px)
--pullquote--color-border: var(--global--color-foreground);
--pullquote--font-size: var(--heading--font-size-h2);
--pullquote--font-style: italic;
--pullquote--line-height: var(--global--line-height-heading);
--pullquote--border-width: 0;
--pullquote--color-border: transparent;
--pullquote--color-foreground: var(--global--color-foreground);
--pullquote--color-background: var(--global--color-background);
}
36 changes: 19 additions & 17 deletions varya/assets/sass/blocks/pullquote/_editor.scss
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
.wp-block-pullquote {
padding: calc( 3 * var(--global--spacing-unit) ) 0;
padding: calc( 2 * var(--global--spacing-unit) ) 0;
margin-left: 0;
margin-right: 0;
text-align: center;
text-align: left;
// Theme?
border-top-color: var(--pullquote--color-border);
border-top-width: var(--pullquote--border-width);
border-bottom-color: var(--pullquote--color-border);
border-bottom-width: var(--pullquote--border-width);
color: var(--pullquote--color-foreground);

blockquote {
padding-left: 0;
}

p {
font-family: var(--pullquote--font-family);
font-size: var(--heading--font-size-h4);
font-size: var(--pullquote--font-size);
font-style: var(--pullquote--font-style);
letter-spacing: var(--heading--letter-spacing-h4);
line-height: var(--heading--line-height);
line-height: var(--pullquote--line-height);
margin: 0;
}

a {
Expand All @@ -29,7 +27,7 @@
cite,
footer {
color: var(--global--color-foreground-light);
font-size: var(--global--font-size-sm);
font-size: var(--global--font-size-xs);
}

// Block Options
Expand All @@ -41,6 +39,7 @@

background-color: var(--pullquote--color-foreground);
color: var(--pullquote--color-background);
padding: calc( 2 * var(--global--spacing-unit) );

&.alignleft blockquote,
&.alignright blockquote {
Expand All @@ -50,7 +49,9 @@
}

blockquote {
padding-left: 0;
margin: 0;
text-align: left;
max-width: 100%;
}

.wp-block-pullquote__citation,
Expand All @@ -60,11 +61,12 @@
}
}

&.alignwide > p,
&.alignfull > p,
&.alignwide blockquote,
&.alignfull blockquote {
margin-left: auto;
margin-right: auto;
}
}

.wp-block[data-align="full"] {
.wp-block-pullquote:not(.is-style-solid-color) {
blockquote {
padding: 0 calc( 2 * var(--global--spacing-unit));
}
}
}
Loading