• PaulH

    (@paulhuckstepp)


    I’m creating a custom block using the Pods Block API and I’ve got everything working how I want it. However, I’m unsure how to assign styles to the block when editing in the editor and also on the frontend.

    I’ve previously used ACF and Carbon Fields, both of which have options in the block definitions to assign stylesheets to use for the editor and frontend.

    I cannot find anything in the docs for Pods that tell me how to do that. Can you help?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Scott Kingsley Clark

    (@sc0ttkclark)

    I’ll take a look at this today. I thought there was something here already but maybe not documented.

    Thread Starter PaulH

    (@paulhuckstepp)

    Also, is it possible to add in support for the alignment attributes, and the style and typography attributes that come with core blocks (e.g. Text and Background colours, margins, fonts, etc), or do these have to be set up as Pod fields instead?

    Plugin Contributor Scott Kingsley Clark

    (@sc0ttkclark)

    Sorry I wasn’t able to follow up on this yet. This is still on my list.

    Thread Starter PaulH

    (@paulhuckstepp)

    I’ve found that adding ‘enqueue_style’ to the block json sorts out the styles on the frontend. However, the ‘editor_style’ entry (or the ‘style’) doesn’t add the styles for the admin side. I can see it in the block array details in the HTML source whilst editing the page, but it doesn’t get loaded.

    I tried with and without the full URL to the CSS file but can’t get it to work.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.