There may be styles which are only visible on certain templates. It would be misleading to present controls for styles for which there is no corresponding element in the preview. For Widget Customizer, it turned out to be pretty easy to dynamically hide customizer sections (and controls) based on whether or not a sidebar was rendered in the current preview, and then upon each page load within the preview iframe, to update which sections should be displayed.
For how this was implemented in Widget Customizer, see xwp/wp-widget-customizer#2
Relates to #21
Relates to xwp/wp-widget-customizer#5
There may be styles which are only visible on certain templates. It would be misleading to present controls for styles for which there is no corresponding element in the preview. For Widget Customizer, it turned out to be pretty easy to dynamically hide customizer sections (and controls) based on whether or not a sidebar was rendered in the current preview, and then upon each page load within the preview iframe, to update which sections should be displayed.
For how this was implemented in Widget Customizer, see xwp/wp-widget-customizer#2
Relates to #21
Relates to xwp/wp-widget-customizer#5