• I’m developing a hybrid theme and the site has a sticky header. I’ve set styles.spacing.padding top to be the height of my site header so that content in the first block is pushed down below it. I also have some inline padding.

    "styles": {
    		"spacing": {
    			"padding": {
    				"top": "calc(var(--header-height) + 2rem)",
    				"bottom": "2rem",
    				"left": "2rem",
    				"right": "2rem"
    			}
    		}
    	}

    I have useRootPaddingAwareAlignments turned on so that inline padding is applied at block level and full-width elements span the viewport. I was hoping that this setting would also affect vertical padding so that the first block in a page would get its own top padding, plus the root top padding. This would allow the block’s background image/colour to appear behind the floating site header. However, that doesn’t seem to be the case.

    Is there something else I need to do to get this working, or does WordPress simply not handle vertical padding in this way?

  • The topic ‘useRootPaddingAwareAlignments and top and bottom padding’ is closed to new replies.