Skip to content

Commit

Permalink
feat: 🎨 Add block styles for RSS block (list and home page block) Fixes
Browse files Browse the repository at this point in the history
#135 (#143)

Pulled down. Built. Works!
  • Loading branch information
knice authored Sep 29, 2022
1 parent d59e7ef commit de1809d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
14 changes: 13 additions & 1 deletion wp-blocks/rss.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,26 @@
margin-bottom: var(--wp--custom--spacing--medium);
}

.is-style-ucsc-rss-list .wp-block-rss__item {
margin-bottom: var(--wp--custom--spacing--small);
}

.wp-block-rss__item-title {
font-size: var(--wp--preset--font-size--medium);
font-weight: 400;
margin-bottom: var(--wp--custom--spacing--small);
margin-bottom: 0.5em;
line-height: var(--wp--custom--line-height--small);
order: 1;
}

.is-style-ucsc-rss-list .wp-block-rss__item-title {
font-size: var(--wp--preset--font-size--base);
}

.is-style-ucsc-rss-block .wp-block-rss__item-title {
font-size: var(--wp--preset--font-size--medium);
}

.wp-block-rss__item-title a {
text-decoration: none;
color: var(--wp--custom--color--link);
Expand Down
13 changes: 13 additions & 0 deletions wp-blocks/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,17 @@ wp.domReady(() => {
// Styles for core/image
wp.blocks.unregisterBlockStyle('core/image', 'default');
wp.blocks.unregisterBlockStyle('core/image', 'rounded');

// Styles for core/rss
wp.blocks.registerBlockStyle('core/rss', {
name: 'ucsc-rss-block',
label: 'Home Block',
style_handle: 'ucsc-rss',
});
wp.blocks.registerBlockStyle('core/rss', {
name: 'ucsc-rss-list',
label: 'Simple List',
isDefault: true,
style_handle: 'ucsc-rss',
});
});

0 comments on commit de1809d

Please sign in to comment.