Created
April 15, 2020 17:22
-
-
Save markhowellsmead/f33af4bf4a5689c2aec6b24bee58a097 to your computer and use it in GitHub Desktop.
Gutenberg: Group: custom styling
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.wp-block-group { | |
margin-top: 0; | |
margin-bottom: 0; | |
&.is-style-padding { | |
.wp-block-group__inner-container { | |
padding-top: var(--unit); | |
padding-bottom: var(--unit); | |
} | |
} | |
&.is-style-padding--medium { | |
.wp-block-group__inner-container { | |
padding-top: var(--unit-medium); | |
padding-bottom: var(--unit-medium); | |
} | |
} | |
&.is-style-padding--large { | |
.wp-block-group__inner-container { | |
padding-top: var(--unit-large); | |
padding-bottom: var(--unit-large); | |
} | |
} | |
&.is-style-padding--xlarge { | |
.wp-block-group__inner-container { | |
padding-top: var(--unit-xlarge); | |
padding-bottom: var(--unit-xlarge); | |
} | |
} | |
.wp-block-columns { | |
margin: 0 auto; | |
max-width: var(--constraint-narrow); | |
&.alignwide { | |
max-width: var(--constraint-wide); | |
} | |
&.alignfull { | |
max-width: 100%; | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import domReady from '@wordpress/dom-ready'; | |
domReady(() => { | |
wp.blocks.registerBlockStyle("core/group", { | |
name: "padding", | |
label: "Vertical padding", | |
}); | |
wp.blocks.registerBlockStyle("core/group", { | |
name: "padding--medium", | |
label: "Vertical padding (medium)", | |
}); | |
wp.blocks.registerBlockStyle("core/group", { | |
name: "padding--large", | |
label: "Vertical padding (large)", | |
}); | |
wp.blocks.registerBlockStyle("core/group", { | |
name: "padding--xlarge", | |
label: "Vertical padding (xlarge)", | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment