desktop.js
5 years ago
main.js
5 years ago
mobile.js
5 years ago
tablet-only.js
5 years ago
tablet.js
5 years ago
desktop.js
38 lines
| 1 | /* eslint-disable quotes */ |
| 2 | import buildCSS from '../../../utils/build-css'; |
| 3 | |
| 4 | import { |
| 5 | Component, |
| 6 | } from '@wordpress/element'; |
| 7 | |
| 8 | import { |
| 9 | applyFilters, |
| 10 | } from '@wordpress/hooks'; |
| 11 | |
| 12 | export default class DesktopCSS extends Component { |
| 13 | render() { |
| 14 | const attributes = applyFilters( 'generateblocks.editor.cssAttrs', this.props.attributes, this.props ); |
| 15 | |
| 16 | const { |
| 17 | clientId, |
| 18 | } = this.props; |
| 19 | |
| 20 | const { |
| 21 | removeVerticalGap, |
| 22 | } = attributes; |
| 23 | |
| 24 | let cssObj = []; |
| 25 | |
| 26 | cssObj[ '.block-editor-block-list__layout > #block-' + clientId ] = [ { |
| 27 | 'margin-bottom': removeVerticalGap ? '0px !important' : false, |
| 28 | } ]; |
| 29 | |
| 30 | cssObj = applyFilters( 'generateblocks.editor.desktopCSS', cssObj, this.props, 'container' ); |
| 31 | |
| 32 | return ( |
| 33 | <style>{ buildCSS( cssObj ) }</style> |
| 34 | ); |
| 35 | } |
| 36 | } |
| 37 | /* eslint-enable quotes */ |
| 38 |