Skip to content

Possibility to set margin and padding and to use all CSS dimension value types #1

Description

@porg

Inspector Options of the Sticky Block (as of v1.11)

  1. Space between sticky block and top of screen: <num-field>
  2. ☑︎ Move the block down a little bit if there is a toolbar at the top (for logged in users)
  3. Block should not be sticky on screens smaller than: <num-field> (default 0)
  4. Block should not be sticky on screens wider than: <num-field> (default 99999)
  5. Pushup Element: <text field> to be filled with an ID or class name

Improvements & Additions here

Ad 1: Should be a text field and accept any CSS value, also e.g. var(--wp--preset--spacing--30)

Ad 3+4: Combine this more elegantly into one label + two num-fields:

Block is sticky on viewport-widths between
Min: [ 0    ]  Max: [ 99999 ]

6: Please add spacing options:

  • Minimally at least margin-bottom, which is the space between the sticky block and the pushup element, the conceptual counterpart to “Space between sticky block and top of screen”.
  • Ideally the same dimension control as the native blocks (slider for the theme.json fluid sizes which can altenratively also be set to any other CSS dimension (px, pc, em, rem, vh, vw) ).

Workarounds

Are possible luckily (but not elegant though):

  1. Set the spacing on the wrapped block. But not all those blocks have adequate spacing settings themselves! E.g. the Gutenslider block has margin-top-bottom combined (not margin-bottom alone).
  2. Deep nesting like: Sticky block (without spacing options) → Group block (with your spacing as desired) → Certain content block (incapable of spacing).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions