String () { boolean isDarcula = UIUtil.isUnderDarcula(); Style style = isDarcula ? Style.DARCULA : Style.DEFAULT; String cssCodeToInject = ourLoadedStylesCache.getOrDefault(style, null); if (cssCodeToInject != null) return cssCodeToInject; try { cssCodeToInject = Resources.toString(RestJcefHtmlPanel.class.getResource(style.getCss()), StandardCharsets.UTF_8); } catch (IOException e) { throw new RuntimeException("Failed to load " + style.getCss() + ".", e); } cssCodeToInject = "<style>" + cssCodeToInject + "</style>"; ourLoadedStylesCache.put(style, cssCodeToInject); return cssCodeToInject; }