Skip to content

Commit

Permalink
Add support for backgrounds on heading blocks. See: WordPress/gutenbe…
Browse files Browse the repository at this point in the history
  • Loading branch information
justintadlock committed May 21, 2019
1 parent 7289a9d commit 107b459
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 4 deletions.
2 changes: 1 addition & 1 deletion public/css/editor.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/css/screen.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions public/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"/js/app.js": "/js/app.js?id=20aa78c3a44b56123fde",
"/css/screen.css": "/css/screen.css?id=5caaaf91bd55108761ed",
"/css/screen.css": "/css/screen.css?id=7de03705a2993b04e9d3",
"/css/screen-classic.css": "/css/screen-classic.css?id=3128a96645df6e81d928",
"/css/editor.css": "/css/editor.css?id=0fffffbcc1f726cd88cc",
"/css/editor.css": "/css/editor.css?id=6ee6fe23cdcb32a3e391",
"/css/customize-controls.css": "/css/customize-controls.css?id=c1ec7bf0f3429f0596ed",
"/js/customize-controls.js": "/js/customize-controls.js?id=1fd2d6fe20d98f7338c5",
"/js/customize-preview.js": "/js/customize-preview.js?id=8eb220d6312c648959ce",
Expand Down
1 change: 1 addition & 0 deletions resources/scss/blocks/__index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
@import 'core/file';
@import 'core/gallery';
@import 'core/group';
@import 'core/heading';
@import 'core/image';
@import 'core/latest-comments';
@import 'core/latest-posts';
Expand Down
11 changes: 11 additions & 0 deletions resources/scss/blocks/core/_heading.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

h1,
h2,
h3,
h4,
h5,
h6 {
&.has-background {
padding: $spacing-global;
}
}
14 changes: 14 additions & 0 deletions resources/scss/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,20 @@
}
}

// Bump out width via negative margins for heading block.

h1,
h2,
h3,
h4,
h5,
h6 {
&.has-background {
margin-left: -#{ $spacing-global };
margin-right: -#{ $spacing-global };
}
}

// Class is used in the editor but not the front end.
// Copied from `/elements/_quotes.scsss` and `/blocks/core/_pullquote.scss`.

Expand Down

0 comments on commit 107b459

Please sign in to comment.