Vscode-mssql: Results pane theme does not update

Created on 22 Apr 2017  路  4Comments  路  Source: microsoft/vscode-mssql

Steps to Reproduce:

  1. F1 -> "Preferences: Color Theme" -> "Light (Visual Studio)"
  2. Open a .sql file and run a query
  3. Wait for the results pane to open
  4. F1 -> "Preferences: Color Theme" -> "Dark (Visual Studio)"

Expected:
image

Actual:
image

backlog bug

All 4 comments

I was working on a solution to this awhile ago, https://github.com/Microsoft/vscode-mssql/tree/feature/websocketHookForStyleChanges . The problem is I didn't like how I was doing the dynamic css changes, so I didn't continue. The proper way would probably be to use angular dynamic classes and load both themes on load, which would require a css structure change.

Looking at the vscode source, it looks like it does theme changing by defining classes for each major theme type (vs-dark and vs). E.g.:

.vs-dark .mainColor {
  backgroundColor: #000;
}

.vs .mainColor {
  backgroundColor: #FFF;
}

Then on theme change, the root element changes theme (e.g. from vs to vs-dark) which causes all children with the mainColor class to update from #000 to #FFF automatically. I think this is what you are suggesting, but I'm not 100% sure.

Obviously dealing with the Angular theme change is slightly different because it's sandboxed from the rest of vscode, but a similar approach could be taken. Regardless, as you said the CSS structure would need to be updated.

@coquagli Yes this is what I was suggesting, and then using angular dynamic classes (one way bind of the class of the entire page) then have the websocket just change the variable that the class is bound to.

@anthonydresser Cool. I think that is a good solution.

Was this page helpful?
0 / 5 - 0 ratings