PluginProbe ʕ •ᴥ•ʔ
GenerateBlocks / 1.4.0
GenerateBlocks v1.4.0
trunk 1.0 1.0.1 1.0.2 1.1.0 1.1.1 1.1.2 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.7.0 1.7.1 1.7.2 1.7.3 1.8.0 1.8.1 1.8.2 1.8.3 1.9.0 1.9.1 2.0.0 2.0.1 2.0.2 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.3.0
generateblocks / src / blocks / button-container / css / tablet.js
generateblocks / src / blocks / button-container / css Last commit date
desktop.js 4 years ago main.js 4 years ago mobile.js 4 years ago tablet-only.js 4 years ago tablet.js 4 years ago
tablet.js
48 lines
1 import buildCSS from '../../../utils/build-css';
2 import valueWithUnit from '../../../utils/value-with-unit';
3 import flexboxAlignment from '../../../utils/flexbox-alignment';
4
5 import {
6 Component,
7 } from '@wordpress/element';
8
9 import {
10 applyFilters,
11 } from '@wordpress/hooks';
12
13 export default class TabletCSS extends Component {
14 render() {
15 const attributes = applyFilters( 'generateblocks.editor.cssAttrs', this.props.attributes, this.props );
16
17 const {
18 uniqueId,
19 alignmentTablet,
20 marginTopTablet,
21 marginRightTablet,
22 marginBottomTablet,
23 marginLeftTablet,
24 marginUnit,
25 } = attributes;
26
27 let cssObj = [];
28
29 cssObj[ '.gb-button-wrapper-' + uniqueId ] = [ {
30 'margin-top': valueWithUnit( marginTopTablet, marginUnit ),
31 'margin-right': valueWithUnit( marginRightTablet, marginUnit ),
32 'margin-bottom': valueWithUnit( marginBottomTablet, marginUnit ),
33 'margin-left': valueWithUnit( marginLeftTablet, marginUnit ),
34 'justify-content': flexboxAlignment( alignmentTablet ),
35 } ];
36
37 cssObj[ '.gb-button-wrapper-' + uniqueId + ' > .block-editor-inner-blocks > .block-editor-block-list__layout' ] = [ {
38 'justify-content': flexboxAlignment( alignmentTablet ),
39 } ];
40
41 cssObj = applyFilters( 'generateblocks.editor.tabletCSS', cssObj, this.props, 'button-container' );
42
43 return (
44 <style>{ buildCSS( cssObj ) }</style>
45 );
46 }
47 }
48