Skip to content

Commit

Permalink
Header/Footer: Modularize CSS files and process with PostCSS. (#6)
Browse files Browse the repository at this point in the history
The contents will soon become too much to keep in a single file, and it's easier to separate while it's still small. PostCSS has most of the features of SASS, but is more future-proof.
  • Loading branch information
iandunn authored Sep 21, 2021
1 parent d71a442 commit 17f51fc
Show file tree
Hide file tree
Showing 10 changed files with 3,532 additions and 27 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Production-only files
README-svn.txt
build
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# wporg-mu-plugins

Over time, this is intended to become the canonical source repository all `mu-plugins` on the WordPress.org network. At the moment, it only includes a few.
Over time, this is intended to become the canonical source repository for all `mu-plugins` on the WordPress.org network. At the moment, it only includes a few.

## Usage

Expand All @@ -16,6 +16,13 @@ Over time, this is intended to become the canonical source repository all `mu-pl
```
1. See individual plugin readmes for specific instructions


## Development

* `npm run start` during development
* `npm run build` before commit/sync/deploy


## Sync/Deploy

The files here are commited to `dotorg.svn` so they can be deployed. The aren't synced to `meta.svn`, since they're already open.
Expand Down
4 changes: 2 additions & 2 deletions mu-plugins/blocks/global-header-footer/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
function register_block_types() {
wp_register_style(
'wporg-global-header-footer',
plugins_url( '/style.css', __FILE__ ),
plugins_url( '/build/style.css', __FILE__ ),
array( 'wp-block-library' ), // Load `block-library` styles first, so that our styles override them.
filemtime( __DIR__ . '/style.css' )
filemtime( __DIR__ . '/build/style.css' )
);

register_block_type(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
* https://github.com/WordPress/wporg-news-2021/issues/13 isn't done yet.
*/


/*
* Common
*/
.wp-block-group.site-header,
.wp-block-group.site-footer,
.wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open {
Expand All @@ -18,23 +14,3 @@
.wp-block-navigation.is-responsive .wp-block-navigation-link__content {
color: var(--wp--preset--color--white);
}


/*
* Header
*/
.wp-block-group.site-header {
padding: 37px 30px 37px 24px;
}


/*
* Footer
*/
.wp-block-group.site-footer {
padding: 69px 80px 61px 80px;
}

.wp-block-group.site-footer .wp-block-social-links .wp-social-link svg {
fill: var(--wp--preset--color--white);
}
7 changes: 7 additions & 0 deletions mu-plugins/blocks/global-header-footer/postcss/footer.pcss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.wp-block-group.site-footer {
padding: 69px 80px 61px 80px;
}

.wp-block-group.site-footer .wp-block-social-links .wp-social-link svg {
fill: var(--wp--preset--color--white);
}
3 changes: 3 additions & 0 deletions mu-plugins/blocks/global-header-footer/postcss/header.pcss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.wp-block-group.site-header {
padding: 37px 30px 37px 24px;
}
3 changes: 3 additions & 0 deletions mu-plugins/blocks/global-header-footer/postcss/style.pcss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@import "common.pcss";
@import "header.pcss";
@import "footer.pcss";
Loading

0 comments on commit 17f51fc

Please sign in to comment.