viewStyle (Frontend Styling)
Block type frontend styles definition. They will be enqueued only when viewing the content on the front of the site.
Frontend-only styles are especially useful for interactive blocks, to style parts that will only be visible after a user performs some action and where those styles will never be needed in the editor. You can start with using the style
property to put all your common styles in one stylesheet. Only when you need editor-specific styling or frontend-specific styling, you can expand to editorStyle
and viewStyle
, but still keep the common part of your styling in the main stylesheet.
See WordPress Developer Resources: File structure of a block