Browse Source

Merge pull request #347 from Automattic/textbook-add-gutenberg-support

Textbook: Add Gutenberg styles and support to theme
Laurel 6 năm trước cách đây
mục cha
commit
a7838df410
3 tập tin đã thay đổi với 1060 bổ sung0 xóa
  1. 412 0
      textbook/assets/css/blocks.css
  2. 582 0
      textbook/assets/css/editor-blocks.css
  3. 66 0
      textbook/functions.php

+ 412 - 0
textbook/assets/css/blocks.css

@@ -0,0 +1,412 @@
+/*
+Theme Name: Textbook
+Description: Used to style Gutenberg Blocks.
+*/
+
+/*--------------------------------------------------------------
+>>> TABLE OF CONTENTS:
+----------------------------------------------------------------
+1.0 General Block Styles
+2.0 Blocks - Common Blocks
+3.0 Blocks - Formatting
+4.0 Blocks - Layout Elements
+5.0 Blocks - Widgets
+6.0 Blocks - Colors
+--------------------------------------------------------------*/
+
+/*--------------------------------------------------------------
+1.0 General Block Styles
+--------------------------------------------------------------*/
+
+/* Caption */
+
+[class^="wp-block-"] figcaption {
+	font-size: 14px;
+	font-size: 0.875rem;
+	font-weight: 400;
+	line-height: 1.65em;
+}
+
+/* Video */
+
+.wp-block-embed.is-type-video iframe {
+	max-height: 100%;
+}
+
+/*--------------------------------------------------------------
+2.0 Blocks - Common Blocks
+--------------------------------------------------------------*/
+
+/* Paragraph */
+
+p.has-drop-cap:not(:focus)::first-letter {
+	font-size: 5em;
+	margin-top: 0.15em;
+}
+
+/* Gallery */
+
+.wp-block-gallery {
+	margin: 0 0 1.65em;
+}
+
+/* Quote */
+
+.wp-block-quote.is-large,
+.wp-block-quote.is-style-large {
+}
+
+.wp-block-quote.is-large p,
+.wp-block-quote.is-style-large p {
+	font-size: 22px;
+}
+
+.wp-block-quote.is-large cite,
+.wp-block-quote.is-style-large cite {
+	font-size: 18px;
+}
+
+@media (min-width: 50em) {
+
+	.wp-block-quote.is-large p,
+	.wp-block-quote.is-style-large p {
+		font-size: 26px;
+	}
+
+	.wp-block-quote.is-large cite,
+	.wp-block-quote.is-style-large cite {
+		font-size: 20px;
+	}
+}
+
+/* Audio */
+
+.wp-block-audio {
+	margin: 0 0 1.65em;
+}
+
+.wp-block-audio audio {
+	display: block;
+	width: 100%;
+}
+
+/* Cover */
+
+.wp-block-cover.aligncenter,
+.wp-block-cover-image.aligncenter,
+.wp-block-cover.alignleft,
+.wp-block-cover-image.alignleft,
+.wp-block-cover.alignright,
+.wp-block-cover-image.alignright {
+	display: flex;
+}
+
+.wp-block-cover-image .wp-block-cover-image-text,
+.wp-block-cover-image .wp-block-cover-text,
+.wp-block-cover-image h2,
+.wp-block-cover .wp-block-cover-image-text,
+.wp-block-cover .wp-block-cover-text,
+.wp-block-cover h2 {
+	font-size: 1.5em;
+}
+
+/* File */
+
+.wp-block-file a.wp-block-file__button,
+.wp-block-file a.wp-block-file__button:visited {
+	background: #fff;
+	-webkit-border-radius: 0.333em;
+	-moz-border-radius: 0.333em;
+	border-radius: 0.333em;
+	border: 1px solid #ce4639;
+	color: #ce4639;
+	font-size: 16px;
+	font-size: 1rem;
+	font-weight: 600;
+	line-height: 1;
+	outline: none;
+	padding: 0.825em 13.5px;
+	-webkit-transition: color 0.125s ease-out, background 0.125s ease-out, border-color 0.125s ease-out;
+	-moz-transition: color 0.125s ease-out, background 0.125s ease-out, border-color 0.125s ease-out;
+	-o-transition: color 0.125s ease-out, background 0.125s ease-out, border-color 0.125s ease-out;
+	transition: color 0.125s ease-out, background 0.125s ease-out, border-color 0.125s ease-out;
+}
+
+.wp-block-file a.wp-block-file__button:hover,
+.wp-block-file a.wp-block-file__button:focus {
+	border: 1px solid #222;
+	background: #222;
+	color: #fff;
+}
+
+.rtl .wp-block-file * + .wp-block-file__button {
+	margin-left: 0.75em;
+	margin-right: 0;
+}
+
+/* Video */
+
+.wp-block-video video {
+	width: 100%;
+}
+
+/*--------------------------------------------------------------
+3.0 Blocks - Formatting
+--------------------------------------------------------------*/
+
+/* Verse */
+
+.wp-block-verse {
+	background: transparent;
+	font-family: "Playfair Display", "Times New Roman", Times, serif;
+	font-size: inherit;
+	font-style: italic;
+	padding: 0;
+}
+
+/* Code */
+
+.wp-block-code code {
+
+}
+
+/* Pullquote */
+
+.wp-block-pullquote blockquote {
+	margin-left: 0;
+	margin-right: 0;
+}
+
+/* Table */
+
+.wp-block-table {
+}
+
+.rtl .wp-block-table th {
+
+}
+
+/*--------------------------------------------------------------
+4.0 Blocks - Layout Elements
+--------------------------------------------------------------*/
+
+/* Buttons */
+
+.wp-block-button__link:not(.has-text-color) {
+	color: #ce4639;
+}
+
+.wp-block-button__link:not(.has-background) {
+	 background: #fff;
+}
+
+.wp-block-button .wp-block-button__link {
+	-webkit-border-radius: 0.333em;
+	-moz-border-radius: 0.333em;
+	border-radius: 0.333em;
+	border: 1px solid #ce4639;
+	font-size: 16px;
+	font-size: 1rem;
+	font-weight: 600;
+	line-height: 1;
+	outline: none;
+	padding: 0.825em 13.5px;
+	-webkit-transition: color 0.125s ease-out, background 0.125s ease-out, border-color 0.125s ease-out;
+	-moz-transition: color 0.125s ease-out, background 0.125s ease-out, border-color 0.125s ease-out;
+	-o-transition: color 0.125s ease-out, background 0.125s ease-out, border-color 0.125s ease-out;
+	transition: color 0.125s ease-out, background 0.125s ease-out, border-color 0.125s ease-out;
+}
+
+.wp-block-button__link.has-text-color {
+	border-color: currentColor;
+}
+
+.wp-block-button__link:hover,
+.wp-block-button__link:focus {
+	font-weight: 600;
+	outline: none;
+}
+
+.wp-block-button__link:not(.has-text-color):hover,
+.wp-block-button__link:not(.has-text-color):focus {
+	color: #fff;
+}
+
+.wp-block-button__link:not(.has-background):hover,
+.wp-block-button__link:not(.has-background):focus {
+	border: 1px solid #222;
+	background: #222;
+}
+
+/* Separator */
+
+.wp-block-separator {
+	border: 0;
+}
+
+.wp-block-separator:not(.is-style-wide):not(.is-style-dots) {
+	margin-left: auto;
+	margin-right: auto;
+	max-width: 100px;
+}
+
+/* Media & Text */
+
+.wp-block-media-text {
+	margin-bottom: 1.65em;
+}
+
+.wp-block-media-text *:last-child {
+	margin-bottom: 0;
+}
+
+/*--------------------------------------------------------------
+5.0 Blocks - Widgets
+--------------------------------------------------------------*/
+
+/* Categories, Latest Posts & Archives */
+
+.wp-block-categories.aligncenter,
+.wp-block-categories.aligncenter ul,
+.wp-block-latest-posts.aligncenter,
+.wp-block-archives.aligncenter {
+	list-style-position: inside;
+	margin-left: 0;
+	margin-right: 0;
+	text-align: center;
+}
+
+/* Latest Comments */
+
+.wp-block-latest-comments {
+	margin-left: 0;
+	margin-right: 0;
+}
+
+.wp-block-latest-comments__comment,
+.wp-block-latest-comments__comment-excerpt p {
+	font-size: inherit;
+}
+
+/* Latest Posts */
+
+.wp-block-latest-posts.is-grid {
+	margin-left: 0;
+	margin-right: 0;
+}
+
+/*--------------------------------------------------------------
+6.0 Blocks - Colors
+--------------------------------------------------------------*/
+
+.has-red-color,
+.has-red-color:hover,
+.has-red-color:focus,
+.has-red-color:active,
+.has-red-color:visited {
+	color: #ce4639;
+}
+
+.has-red-background-color,
+.has-red-background-color:hover,
+.has-red-background-color:focus,
+.has-red-background-color:active,
+.has-red-background-color:visited {
+	background-color: #ce4639;
+}
+
+.has-green-color,
+.has-green-color:hover,
+.has-green-color:focus,
+.has-green-color:active,
+.has-green-color:visited {
+	color: #26866d;
+}
+
+.has-green-background-color,
+.has-green-background-color:hover,
+.has-green-background-color:focus,
+.has-green-background-color:active,
+.has-green-background-color:visited {
+	background-color: #26866d;
+}
+
+.has-purple-color,
+.has-purple-color:hover,
+.has-purple-color:focus,
+.has-purple-color:active,
+.has-purple-color:visited {
+	color: #8b66d6;
+}
+
+.has-purple-background-color,
+.has-purple-background-color:hover,
+.has-purple-background-color:focus,
+.has-purple-background-color:active,
+.has-purple-background-color:visited {
+	background-color: #8b66d6;
+}
+
+.has-dark-gray-color,
+.has-dark-gray-color:hover,
+.has-dark-gray-color:focus,
+.has-dark-gray-color:active,
+.has-dark-gray-color:visited {
+	color: #222;
+}
+
+.has-dark-gray-background-color,
+.has-dark-gray-background-color:hover,
+.has-dark-gray-background-color:focus,
+.has-dark-gray-background-color:active,
+.has-dark-gray-background-color:visited {
+	background-color: #222;
+}
+
+.has-medium-gray-color,
+.has-medium-gray-color:hover,
+.has-medium-gray-color:focus,
+.has-medium-gray-color:active,
+.has-medium-gray-color:visited {
+	color: #777;
+}
+
+.has-medium-gray-background-color,
+.has-medium-gray-background-color:hover,
+.has-medium-gray-background-color:focus,
+.has-medium-gray-background-color:active,
+.has-medium-gray-background-color:visited {
+	background-color: #777;
+}
+
+.has-light-gray-color,
+.has-light-gray-color:hover,
+.has-light-gray-color:focus,
+.has-light-gray-color:active,
+.has-light-gray-color:visited {
+	color: #e1dfdc;
+}
+
+.has-light-gray-background-color,
+.has-light-gray-background-color:hover,
+.has-light-gray-background-color:focus,
+.has-light-gray-background-color:active,
+.has-light-gray-background-color:visited {
+	background-color: #e1dfdc;
+}
+
+.has-white-color,
+.has-white-color:hover,
+.has-white-color:focus,
+.has-white-color:active,
+.has-white-color:visited {
+	color: #fff;
+}
+
+.has-white-background-color,
+.has-white-background-color:hover,
+.has-white-background-color:focus,
+.has-white-background-color:active,
+.has-white-background-color:visited {
+	background-color: #fff;
+}

+ 582 - 0
textbook/assets/css/editor-blocks.css

@@ -0,0 +1,582 @@
+/*
+Theme Name: Textbook
+Description: Used to style Gutenberg Blocks in the editor.
+*/
+
+/*--------------------------------------------------------------
+>>> TABLE OF CONTENTS:
+----------------------------------------------------------------
+1.0 General Typography
+2.0 General Block Settings
+3.0 Blocks - Common Blocks
+4.0 Blocks - Formatting
+5.0 Blocks - Layout Elements
+6.0 Blocks - Widgets
+
+--------------------------------------------------------------*/
+
+/*--------------------------------------------------------------
+1.0 General Typography
+--------------------------------------------------------------*/
+
+.edit-post-visual-editor .editor-block-list__block,
+.editor-default-block-appender input[type="text"].editor-default-block-appender__content {
+	font-family: "Libre Franklin", "Helvetica Neue", Helvetica, Arial, sans-serif;
+}
+
+/* Font size */
+
+.edit-post-visual-editor .editor-block-list__block,
+.edit-post-visual-editor .editor-block-list__block p,
+.editor-default-block-appender input[type="text"].editor-default-block-appender__content {
+	font-size: 14.4px;
+	font-weight: 300;
+	line-height: 1.65;
+}
+
+@media screen and (min-width: 50em) {
+	.edit-post-visual-editor .editor-block-list__block,
+	.edit-post-visual-editor .editor-block-list__block p,
+	.editor-default-block-appender input[type="text"].editor-default-block-appender__content {
+		font-size: 16px;
+	}
+}
+
+/* Color */
+
+.edit-post-visual-editor .editor-block-list__block {
+	color: #434343;
+}
+
+/* Post title */
+
+.editor-post-title__block .editor-post-title__input {
+	color: #222;
+	font-family: "Playfair Display SC", "Times New Roman", Times, serif;
+	font-size: 20px;
+	letter-spacing: 0.15em;
+	line-height: 1.25;
+}
+
+@media (min-width: 50em) {
+	.editor-post-title__block .editor-post-title__input {
+		font-size: 30px;
+	}
+}
+
+/* Headings */
+
+.edit-post-visual-editor h1,
+.wp-block-freeform.block-library-rich-text__tinymce h1,
+.edit-post-visual-editor h2,
+.wp-block-freeform.block-library-rich-text__tinymce h2,
+.edit-post-visual-editor h3,
+.wp-block-freeform.block-library-rich-text__tinymce h3,
+.edit-post-visual-editor h4,
+.wp-block-freeform.block-library-rich-text__tinymce h4 {
+	font-family: "Playfair Display SC", "Times New Roman", Times, serif;
+	letter-spacing: 0.15em;
+	line-height: 1.25em;
+}
+
+.edit-post-visual-editor h5,
+.wp-block-freeform.block-library-rich-text__tinymce h5,
+.edit-post-visual-editor h6,
+.wp-block-freeform.block-library-rich-text__tinymce h6 {
+	font-family: "Libre Franklin", "Helvetica Neue", Helvetica, Arial, sans-serif;
+	text-transform: uppercase;
+}
+
+.edit-post-visual-editor h1,
+.wp-block-freeform.block-library-rich-text__tinymce h1 {
+	font-size: 32px;
+}
+
+.edit-post-visual-editor h2,
+.wp-block-freeform.block-library-rich-text__tinymce h2 {
+	font-size: 26.72px;
+}
+
+.edit-post-visual-editor h3,
+.wp-block-freeform.block-library-rich-text__tinymce h3 {
+	font-size: 22.8px;
+}
+
+.edit-post-visual-editor h4,
+.wp-block-freeform.block-library-rich-text__tinymce h4 {
+	font-size: 20px;
+}
+
+.edit-post-visual-editor h5,
+.wp-block-freeform.block-library-rich-text__tinymce h5 {
+	font-size: 18px;
+}
+
+.edit-post-visual-editor h6,
+.wp-block-freeform.block-library-rich-text__tinymce h6 {
+	font-size: 16px;
+}
+
+/*--------------------------------------------------------------
+2.0 General Block Settings
+--------------------------------------------------------------*/
+
+/* Main content width */
+
+.wp-block {
+	max-width: 663px; /* 633px + 30px to account for padding */
+}
+
+/* Link styles */
+
+.edit-post-visual-editor a,
+.editor-block-list__block a,
+.wp-block-freeform.block-library-rich-text__tinymce a {
+	color: #ce4639;
+	text-decoration: none;
+}
+
+/* Table styles */
+
+.wp-block-freeform.block-library-rich-text__tinymce table {
+	border-collapse: collapse;
+}
+
+.wp-block-freeform.block-library-rich-text__tinymce table th {
+	padding-bottom: 0;
+	padding-top: 0;
+}
+
+.wp-block-freeform.block-library-rich-text__tinymce table th,
+.wp-block-freeform.block-library-rich-text__tinymce table td {
+	border: 1px solid #ce4639;
+	padding: .5em;
+	text-align: left;
+}
+
+.wp-block-freeform.block-library-rich-text__tinymce table tbody {
+	background: #fff;
+	border: 1px solid #ce4639;
+	-webkit-border-bottom-left-radius: 0.5em;
+	-moz-border-bottom-left-radius: 0.5em;
+	border-bottom-left-radius: 0.5em;
+	-webkit-border-bottom-right-radius: 0.5em;
+	-moz-border-bottom-right-radius: 0.5em;
+	border-bottom-right-radius: 0.5em;
+}
+
+.wp-block-freeform.block-library-rich-text__tinymce table tbody tr:nth-child(odd) {
+	background: #fff;
+}
+
+.wp-block-freeform.block-library-rich-text__tinymce table tbody tr:nth-child(even) {
+	background: #f0eeec;
+}
+
+.wp-block-freeform.block-library-rich-text__tinymce table thead tr {
+	background: #222;
+	color: #fff;
+	font-size: 12.8px;
+	font-weight: 700;
+	letter-spacing: .075em;
+	line-height: 1.2375em;
+	text-transform: uppercase;
+}
+
+.rtl .wp-block-freeform.block-library-rich-text__tinymce table th,
+.rtl .wp-block-freeform.block-library-rich-text__tinymce table td {
+	text-align: right;
+}
+
+/* Quote styles */
+
+.wp-block-freeform.block-library-rich-text__tinymce blockquote {
+	border: 0;
+	color: #222;
+	font-family: "Playfair Display", "Times New Roman", Times, serif;
+	line-height: 1.5;
+	font-style: italic;
+	padding: 0;
+	margin-left: 30px;
+}
+
+.wp-block-freeform.block-library-rich-text__tinymce cite {
+	color: #222;
+}
+
+.edit-post-visual-editor .editor-block-list__block .wp-block-freeform.block-library-rich-text__tinymce blockquote p {
+	font-size: 17.6px;
+}
+
+.rtl .wp-block-freeform.block-library-rich-text__tinymce blockquote {
+	margin-left: 0;
+	margin-right: 30px;
+}
+
+@media (min-width: 50em) {
+	.edit-post-visual-editor .editor-block-list__block .wp-block-freeform.block-library-rich-text__tinymce blockquote p {
+		font-size: 20px;
+	}
+}
+
+/* List styles */
+
+.wp-block-freeform.block-library-rich-text__tinymce li,
+.editor-styles-wrapper li {
+	margin-bottom: 0;
+}
+
+/* Caption styles */
+
+[class^="wp-block-"] figcaption {
+	font-size: 14px;
+	line-height: 1.65em;
+	font-weight: 400;
+}
+
+[class^="wp-block-"]:not(.wp-block-gallery) figcaption {
+
+}
+
+/* Definition List styles */
+
+.wp-block-freeform.block-library-rich-text__tinymce dt {
+	font-weight: bold;
+}
+
+/* Pre styles */
+
+.wp-block-freeform.block-library-rich-text__tinymce pre {
+	background: #eee;
+	font-family: "Courier 10 Pitch", Courier, monospace;
+	font-size: 15px;
+	line-height: 1.8;
+	padding: 1.6em;
+}
+
+/* Code, etc styles */
+
+.wp-block-freeform.block-library-rich-text__tinymce code,
+.wp-block-freeform.block-library-rich-text__tinymce kbd,
+.wp-block-freeform.block-library-rich-text__tinymce tt,
+.wp-block-freeform.block-library-rich-text__tinymce var {
+	background: transparent;
+	font-family: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace;
+	font-size: 15px;
+}
+
+/* Mark & Ins styles */
+
+.wp-block-freeform.block-library-rich-text__tinymce mark,
+.wp-block-freeform.block-library-rich-text__tinymce ins {
+	background: #fff9c0;
+	text-decoration: none;
+}
+
+/*--------------------------------------------------------------
+3.0 Blocks - Common Blocks
+--------------------------------------------------------------*/
+
+/* Paragraph */
+
+p.has-drop-cap:not(:focus)::first-letter {
+	font-size: 5em;
+	margin-top: 0.15em;
+}
+
+/* Gallery */
+
+.wp-block-gallery {
+	margin: 0 0 ;
+}
+
+/* Quote */
+
+.wp-block-quote:not(.is-large):not(.is-style-large),
+.wp-block-quote.is-large,
+.wp-block-quote.is-style-large {
+	border: 0;
+	color: #222;
+	font-family: "Playfair Display", "Times New Roman", Times, serif;
+	line-height: 1.5;
+	font-style: italic;
+	padding: 0;
+	margin-left: 30px;
+}
+
+.wp-block-quote .wp-block-quote__citation {
+	color: #222;
+}
+
+.wp-block-quote:not(.is-large):not(.is-style-large) p,
+.wp-block-quote .wp-block-quote__citation {
+	font-size: 17.6px;
+}
+
+.wp-block-quote.is-large p,
+.wp-block-quote.is-style-large p {
+	font-size: 22px;
+}
+
+.wp-block-quote.is-large .wp-block-quote__citation,
+.wp-block-quote.is-style-large .wp-block-quote__citation {
+	font-size: 18px;
+}
+
+.rtl .wp-block-quote:not(.is-large):not(.is-style-large),
+.rtl .wp-block-quote.is-large,
+.rtl .wp-block-quote.is-style-large {
+	margin-left: 0;
+	margin-right: 30px;
+}
+
+@media (min-width: 50em) {
+
+	.wp-block-quote:not(.is-large):not(.is-style-large) p,
+	.wp-block-quote .wp-block-quote__citation {
+		font-size: 20px;
+	}
+
+	.wp-block-quote.is-large p,
+	.wp-block-quote.is-style-large p {
+		font-size: 26px;
+	}
+
+	.wp-block-quote.is-large .wp-block-quote__citation,
+	.wp-block-quote.is-style-large .wp-block-quote__citation {
+		font-size: 20px;
+	}
+}
+
+/* Cover */
+
+.edit-post-visual-editor .editor-block-list__block .wp-block-cover-image .wp-block-cover-image-text,
+.edit-post-visual-editor .editor-block-list__block .wp-block-cover-image .wp-block-cover-text,
+.edit-post-visual-editor .editor-block-list__block .wp-block-cover-image h2,
+.edit-post-visual-editor .editor-block-list__block .wp-block-cover .wp-block-cover-image-text,
+.edit-post-visual-editor .editor-block-list__block .wp-block-cover .wp-block-cover-text,
+.edit-post-visual-editor .editor-block-list__block .wp-block-cover h2 {
+	font-size: 1.5em;
+}
+
+/* File */
+
+.wp-block-file__textlink {
+	color: #ce4639;
+}
+
+.wp-block-file .wp-block-file__button {
+	background: #fff;
+	-webkit-border-radius: 0.333em;
+	-moz-border-radius: 0.333em;
+	border-radius: 0.333em;
+	border: 1px solid #ce4639;
+	color: #ce4639;
+	font-size: 16px;
+	font-size: 1rem;
+	font-weight: 600;
+	line-height: 1;
+	outline: none;
+	padding: 0.825em 13.5px;
+	-webkit-transition: color 0.125s ease-out, background 0.125s ease-out, border-color 0.125s ease-out;
+	-moz-transition: color 0.125s ease-out, background 0.125s ease-out, border-color 0.125s ease-out;
+	-o-transition: color 0.125s ease-out, background 0.125s ease-out, border-color 0.125s ease-out;
+	transition: color 0.125s ease-out, background 0.125s ease-out, border-color 0.125s ease-out;
+
+}
+
+.wp-block-file .wp-block-file__button:hover,
+.wp-block-file .wp-block-file__button:focus {
+	border: 1px solid #222;
+	background: #222;
+	color: #fff;
+}
+
+/*--------------------------------------------------------------
+4.0 Blocks - Formatting
+--------------------------------------------------------------*/
+
+/* Verse */
+
+.wp-block-verse pre {
+	font-family: "Playfair Display", "Times New Roman", Times, serif;
+	font-size: inherit;
+	font-style: italic;
+	padding: 0;
+}
+
+/* Code */
+
+.wp-block-code {
+	border: 0;
+	border-radius: 0;
+	background: #eee;
+	padding: 1.6em;
+}
+
+.wp-block-code .editor-plain-text {
+	background: transparent;
+	font-family: "Courier 10 Pitch", Courier, monospace;
+	font-size: 15px;
+	line-height: 1.8;
+}
+
+/* Preformatted */
+
+.wp-block-preformatted {
+	background: #eee;
+	font-family: "Courier 10 Pitch", Courier, monospace;
+	font-size: 15px;
+	line-height: 1.8;
+	padding: 1.6em;
+}
+
+/* Pullquote */
+
+.wp-block-pullquote {
+	border: 0;
+	color: #222;
+}
+
+.wp-block-pullquote blockquote {
+	font-family: "Playfair Display", "Times New Roman", Times, serif;
+	font-size: 28px;
+	font-style: italic;
+	line-height: 1.6;
+}
+.wp-block-pullquote__citation {
+	font-family: "Playfair Display", "Times New Roman", Times, serif;
+	font-size: 20px;
+	font-style: italic;
+	text-transform: none;
+}
+
+/* Table */
+
+.wp-block-table {
+	border-collapse: collapse;
+}
+
+.editor-styles-wrapper .wp-block-table th {
+	padding-bottom: 0.25em;
+	padding-top: 0.25em;
+}
+
+.wp-block-table th,
+.wp-block-table td {
+	border: 1px solid #ce4639;
+	padding: .5em;
+	text-align: left;
+}
+
+.wp-block-table tbody {
+	background: #fff;
+	border: 1px solid #ce4639;
+	-webkit-border-bottom-left-radius: 0.5em;
+	-moz-border-bottom-left-radius: 0.5em;
+	border-bottom-left-radius: 0.5em;
+	-webkit-border-bottom-right-radius: 0.5em;
+	-moz-border-bottom-right-radius: 0.5em;
+	border-bottom-right-radius: 0.5em;
+}
+
+.wp-block-table tbody tr:nth-child(odd) {
+	background: #fff;
+}
+
+.wp-block-table tbody tr:nth-child(even) {
+	background: #f0eeec;
+}
+
+.wp-block-table thead tr {
+	background: #222;
+	color: #fff;
+	font-size: 12.8px;
+	font-weight: 700;
+	letter-spacing: .075em;
+	line-height: 1.2375em;
+	text-transform: uppercase;
+}
+
+.wp-block-table__cell-content {
+	padding: 0;
+}
+
+.rtl .wp-block-table th,
+.rtl .wp-block-table td {
+	text-align: right;
+}
+
+/*--------------------------------------------------------------
+5.0 Blocks - Layout Elements
+--------------------------------------------------------------*/
+
+/* Buttons */
+
+.wp-block-button .wp-block-button__link {
+	background: #fff;
+	-webkit-border-radius: 0.333em;
+	-moz-border-radius: 0.333em;
+	border-radius: 0.333em;
+	border: 1px solid #ce4639;
+	color: #ce4639;
+	font-size: 16px;
+	font-size: 1rem;
+	font-weight: 600;
+	line-height: 1;
+	outline: none;
+	padding: 0.825em 13.5px;
+	-webkit-transition: color 0.125s ease-out, background 0.125s ease-out, border-color 0.125s ease-out;
+	-moz-transition: color 0.125s ease-out, background 0.125s ease-out, border-color 0.125s ease-out;
+	-o-transition: color 0.125s ease-out, background 0.125s ease-out, border-color 0.125s ease-out;
+	transition: color 0.125s ease-out, background 0.125s ease-out, border-color 0.125s ease-out;
+}
+
+.wp-block-button__link:hover,
+.wp-block-button__link:focus {
+	border: 1px solid #222;
+	background: #222;
+	color: #fff;
+}
+
+.wp-block-button .wp-block-button__link.has-text-color {
+	border-color: currentColor;
+}
+
+/* Separator */
+
+.wp-block-separator {
+	border-color: #ccc;
+	border-width: 1px;
+}
+
+/*--------------------------------------------------------------
+6.0 Blocks - Widgets
+--------------------------------------------------------------*/
+
+/* Categories, Latest Posts & Archives */
+
+[data-align="center"] .wp-block-categories ul,
+[data-align="center"] .wp-block-latest-posts ul,
+[data-align="center"] .wp-block-archives ul {
+	list-style-position: inside;
+}
+
+/* Latest Comments */
+
+.wp-block-latest-comments {
+	margin-left: 0;
+	margin-right: 0;
+}
+
+.wp-block-latest-comments__comment-date {
+}
+
+.wp-block-latest-comments__comment {
+	font-size: 80%;
+}
+
+.wp-block-latest-comments__comment-excerpt p {
+	font-size: inherit;
+}
+

+ 66 - 0
textbook/functions.php

@@ -67,6 +67,47 @@ function textbook_setup() {
 		'caption',
 	) );
 
+	// Add support for responsive embeds.
+	add_theme_support( 'responsive-embeds' );
+
+	// Add support for custom color scheme.
+	add_theme_support( 'editor-color-palette', array(
+		array(
+			'name'  => esc_html__( 'Red', 'textbook' ),
+			'slug'  => 'red',
+			'color' => '#ce4639',
+		),
+		array(
+			'name'  => esc_html__( 'Green', 'textbook' ),
+			'slug'  => 'green',
+			'color' => '#26866d',
+		),
+		array(
+			'name'  => esc_html__( 'Purple', 'textbook' ),
+			'slug'  => 'purple',
+			'color' => '#8b66d6',
+		),
+		array(
+			'name'  => esc_html__( 'Dark Gray', 'textbook' ),
+			'slug'  => 'dark-gray',
+			'color' => '#222',
+		),
+		array(
+			'name'  => esc_html__( 'Medium Gray', 'textbook' ),
+			'slug'  => 'medium-gray',
+			'color' => '#777',
+		),
+		array(
+			'name'  => esc_html__( 'Light Gray', 'textbook' ),
+			'slug'  => 'light-gray',
+			'color' => '#e1dfdc',
+		),
+		array(
+			'name'  => esc_html__( 'White', 'textbook' ),
+			'slug'  => 'white',
+			'color' => '#fff',
+		),
+	) );
 }
 endif;
 add_action( 'after_setup_theme', 'textbook_setup' );
@@ -250,6 +291,10 @@ function textbook_scripts() {
 	// Textbook Stylesheet
 	wp_enqueue_style( 'textbook-style', get_stylesheet_uri() );
 
+	// Block stylesheets
+	wp_enqueue_style( 'textbook-block-style', get_template_directory_uri() . '/assets/css/blocks.css', array( 'textbook-style' ), '20181018' );
+
+
 	/*
 	 * Scripts
 	 */
@@ -292,6 +337,27 @@ function textbook_scripts() {
 }
 add_action( 'wp_enqueue_scripts', 'textbook_scripts' );
 
+/**
+ * Enqueue editor styles for Gutenberg
+ */
+function textbook_block_editor_styles() {
+	// Block styles.
+	wp_enqueue_style( 'textbook-block-editor-style', get_template_directory_uri() . '/assets/css/editor-blocks.css' );
+
+	// Libre Franklin font
+	wp_register_style( 'textbook-libre-franklin', textbook_libre_franklin_url(), array(), null );
+	wp_enqueue_style( 'textbook-libre-franklin' );
+
+	// Playfair Display font
+	wp_register_style( 'textbook-playfair-display', textbook_playfair_display_url(), array(), null );
+	wp_enqueue_style( 'textbook-playfair-display' );
+
+	// Playfair Display Small Caps font
+	wp_register_style( 'textbook-playfair-display-sc', textbook_playfair_display_sc_url(), array(), null );
+	wp_enqueue_style( 'textbook-playfair-display-sc' );
+}
+add_action( 'enqueue_block_editor_assets', 'textbook_block_editor_styles' );
+
 /*
  * Check whether the browser supports JavaScript.
  */