Skip to content

Commit

Permalink
Issue #9 - Use common logic in libs\oik-blocks.php for CSS and GeSHi …
Browse files Browse the repository at this point in the history
…block registration
  • Loading branch information
bobbingwide committed Dec 14, 2019
1 parent 2326679 commit d8b2992
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 489 deletions.
8 changes: 7 additions & 1 deletion blocks/oik-css/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Implements CSS block
*
* Uses [bw_css] shortcode from oik-css plugin
* Uses the logic for the [bw_css] shortcode
*
* @copyright (C) Copyright Bobbing Wide 2018, 2019
* @author Herb Miller @bobbingwide
Expand Down Expand Up @@ -88,6 +88,12 @@ export default registerBlockType(
},

},
example: {
attributes: {
css: 'div.bw_css { color: red;}',
text: __( 'This sentence will be red.' ),
},
},

supports: {
customClassName: false,
Expand Down
5 changes: 3 additions & 2 deletions blocks/oik-geshi/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @copyright (C) Copyright Bobbing Wide 2018,2019
* @author Herb Miller @bobbingwide
*/
//import './style.scss';
import './style.scss';
//import './editor.scss';

// Get just the __() localization function from wp.i18n
Expand Down Expand Up @@ -94,7 +94,8 @@ export default registerBlockType(
example: {
attributes: {
lang: 'php',
content: __( 'echo "Code is poetry."' ),
text: 'WordPress motto',
content: __( 'echo "Code is Poetry."' ),
},
},

Expand Down
10 changes: 10 additions & 0 deletions blocks/oik-geshi/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* oik-geshi/style.scss
*/
div.bw_geshi {
background-color: #f8f8f8;
}
.bw_geshi code {
display: block;
margin-top: 10px;
border-top: 1px solid grey;
}
Loading

0 comments on commit d8b2992

Please sign in to comment.