Selaa lähdekoodia

Karuna: Tweaked some nitpicky stuff in the theme's Gutenberg implementation:
* Reorganized some CSS, and removed empty selectors.
* Added styles to prevent side-scroll with full alignments.
* Updated caption font size and colour.
* Added style to make sure video in video block would span full screen.
* Added spacing under the Media & Text block.
* Added styles for definition lists in editor.
* Styled file text link in editor.

Laurel Fulford 6 vuotta sitten
vanhempi
commit
da9cc222ab
2 muutettua tiedostoa jossa 135 lisäystä ja 82 poistoa
  1. 72 35
      karuna/blocks.css
  2. 63 47
      karuna/editor-blocks.css

+ 72 - 35
karuna/blocks.css

@@ -18,33 +18,14 @@ Description: Used to style Gutenberg Blocks.
 1.0 General Block Styles
 --------------------------------------------------------------*/
 
-/* Captions */
-
-[class^="wp-block-"] figcaption {
-	font-style: italic;
-	text-align: center;
-}
-
-/*--------------------------------------------------------------
-2.0 Blocks - Common Blocks
---------------------------------------------------------------*/
-
-/* Paragraph */
-
-p.has-drop-cap:not(:focus)::first-letter {
-	font-size: 130px;
-}
+/* Alignments */
 
-/* Images */
-
-.wp-block-cover,
-.wp-block-cover.alignleft,
-.wp-block-cover.alignright,
-.wp-block-cover.aligncenter {
-	display: flex;
+#page {
+	overflow-x: hidden; /* prevents slight side-scroll with full aligned images. */
 }
 
 /* Full Width */
+
 .no-sidebar .alignfull {
 	width: 100vw;
 	max-width: 100vw;
@@ -65,11 +46,6 @@ p.has-drop-cap:not(:focus)::first-letter {
 	padding-right: 1.6em;
 }
 
-.no-sidebar .wp-block-table.alignfull {
-	margin-left: .8em;
-	margin-right: .8em;
-}
-
 .no-sidebar .wp-block-embed.is-type-video.alignfull iframe {
 	width: 100% !important;
 	height: 100% !important;
@@ -98,6 +74,37 @@ p.has-drop-cap:not(:focus)::first-letter {
 	}
 }
 
+/* Captions */
+
+[class^="wp-block-"] figcaption {
+	font-size: inherit;
+	font-style: italic;
+	text-align: center;
+}
+
+[class^="wp-block-"]:not(.wp-block-gallery) figcaption {
+	color: inherit;
+}
+
+/*--------------------------------------------------------------
+2.0 Blocks - Common Blocks
+--------------------------------------------------------------*/
+
+/* Paragraph */
+
+p.has-drop-cap:not(:focus)::first-letter {
+	font-size: 130px;
+}
+
+/* Images */
+
+.wp-block-cover,
+.wp-block-cover.alignleft,
+.wp-block-cover.alignright,
+.wp-block-cover.aligncenter {
+	display: flex;
+}
+
 /* Gallery */
 
 .wp-block-gallery {
@@ -215,6 +222,11 @@ p.has-drop-cap:not(:focus)::first-letter {
 	margin-right: 0;
 }
 
+/* Video */
+
+.wp-block-video.alignfull video {
+	width: 100%;
+}
 
 /*--------------------------------------------------------------
 3.0 Blocks - Formatting Blocks
@@ -287,13 +299,17 @@ p.has-drop-cap:not(:focus)::first-letter {
 	padding-right: 1.6em;
 }
 
-.rtl .wp-block-pullquote {
-}
-
 .wp-block-pullquote p {
 	margin: 0 0 .8em;
 }
 
+/* Table */
+
+.no-sidebar .wp-block-table.alignfull {
+	margin-left: .8em;
+	margin-right: .8em;
+}
+
 /*--------------------------------------------------------------
 4.0 Blocks - Layout Elements
 --------------------------------------------------------------*/
@@ -355,6 +371,9 @@ hr.wp-block-separator {
 	border: 0;
 	height: 1px;
 	margin-bottom: 1.6em;
+}
+
+.wp-block-separator:not(.is-style-wide):not(.is-style-dots) {
 	max-width: 100px;
 }
 
@@ -362,16 +381,35 @@ hr.wp-block-separator {
 	max-width: 100%;
 }
 
+/* Media & Text */
+
+.wp-block-media-text {
+	margin-bottom: 1.6em;
+}
+
+.wp-block-media-text *:last-child {
+	margin-bottom: 0;
+}
+
 /*--------------------------------------------------------------
 5.0 Blocks - Widget Blocks
 --------------------------------------------------------------*/
 
+/* 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;
+	text-align: center;
+}
+
 /* Categories */
 
 .wp-block-categories.aligncenter {
 	margin-left: 1.6em;
 	margin-right: 1.6em;
-	text-align: center;
 }
 
 .wp-block-categories-list.alignleft {
@@ -391,9 +429,6 @@ hr.wp-block-separator {
 	text-decoration: none;
 }
 
-.wp-block-latest-comments__comment-date {
-}
-
 .wp-block-latest-comments .wp-block-latest-comments__comment {
 	border-top: 1px solid #dddddd;
 	margin-bottom: 0;
@@ -404,6 +439,8 @@ hr.wp-block-separator {
 	margin-bottom: 0;
 }
 
+/* Latest Posts */
+
 .rtl .wp-block-latest-posts {
 	margin-left: 0;
 	margin-right: 0;

+ 63 - 47
karuna/editor-blocks.css

@@ -27,33 +27,12 @@
 	line-height: 1.6;
 }
 
-.alignleft {
-	display: inline;
-	float: left;
-	margin: .8em 1.6em .8em 0;
-}
-
-.alignright {
-	display: inline;
-	float: right;
-	margin: .8em 0 .8em 1.6em;
-}
-
-.aligncenter {
-	margin-left: auto;
-	margin-right: auto;
-}
-
-.wp-block-columns.alignfull,
-.wp-block-latest-comments.alignfull,
-.editor-block-list__block[data-align="full"] .wp-block-file {
-	padding-left: 1.6em;
-	padding-right: 1.6em;
-}
-
-.editor-block-list__block[data-align="full"] table.wp-block-table {
-	margin-left: .8em;
-	margin-right: .8em;
+@media screen and (min-width: 768px) {
+	.edit-post-visual-editor .editor-block-list__block,
+	.edit-post-visual-editor .editor-block-list__block p:not(.wp-block-cover-text),
+	.editor-default-block-appender input[type="text"].editor-default-block-appender__content {
+		font-size: 18px;
+	}
 }
 
 /* Title */
@@ -139,13 +118,6 @@
 	margin: .8em 0;
 }
 
-/* Images */
-
-.wp-block-image figcaption {
-	font-style: italic;
-	text-align: center;
-}
-
 /*--------------------------------------------------------------
 2.0 General Block Styles
 --------------------------------------------------------------*/
@@ -156,6 +128,32 @@
 	max-width: 715px; /* 685px + 30px to account for padding */
 }
 
+/* Alignments */
+
+.alignleft {
+	display: inline;
+	float: left;
+	margin: .8em 1.6em .8em 0;
+}
+
+.alignright {
+	display: inline;
+	float: right;
+	margin: .8em 0 .8em 1.6em;
+}
+
+.aligncenter {
+	margin-left: auto;
+	margin-right: auto;
+}
+
+.wp-block-columns.alignfull,
+.wp-block-latest-comments.alignfull,
+.editor-block-list__block[data-align="full"] .wp-block-file {
+	padding-left: 1.6em;
+	padding-right: 1.6em;
+}
+
 /* Link styles */
 
 .edit-post-visual-editor a,
@@ -232,10 +230,22 @@
 /* Captions */
 
 [class^="wp-block-"] figcaption {
-	text-align: center;
+	font-size: inherit;
 	font-style: italic;
+	text-align: center;
+}
+
+[class^="wp-block-"]:not(.wp-block-gallery) figcaption {
+	color: inherit;
 }
 
+/* Definition List styles */
+
+.wp-block-freeform.block-library-rich-text__tinymce dt {
+	font-weight: bold;
+}
+
+
 /*--------------------------------------------------------------
 3.0 Blocks - Common Blocks
 --------------------------------------------------------------*/
@@ -323,12 +333,13 @@
 	font-style: normal;
 }
 
-/* Audio */
-
-/* Cover Images */
-
 /* File */
 
+.wp-block-file__textlink {
+	color: #6636cc;
+	font-weight: bold;
+}
+
 .wp-block-file .wp-block-file__button {
 	border: 2px solid;
 	border-color: #6636cc;
@@ -377,6 +388,8 @@
 
 .wp-block-code {
 	background: rgba(0, 0, 0, 0.02);
+	border: 0;
+	border-radius: 0;
 	font-family: "Courier 10 Pitch", Courier, monospace;
 	font-size: 15px;
 	font-size: 0.9375rem;
@@ -394,7 +407,7 @@
 /* Classic */
 
 .wp-block-freeform.block-library-rich-text__tinymce address {
-	margin-top: 0.8em; 
+	margin-top: 0.8em;
 	margin-bottom: 0.8em;
 }
 
@@ -697,19 +710,22 @@
 .wp-block-separator {
 	background-color: #ddd;
 	border: 0;
-	height: 1px;
+	height: 1.1px; /* To work around odd issue in Firefox */
 	margin-bottom: 1.6em;
 }
 
-
-.wp-block-separator.is-style-wide {
-	max-width: 100%;
-}
-
 /*--------------------------------------------------------------
 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;
+}
+
 /* Categories */
 
 .editor-block-list__block[data-align=right] .wp-block-categories__list,
@@ -749,4 +765,4 @@
 
 .edit-post-visual-editor .wp-block-latest-posts.is-grid li {
 	margin-bottom: 1em;
-}
+}