Plone 6.0 switching themes upon "view"

Lately, we migrated a portal from Plone 5.3 to 6.0. We only made small adjustments to the backend and frontend code, no major breaking changes involved.

We have the strange behavior that a Manager can work properly inside Plone, has access to the toolbar, the edit forms look fine. However, the "view" view of the content is being displayed in the context of our public theme with a deconstructed toolbar or invisible toolbar. There is no theme switcher involved in the backend code...I am currently clueless...any ideas?

Looks like you have some missbehaving diazo rules in your theme ... here's the default Barceloneta rules for Plone 6 plonetheme.barceloneta/plonetheme/barceloneta/theme/rules.xml at master · plone/plonetheme.barceloneta · GitHub ... maybe it helps to solve your problem.

it seems you're using backend.xml in your theme. When in view, seems it cannot load the barceloneta css. Did you set portal_url = portal_state/portal_url in theme parameters?

Plone 5 and 6 has different css classes (etc) for the toolbar. So if you use a Plone 5 theme, it will look 'ok', but not for the toolbar, control panel etc. If you add 'backend.xml' to your theme, the 'correct CSS' will load for 'backend'. If you remove 'backend.xml' from your diazo rules, you would 'miss' the styling of toolbar (etc) for 'everybody.

The solution is to include the scss-parts for 'these things' in your theme, at least: @import "@plone/plonetheme-barceloneta-base/scss/toolbar";

I am not sure if this is 'misbehaving'. I have this 'on purpose' when making a minimal theme (that does not look like Plone). Basically, it works like this: 1) I keep the diazo rules, remove stuff from theme.scss, add my own css, add collective.toolbar, add backend.xml. Seems to work great (so far)