Skip to content

Commit

Permalink
Add style to make a link cover a container
Browse files Browse the repository at this point in the history
* This only works properly if there is a single link. Needs some editor
CSS.
  • Loading branch information
Inwerpsel committed Apr 20, 2022
1 parent 1eac73c commit 5eed377
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
8 changes: 8 additions & 0 deletions admin/js/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,12 @@ wp.domReady(() => {
];

registerBlockStyle('core/button', styles);
const coreBlocks = ['core/media-text', 'core/group', 'core/column'];
coreBlocks.forEach(block => {
registerBlockStyle(block, {
name: 'expand-link',
label: 'Expand link',
});
});

});
14 changes: 14 additions & 0 deletions assets/src/styles/blocks.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,17 @@
// Other
@import "blocks/WideBlocks";
@import "blocks/Editor";

.is-style-expand-link {
position: relative;

a:after {
content: '';
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
background-color: rgba(210, 184, 14, 0.22);
}
}

0 comments on commit 5eed377

Please sign in to comment.