Skip to content

Instantly share code, notes, and snippets.

@jettero
Last active December 7, 2019 17:37
Show Gist options
  • Save jettero/64e92d11628c137c57f782059634c498 to your computer and use it in GitHub Desktop.
Save jettero/64e92d11628c137c57f782059634c498 to your computer and use it in GitHub Desktop.
attempt to make tensorboard graph svg text redable when using a minimum-font-size in firefox
/* intended to be used with stylus (user-css add-on) or similar
** no copyright intended
**
** Basically the problem is that I use a minimum font size in firefox to ensure
** sites can't set fonts smaller than I can read. Zooming the sites is not an
** acceptable option because it also jacks up the layout. minimum font size
** works nearly everywhere except for single edge cases like tensorboard's SVG
** text ... and I can't think of a single other example at the moment.
**
** update:
**
** There's nolonger any way to fix the stupid font layouts in tensorboard graph
** svg; at some point (prolly near tensorflow 2.0), tensorboard seems to be
** dropping every child element in a Shadow DOM (e.g., :host, ::part,
** #shadow-root, etc) short of using "* { font-size-adjust: 0.2; }" You'll never
** get this to work.
**
*/
@-moz-document regexp("https?://.*:6006/#graphs.*") {
/* old thing that used to work */
/* .tf-graph-scene { font-size-adjust: 0.2; } */
/* should probabl be something like this now (doesn't seem to work now though) */
/* tf-graph-scene::part(svg) { font-size-adjust: 0.2; } */
/* tf-graph-scene#scene { font-size-adjust: 0.2; } */
/* make literally everything too small except the graph text (sigh) */
* { font-size-adjust: 0.2; }
/* if you know how to apply font-size-adjust to just the svg text, please
* let me know. */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment