Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Style elements in stylesheet do not get applied

See original GitHub issue

I am trying to apply a custom style to Jupyter QtConsole, and am finding that I can influence the style using one of Pygments’ builtin styles(jupyter qtconsole --style=native), and I can influence the Qt and prompts (.in-prompt, etc.) using a stylesheet, but I cannot influence the syntax style using a stylesheet. In particular, I have a file I obtained by doing pygmentize -S native -f html > native.css, but then when I try jupyter qtconsole --stylesheet=native.css, nothing happens to the style. It also appears to not work when specified in c.JupyterQtConsoleApp.stylesheet in the config file (the Qt parts change, but the style parts don’t). When I put it into c.JupyterWidget.style_sheet in the config, it actually makes qtconsole crash. I can’t tell from the documentation why this doesn’t work … the config notes near the latter seem to indicate that all should be just fine.

I am trying to use some custom styles I like, and I must do it by config or by command line - I have no control over the installation so I cannot put a new style into Pygments’ folder in site-packages.

The systems I actually work on are all offline, but it also appears not to work in the developer version I’m testing with from the most recent code, it says 4.5.0.dev0. Python 3.7.3, pyqt 5.9.2.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

daegontavencommented, Jul 17, 2019

@dalthviz My use case is specifically to set syntax style from RichJupyterWidget in another application.

jupyter_widget = RichJupyterWidget()
jupyter_widget.style_sheet = get_theme_contents(
)  # Custom method that grabs a stylesheet css file
jupyter_widget.syntax_style = "dracula"

The above works in so far as I register a pygments plugin in advance. It does not work if i try to set a pygments Style class for jupyter_widget.syntax_style since it only accepts strings as seen here:

There is no way to set it from RichJupyterWidget. That would be a nice feature and I assume it would also solve the issue @Jeitan is facing.

Jeitancommented, May 7, 2019

@dalthviz Thanks for the explanation! I perused the PRs you mentioned, and now I can kind of see how things ended up. If I have some free time at some point I might try to see if I can get some sort of local style input working … maybe by looking at what Spyder does.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is my CSS style not being applied? - Stack Overflow
I went to solution explorer (press Ctrl+Alt+L) and searched gt.css (enter your css filename). Right click on your css filename and then on ......
Read more >
Style Sheets in HTML documents - W3C
Documents that include elements that set the style attribute but which don't define a default style sheet language are incorrect. Authoring tools should ......
Read more >
How To Apply CSS Styles to HTML with Cascade and Specificity
Using the HTML Style Attribute. In this first step, you will apply styles to an HTML element directly with the style attribute. This...
Read more >
How to Troubleshoot CSS Not Working - WPForms
Have you added custom CSS for your forms, but not been able to see it come through? Here's how to troubleshoot when your...
Read more >
The Style Information element - HTML - MDN Web Docs
The <style> HTML element contains style information for a document, or part of a document. It contains CSS, which is applied to the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found