CSS Theme tokens: Local workbench should support the default theme and the __themeState___ object
Category
- [ ] Question
- [ ] Typo
- [x] Bug
- [ ] Additional article idea
Expected or Desired Behavior
When I create a web part in the workbench I like to use the theme tokens without specifying the default color. Instead this definition.
.row {
background-color: "[theme:themePrimary, default:#0078d7]";
}
It should be only required to use:
.row {
background-color: "[theme:themePrimary]";
}
Observed Behavior
The second variant works perfectly in the Workbench on Office 365 but not in a local workbenchen because not theme is loaded by default. The local workbench should at least include the default Office UI Fabric theme. The themeState_ object doesn't currently load a theme in the local workbench.

On the Office 365 Workbench the theme is loaded:

Steps to Reproduce
Create a default web part and define in the css of the web part the .row element the following way.
.row {
background-color: "[theme:themePrimary]";
}
This will lead to the following results in the local workbench:

The exact same web part in the online workbench will be shown like this. Depending on the theme that has been applied to the site.

Dupe of #716 ?
@andrewconnell Nope. It is an offical co-production by @waldekmastykarz and me. While Waldeks issue is on fixing the default web part and guidance around the css tokens, I'm the blogger and responsible for the practical tips dealing with css tokens. ;)
This addresses the bug that no default them is loaded on local workbench, which should be loaded to avoid defaults as fallback.
On Office 365 sites when no theme or default theme is applied this mechanism doesn't work at all without default values. Shouldn't then the at least the default values of Office UI Fabric be returned.
We closed this issue as it had not activity within last 180 days. This is a generic process we have decided to perform for issues, which have not been explicitly marked still to be "work in progress" based on tags. We are performing this cleaning to make sure that old issues that have already been solved (but not closed) or are no longer relevant are cleaned out and make the issues more manageable. If this issue still valid, we would ask you to open a new issue and follow the guidance in the issue template related on the recommended location. We do apologize any inconveniences this might cause. Please do remember that issues in the issue lists are also messages for others in the community, so you can also check if you can assist on any of them. “Sharing is caring!”
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues