浏览代码

Merge pull request #3763 from Automattic/update/mayland-blocks-build-2

Use build process in child theme.
Ben Dwyer 4 年之前
父节点
当前提交
8d9e3d47b2

+ 64 - 0
mayland-blocks/assets/theme.css

@@ -0,0 +1,64 @@
+/* Smooth out the fonts. */
+body {
+	-webkit-font-smoothing: antialiased;
+	-moz-osx-font-smoothing: grayscale;
+}
+
+/* Adjust header spacing. */
+.site-header .wp-block-site-title a {
+	text-decoration: none;
+}
+
+.site-header .wp-block-navigation {
+	margin-bottom: 0;
+}
+
+.site-header .wp-block-social-links.alignright {
+	margin: 0 0 0 1em;
+	transform: translateY(-0.3rem);
+}
+
+@media screen and (min-width: 1290px) {
+	.site-header .wp-block-column,
+	.site-footer .wp-block-column {
+		padding-left: var(--wp--custom--margin--horizontal);
+		padding-right: var(--wp--custom--margin--horizontal);
+	}
+}
+
+/* Adjust heading letter spacing. */
+h1, h2, h3 {
+	letter-spacing: -0.015em;
+}
+
+/* 
+ * Preserve image ratios.
+ * Needed until https://github.com/WordPress/gutenberg/pull/27518/ is merged. 
+ */
+img {
+	height: auto;
+	max-width: 100%;
+}
+
+/* Post Meta */
+.post-meta a {
+	color: currentColor;
+}
+
+.post-meta .wp-block-post-author:before {
+	background: url(assets/svg/post-author.svg) no-repeat;
+}
+
+.post-meta .wp-block-post-date:before {
+	background: url(assets/svg/post-date.svg) no-repeat;
+}
+
+.post-meta .wp-block-post-hierarchical-terms:before {
+	background: url(assets/svg/post-category.svg) no-repeat;
+}
+
+.post-meta .wp-block-post-tags:before {
+	background: url(assets/svg/post-tag.svg) no-repeat;
+}
+
+/*# sourceMappingURL=theme.css.map */

+ 1 - 1
mayland-blocks/functions.php

@@ -6,7 +6,7 @@ if ( ! function_exists( 'mayland_blocks_support' ) ) :
 		// Enqueue editor styles.
 		add_editor_style(
 			array(
-				'style.css',
+				'theme.css',
 			)
 		);
 	}

+ 18 - 18
mayland-blocks/package-lock.json

@@ -50,9 +50,9 @@
 			}
 		},
 		"anymatch": {
-			"version": "3.1.2",
-			"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz",
-			"integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==",
+			"version": "3.1.1",
+			"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz",
+			"integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==",
 			"dev": true,
 			"requires": {
 				"normalize-path": "^3.0.0",
@@ -1226,9 +1226,9 @@
 			}
 		},
 		"hosted-git-info": {
-			"version": "2.8.9",
-			"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz",
-			"integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==",
+			"version": "2.8.8",
+			"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz",
+			"integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==",
 			"dev": true
 		},
 		"http-signature": {
@@ -1315,9 +1315,9 @@
 			"dev": true
 		},
 		"is-core-module": {
-			"version": "2.3.0",
-			"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.3.0.tgz",
-			"integrity": "sha512-xSphU2KG9867tsYdLD4RWQ1VqdFl4HTO9Thf3I/3dLEfr0dbPTWKsuCKrgqMljg4nPE+Gq0VCnzT3gr0CyBmsw==",
+			"version": "2.2.0",
+			"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz",
+			"integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==",
 			"dev": true,
 			"requires": {
 				"has": "^1.0.3"
@@ -2169,9 +2169,9 @@
 			"dev": true
 		},
 		"picomatch": {
-			"version": "2.2.3",
-			"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.3.tgz",
-			"integrity": "sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg==",
+			"version": "2.2.2",
+			"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz",
+			"integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==",
 			"dev": true
 		},
 		"pify": {
@@ -2410,9 +2410,9 @@
 			}
 		},
 		"repeat-element": {
-			"version": "1.1.4",
-			"resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.4.tgz",
-			"integrity": "sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==",
+			"version": "1.1.3",
+			"resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz",
+			"integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==",
 			"dev": true
 		},
 		"repeat-string": {
@@ -3224,9 +3224,9 @@
 			"dev": true
 		},
 		"y18n": {
-			"version": "4.0.3",
-			"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz",
-			"integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==",
+			"version": "4.0.1",
+			"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz",
+			"integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==",
 			"dev": true
 		},
 		"yallist": {

+ 4 - 3
mayland-blocks/package.json

@@ -11,9 +11,10 @@
 		"node-sass-package-importer": "^5.3.2"
 	},
 	"scripts": {
-		"start": "chokidar child-experimental-theme.json ../blank-canvas-blocks/experimental-theme.json -c \"npm run build\" --initial",
-		"build": "npm run build:theme",
-		"build:theme": "node ../blank-canvas-blocks/build.js mayland-blocks"
+		"start": "chokidar \"**/*.scss\" child-experimental-theme.json ../blank-canvas-blocks/experimental-theme.json -c \"npm run build\" --initial",
+		"build": "npm run build:theme && npm run build:scss",
+		"build:theme": "node ../blank-canvas-blocks/build.js seedlet-blocks",
+		"build:scss": "node-sass --importer node_modules/node-sass-package-importer/dist/cli.js sass/theme.scss assets/theme.css --output-style expanded --indent-type tab --indent-width 1 --source-map true"
 	},
 	"author": "",
 	"license": "GPLv2"

+ 69 - 0
mayland-blocks/sass/theme.scss

@@ -0,0 +1,69 @@
+/* Smooth out the fonts. */
+
+body {
+	-webkit-font-smoothing: antialiased;
+	-moz-osx-font-smoothing: grayscale;
+}
+
+/* Adjust header spacing. */
+.site-header > .wp-block-columns {
+	padding: 0 var(--wp--custom--margin--horizontal);
+}
+
+.site-header .wp-block-site-title a {
+	text-decoration: none;
+}
+
+.site-header .wp-block-navigation {
+	margin-bottom: 0;
+}
+
+.site-header .wp-block-social-links.alignright {
+	margin: 0 0 0 1em;
+	transform: translateY(-0.3rem);
+}
+
+@media screen and (min-width: 1290px) {
+	.site-header .wp-block-column,
+	.site-footer .wp-block-column {
+		padding-left: var(--wp--custom--margin--horizontal);
+		padding-right: var(--wp--custom--margin--horizontal);
+	}
+}
+
+/* Adjust heading letter spacing. */
+
+h1, h2, h3 {
+	letter-spacing: -0.015em;
+}
+
+/*
+ * Preserve image ratios.
+ * Needed until https://github.com/WordPress/gutenberg/pull/27518/ is merged.
+ */
+img {
+	height: auto;
+	max-width: 100%;
+}
+
+/* Post Meta */
+
+.post-meta a {
+	color: currentColor;
+}
+
+.post-meta .wp-block-post-author:before {
+	background: url(assets/svg/post-author.svg) no-repeat;
+}
+
+.post-meta .wp-block-post-date:before {
+	background: url(assets/svg/post-date.svg) no-repeat;
+}
+
+.post-meta .wp-block-post-hierarchical-terms:before {
+	background: url(assets/svg/post-category.svg) no-repeat;
+}
+
+.post-meta .wp-block-post-tags:before {
+	background: url(assets/svg/post-tag.svg) no-repeat;
+}

+ 1 - 73
mayland-blocks/style.css

@@ -5,7 +5,7 @@ Author: Automattic
 Author URI: https://automattic.com/
 Description: Make your online portfolio wonderfully uncluttered with Mayland. Gracefully highlight your photography and other projects. Mayland is versatile enough to be your personal site too.
 Requires at least: WordPress 4.9.6
-Version: 2.0
+Version: 2.0.0
 License: GNU General Public License v2 or later
 License URI: LICENSE
 Template: blank-canvas-blocks
@@ -15,75 +15,3 @@ Tags: one-column, custom-colors, custom-menu, custom-logo, editor-style, feature
 This theme, like WordPress, is licensed under the GPL.
 Use it to make something cool, have fun, and share what you've learned with others.
 */
-
-
-/* Smooth out the fonts. */
-
-body {
-	-webkit-font-smoothing: antialiased;
-	-moz-osx-font-smoothing: grayscale;
-}
-
-/* Adjust header spacing. */
-
-.site-header .wp-block-site-title a {
-	text-decoration: none;
-}
-
-.site-header .wp-block-navigation {
-	margin-bottom: 0;
-}
-
-.site-header .wp-block-social-links.alignright {
-	margin: 0 0 0 1em;
-	transform: translateY(-0.3rem);
-}
-
-@media screen and (min-width: 1290px) {
-	.site-header .wp-block-column,
-	.site-footer .wp-block-column {
-		padding-left: var(--wp--custom--margin--horizontal);
-		padding-right: var(--wp--custom--margin--horizontal);
-	}
-}
-
-/* Adjust heading letter spacing. */
-
-h1, h2, h3 {
-	letter-spacing: -0.015em;
-}
-
-/* 
- * Preserve image ratios.
- * Needed until https://github.com/WordPress/gutenberg/pull/27518/ is merged. 
- */
-img {
-	height: auto;
-	max-width: 100%;
-}
-
-/* Post Meta */
-
-.post-meta a {
-	color: currentColor;
-}
-
-.post-meta .wp-block-post-author:before {
-	background: url(assets/svg/post-author.svg) no-repeat;
-}
-
-.post-meta .wp-block-post-date:before {
-	background: url(assets/svg/post-date.svg) no-repeat;
-}
-
-.post-meta .wp-block-post-hierarchical-terms:before {
-	background: url(assets/svg/post-category.svg) no-repeat;
-}
-
-.post-meta .wp-block-post-tags:before {
-	background: url(assets/svg/post-tag.svg) no-repeat;
-}
-	
-.site-header > .wp-block-columns {
-	padding: 0 var(--wp--custom--margin--horizontal);
-}