From 8a9c2c86ef4033bc7bc38ab2f508942476a7f92b Mon Sep 17 00:00:00 2001 From: dFayet Date: Thu, 4 Apr 2019 09:40:26 +0200 Subject: [PATCH] [Profiler] Fix dark theme elements color --- .../Twig/DataCollector/TwigDataCollector.php | 2 + .../Resources/views/Exception/trace.html.twig | 8 +-- .../Resources/views/exception.css.twig | 49 +++++++++++-------- .../views/Collector/exception.css.twig | 6 +-- .../Resources/views/Collector/form.html.twig | 29 ++++++++--- .../views/Collector/messenger.html.twig | 7 ++- .../views/Collector/validator.html.twig | 7 ++- .../views/Profiler/profiler.css.twig | 46 ++++++++++++----- 8 files changed, 105 insertions(+), 49 deletions(-) diff --git a/src/Symfony/Bridge/Twig/DataCollector/TwigDataCollector.php b/src/Symfony/Bridge/Twig/DataCollector/TwigDataCollector.php index 800d86c20ef0..b7d059daea7c 100644 --- a/src/Symfony/Bridge/Twig/DataCollector/TwigDataCollector.php +++ b/src/Symfony/Bridge/Twig/DataCollector/TwigDataCollector.php @@ -127,10 +127,12 @@ public function getHtmlCallGraph() '', '', '', + '', ], [ '', '', '', + '', ], $dump); return new Markup($dump, 'UTF-8'); diff --git a/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/trace.html.twig b/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/trace.html.twig index 65306f2fd9c4..ffb24bde9ae3 100644 --- a/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/trace.html.twig +++ b/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/trace.html.twig @@ -25,10 +25,10 @@ {% if trace.file|default(false) %}
{{ trace.file|file_excerpt(trace.line, 5)|replace({ - '#DD0000': '#183691', - '#007700': '#a71d5d', - '#0000BB': '#222222', - '#FF8000': '#969896' + '#DD0000': 'var(--highlight-string)', + '#007700': 'var(--highlight-keyword)', + '#0000BB': 'var(--highlight-default)', + '#FF8000': 'var(--highlight-comment)' })|raw }}
{% endif %} diff --git a/src/Symfony/Bundle/TwigBundle/Resources/views/exception.css.twig b/src/Symfony/Bundle/TwigBundle/Resources/views/exception.css.twig index 6bdfb8839c9a..8c1f9af2a0d1 100644 --- a/src/Symfony/Bundle/TwigBundle/Resources/views/exception.css.twig +++ b/src/Symfony/Bundle/TwigBundle/Resources/views/exception.css.twig @@ -23,8 +23,15 @@ --table-border: #e0e0e0; --table-background: #fff; --table-header: #e0e0e0; + --tree-active-background: #F7E5A1; + --exception-title-color: var(--base-2); --shadow: 0px 0px 1px rgba(128, 128, 128, .2); --border: 1px solid #e0e0e0; + --background-error: var(--color-error); + --highlight-comment: #969896; + --highlight-default: #222222; + --highlight-keyword: #a71d5d; + --highlight-string: #183691; --base-0: #fff; --base-1: #f5f5f5; --base-2: #e0e0e0; @@ -40,7 +47,7 @@ html { /* always display the vertical scrollbar to avoid jumps when toggling contents */ overflow-y: scroll; } -body { background-color: #F9F9F9; color: #222; font: 14px/1.4 Helvetica, Arial, sans-serif; padding-bottom: 45px; } +body { background-color: #F9F9F9; color: var(--base-6); font: 14px/1.4 Helvetica, Arial, sans-serif; padding-bottom: 45px; } a { cursor: pointer; text-decoration: none; } a:hover { text-decoration: underline; } @@ -49,9 +56,9 @@ abbr[title] { border-bottom: none; cursor: help; text-decoration: none; } code, pre { font: 13px/1.5 Consolas, Monaco, Menlo, "Ubuntu Mono", "Liberation Mono", monospace; } table, tr, th, td { background: #FFF; border-collapse: collapse; vertical-align: top; } -table { background: #FFF; border: 1px solid #E0E0E0; box-shadow: 0px 0px 1px rgba(128, 128, 128, .2); margin: 1em 0; width: 100%; } -table th, table td { border: solid #E0E0E0; border-width: 1px 0; padding: 8px 10px; } -table th { background-color: #E0E0E0; font-weight: bold; text-align: left; } +table { background: #FFF; border: var(--border); box-shadow: 0px 0px 1px rgba(128, 128, 128, .2); margin: 1em 0; width: 100%; } +table th, table td { border: solid var(--base-2); border-width: 1px 0; padding: 8px 10px; } +table th { background-color: var(--base-2); font-weight: bold; text-align: left; } .m-t-5 { margin-top: 5px; } .hidden-xs-down { display: none; } @@ -65,7 +72,7 @@ table th { background-color: #E0E0E0; font-weight: bold; text-align: left; } .text-small { font-size: 12px !important; } .text-muted { color: #999; } .text-bold { font-weight: bold; } -.empty { border: 4px dashed #E0E0E0; color: #999; margin: 1em 0; padding: .5em 2em; } +.empty { border: 4px dashed var(--base-2); color: #999; margin: 1em 0; padding: .5em 2em; } .status-success { background: rgba(94, 151, 110, 0.3); } .status-warning { background: rgba(240, 181, 24, 0.3); } @@ -73,7 +80,7 @@ table th { background-color: #E0E0E0; font-weight: bold; text-align: left; } .status-success td, .status-warning td, .status-error td { background: transparent; } tr.status-error td, tr.status-warning td { border-bottom: 1px solid #FAFAFA; border-top: 1px solid #FAFAFA; } .status-warning .colored { color: #A46A1F; } -.status-error .colored { color: #B0413E; } +.status-error .colored { color: var(--color-error); } .sf-toggle { cursor: pointer; } .sf-toggle-content { -moz-transition: display .25s ease; -webkit-transition: display .25s ease; transition: display .25s ease; } @@ -91,7 +98,7 @@ thead.sf-toggle-content.sf-toggle-visible, tbody.sf-toggle-content.sf-toggle-vis .tab-navigation li.active .badge { background-color: var(--base-5); color: var(--base-2); } .tab-content > *:first-child { margin-top: 0; } .tab-navigation li .badge.status-warning { background: var(--color-warning); color: #FFF; } -.tab-navigation li .badge.status-error { background: var(--color-error); color: #FFF; } +.tab-navigation li .badge.status-error { background: var(--background-error); color: #FFF; } .sf-tabs .tab:not(:first-child) { display: none; } [data-filters] { position: relative; } @@ -131,7 +138,7 @@ thead.sf-toggle-content.sf-toggle-visible, tbody.sf-toggle-content.sf-toggle-vis .container { max-width: 1024px; margin: 0 auto; padding: 0 15px; } .container::after { content: ""; display: table; clear: both; } -header { background-color: #222; color: rgba(255, 255, 255, 0.75); font-size: 13px; height: 33px; line-height: 33px; padding: 0; } +header { background-color: var(--base-6); color: rgba(255, 255, 255, 0.75); font-size: 13px; height: 33px; line-height: 33px; padding: 0; } header .container { display: flex; justify-content: space-between; } .logo { flex: 1; font-size: 13px; font-weight: normal; margin: 0; padding: 0; } .logo svg { height: 18px; width: 18px; opacity: .8; vertical-align: -5px; } @@ -142,7 +149,7 @@ header .container { display: flex; justify-content: space-between; } .help-link a:hover { color: #EEE; text-decoration: none; } .help-link a:hover svg { opacity: .9; } -.exception-summary { background: #B0413E; border-bottom: 2px solid rgba(0, 0, 0, 0.1); border-top: 1px solid rgba(0, 0, 0, .3); flex: 0 0 auto; margin-bottom: 15px; } +.exception-summary { background: var(--background-error); border-bottom: 2px solid rgba(0, 0, 0, 0.1); border-top: 1px solid rgba(0, 0, 0, .3); flex: 0 0 auto; margin-bottom: 15px; } .exception-metadata { background: rgba(0, 0, 0, 0.1); padding: 7px 0; } .exception-metadata .container { display: flex; flex-direction: row; justify-content: space-between; } .exception-metadata h2, .exception-metadata h2 > a { color: rgba(255, 255, 255, 0.8); font-size: 13px; font-weight: 400; margin: 0; } @@ -162,36 +169,36 @@ header .container { display: flex; justify-content: space-between; } .exception-illustration { flex-basis: 111px; flex-shrink: 0; height: 66px; margin-left: 15px; opacity: .7; } .trace + .trace { margin-top: 30px; } -.trace-head { background-color: #e0e0e0; padding: 10px; position: relative; } -.trace-head .trace-class { color: #222; font-size: 18px; font-weight: bold; line-height: 1.3; margin: 0; position: relative; } +.trace-head { background-color: var(--base-2); padding: 10px; position: relative; } +.trace-head .trace-class { color: var(--base-6); font-size: 18px; font-weight: bold; line-height: 1.3; margin: 0; position: relative; } .trace-head .trace-namespace { color: #999; display: block; font-size: 13px; } .trace-head .icon { position: absolute; right: 0; top: 0; } .trace-head .icon svg { height: 24px; width: 24px; } -.trace-details { background: #FFF; border: 1px solid #E0E0E0; box-shadow: 0px 0px 1px rgba(128, 128, 128, .2); margin: 1em 0; table-layout: fixed; } +.trace-details { background: var(--base-0); border: var(--border); box-shadow: 0px 0px 1px rgba(128, 128, 128, .2); margin: 1em 0; table-layout: fixed; } .trace-message { font-size: 14px; font-weight: normal; margin: .5em 0 0; } .trace-line { position: relative; padding-top: 8px; padding-bottom: 8px; } -.trace-line + .trace-line { border-top: 1px solid #e0e0e0; } -.trace-line:hover { background: #F5F5F5; } -.trace-line a { color: #222; } +.trace-line + .trace-line { border-top: var(--border); } +.trace-line:hover { background: var(--base-1); } +.trace-line a { color: var(--base-6); } .trace-line .icon { opacity: .4; position: absolute; left: 10px; top: 11px; } .trace-line .icon svg { height: 16px; width: 16px; } .trace-line-header { padding-left: 36px; padding-right: 10px; } -.trace-file-path, .trace-file-path a { color: #222; font-size: 13px; } -.trace-class { color: #B0413E; } +.trace-file-path, .trace-file-path a { color: var(--base-6); font-size: 13px; } +.trace-class { color: var(--color-error); } .trace-type { padding: 0 2px; } -.trace-method { color: #B0413E; font-weight: bold; } +.trace-method { color: var(--color-error); font-weight: bold; } .trace-arguments { color: #777; font-weight: normal; padding-left: 2px; } -.trace-code { background: #FFF; font-size: 12px; margin: 10px 10px 2px 10px; padding: 10px; overflow-x: auto; white-space: nowrap; } +.trace-code { background: var(--base-0); font-size: 12px; margin: 10px 10px 2px 10px; padding: 10px; overflow-x: auto; white-space: nowrap; } .trace-code ol { margin: 0; float: left; } .trace-code li { color: #969896; margin: 0; padding-left: 10px; float: left; width: 100%; } .trace-code li + li { margin-top: 5px; } -.trace-code li.selected { background: #F7E5A1; margin-top: 2px; } -.trace-code li code { color: #222; white-space: nowrap; } +.trace-code li.selected { background: var(--trace-selected-background); margin-top: 2px; } +.trace-code li code { color: var(--base-6); white-space: nowrap; } .trace-as-text .stacktrace { line-height: 1.8; margin: 0 0 15px; white-space: pre-wrap; } diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/exception.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/exception.css.twig index c849cb29666f..78752853b92d 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/exception.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/exception.css.twig @@ -10,8 +10,8 @@ } .exception-summary { - background: #FFF; - border: 1px solid #E0E0E0; + background: var(--base-0); + border: var(--border); box-shadow: 0 0 1px rgba(128, 128, 128, .2); margin: 1em 0; padding: 10px; @@ -21,7 +21,7 @@ } .exception-message { - color: #B0413E; + color: var(--color-error); } .exception-metadata, diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/form.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/form.html.twig index 720da8575052..4ca49e7c5ff9 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/form.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/form.html.twig @@ -131,8 +131,11 @@ .tree .tree-inner:hover { background: #dfdfdf; } + .tree .tree-inner:hover span:not(.has-error) { + color: var(--base-0); + } .tree .tree-inner.active, .tree .tree-inner.active:hover { - background: #E0E0E0; + background: var(--tree-active-background); font-weight: bold; } .tree .tree-inner.active .toggle-icon, .tree .tree-inner:hover .toggle-icon, .tree .tree-inner.active:hover .toggle-icon { @@ -153,7 +156,7 @@ } .badge-error { float: right; - background: #B0413E; + background: var(--background-error); color: #FFF; padding: 1px 4px; font-size: 10px; @@ -161,17 +164,17 @@ vertical-align: middle; } .has-error { - color: #B0413E; + color: var(--color-error); } .errors h3 { - color: #B0413E; + color: var(--color-error); } .errors th { - background: #B0413E; + background: var(--background-error); color: #FFF; } .errors .toggle-icon { - background-color: #B0413E; + background-color: var(--background-error); } h3 a, h3 a:hover, h3 a:focus { color: inherit; @@ -183,6 +186,20 @@ h3.form-data-type + h3 { margin-top: 1em; } + .theme-dark .toggle-icon { + background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAgBAMAAADpp+X/AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAVUExURUdwTH+Ag0lNUZiYmGRmbP///zU5P2n9VV4AAAAFdFJOUwCv+yror0g1sQAAAE1JREFUGNNjSFM0YGBgEEpjSGEAAzcGBQiDiUEAwmBkMIAwmBmwgVAgQGWgA7h2uIFwK+CWwp1BpHtYA6DuATEYkBlY3IOmBq6dCPcAAKMtEEs3tfChAAAAAElFTkSuQmCC'); + } + .theme-dark .toggle-icon.empty { + background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAASUExURUdwTDI3OzQ5PS4uLjU3PzU5P4keoyIAAAAFdFJOUwBApgtzrnKGEwAAADJJREFUCNdjCFU0YGBgEAplCGEAA1cGBQiDiUEAwmBkMIAwmBnIA3DtcAPhVsAthTkDACsZBBmrTTSxAAAAAElFTkSuQmCC'); + } + .theme-dark .tree .tree-inner.active .toggle-icon, .theme-dark .tree .tree-inner:hover .toggle-icon, .theme-dark .tree .tree-inner.active:hover .toggle-icon { + background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAgBAMAAADpp+X/AAAAD1BMVEVHcEx/gIOYmJiZmZn///+IJ2wIAAAAA3RSTlMAryoIUq0uAAAAUElEQVQY02NgYFQ2NjYWYGBgMAYDBgZmCMOAQRjCMGRQhjCMoEqAipAYLkCAykBXA9cONxBuBdxShDOIc4+JM9Q9IIYxMgOLe9DUwLUT4R4AznguG0qfEa0AAAAASUVORK5CYII='); + background-color: transparent; + } + .theme-dark .tree .tree-inner.active .toggle-icon.empty, .theme-dark .tree .tree-inner:hover .toggle-icon.empty, .theme-dark .tree .tree-inner.active:hover .toggle-icon.empty { + background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAACVBMVEVHcEwyNzuqqqrd9nIgAAAAAnRSTlMAQABPjKgAAAArSURBVAjXY2BctcqBgWvVqgUMWqtWrWDIWrVqJcMqICCGACsGawMbADIKANflJYEoGMqtAAAAAElFTkSuQmCC'); + background-color: transparent; + } {% endblock %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/messenger.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/messenger.html.twig index f3e8fecece38..faef05d963df 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/messenger.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/messenger.html.twig @@ -144,7 +144,12 @@ diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/validator.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/validator.html.twig index 615363702626..f1da1f714fb2 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/validator.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/validator.html.twig @@ -59,7 +59,12 @@ diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/profiler.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/profiler.css.twig index 6fdcc77a0ed7..3cd09336221b 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/profiler.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/profiler.css.twig @@ -25,11 +25,20 @@ --metric-unit-color: #999; --metric-label-background: #e0e0e0; --metric-label-color: inherit; + --trace-selected-background: #F7E5A1; --table-border: #e0e0e0; --table-background: #fff; --table-header: #e0e0e0; + --info-background: #ddf; + --tree-active-background: #F7E5A1; + --exception-title-color: var(--base-2); --shadow: 0px 0px 1px rgba(128, 128, 128, .2); --border: 1px solid #e0e0e0; + --background-error: var(--color-error); + --highlight-comment: #969896; + --highlight-default: #222222; + --highlight-keyword: #a71d5d; + --highlight-string: #183691; --base-0: #fff; --base-1: #f5f5f5; --base-2: #e0e0e0; @@ -43,6 +52,7 @@ --page-background: #36393e; --color-text: #e0e0e0; --color-muted: #777; + --color-error: #d43934; --tab-background: #555; --tab-color: #ccc; --tab-active-background: #888; @@ -54,11 +64,20 @@ --metric-unit-color: #999; --metric-label-background: #777; --metric-label-color: #e0e0e0; + --trace-selected-background: #71663a; --table-border: #444; --table-background: #333; --table-header: #555; + --info-background: rgba(79, 148, 195, 0.5); + --tree-active-background: var(--metric-label-background); + --exception-title-color: var(--base-2); --shadow: 0px 0px 1px rgba(32, 32, 32, .2); --border: 1px solid #666; + --background-error: #b0413e; + --highlight-comment: #dedede; + --highlight-default: var(--base-6); + --highlight-keyword: #ff413c; + --highlight-string: #70a6fd; --base-0: #2e3136; --base-1: #444; --base-2: #666; @@ -325,7 +344,7 @@ table tbody td.num-col { } .label.status-success { background: var(--color-success); color: #FFF; } .label.status-warning { background: var(--color-warning); color: #FFF; } -.label.status-error { background: var(--color-error); color: #FFF; } +.label.status-error { background: var(--background-error); color: #FFF; } {# Metrics ------------------------------------------------------------------------- #} @@ -458,9 +477,9 @@ tr.status-warning td { } .highlight .keyword { color: #8959A8; font-weight: bold; } -.highlight .word { color: #222222; } +.highlight .word { color: var(--color-text); } .highlight .variable { color: #916319; } -.highlight .symbol { color: #222222; } +.highlight .symbol { color: var(--color-text); } .highlight .comment { color: #999999; } .highlight .backtick { color: #718C00; } .highlight .string { color: #718C00; } @@ -601,7 +620,7 @@ tr.status-warning td { #summary .status-success { background: var(--color-success); } #summary .status-warning { background: var(--color-warning); } -#summary .status-error { background: var(--color-error); } +#summary .status-error { background: var(--background-error); } #summary .status-success h2, #summary .status-success a, @@ -702,7 +721,7 @@ tr.status-warning td { } #sidebar-search .form-group input { background: #ccc; - border: 1px solid #999; + border: 1px solid var(--color-muted); color: #222; width: 120px; } @@ -815,7 +834,7 @@ tr.status-warning td { background: var(--color-warning); } #menu-profiler .label-status-error .count { - background: var(--color-error); + background: var(--background-error); } {# Timeline panel @@ -905,7 +924,7 @@ tr.status-warning td { margin-top: 0; } .tab-navigation li .badge.status-warning { background: var(--color-warning); color: #FFF; } -.tab-navigation li .badge.status-error { background: var(--color-error); color: #FFF; } +.tab-navigation li .badge.status-error { background: var(--background-error); color: #FFF; } .sf-tabs .tab:not(:first-child) { display: none; } @@ -964,8 +983,8 @@ tr.status-warning td { #twig-dump pre { font-size: 12px; line-height: 1.7; - background-color: #fff; - border: 1px solid #E0E0E0; + background-color: var(--base-0); + border: var(--border); padding: 15px; box-shadow: 0 0 1px rgba(128, 128, 128, .2); } @@ -973,9 +992,10 @@ tr.status-warning td { border-radius: 2px; padding: 1px 2px; } -#twig-dump .status-error { background: transparent; color: #B0413E; } +#twig-dump .status-error { background: transparent; color: var(--color-error); } #twig-dump .status-warning { background: rgba(240, 181, 24, 0.3); } #twig-dump .status-success { background: rgba(100, 189, 99, 0.2); } +#twig-dump .status-info { background: var(--info-background); } #twig-table tbody td { vertical-align: middle; @@ -1060,8 +1080,8 @@ table.logs .metadata { #collector-content .sf-validator .sf-validator-context, #collector-content .sf-validator .trace { - border: 1px solid #DDD; - background: #FFF; + border: var(--border); + background: var(--base-0); padding: 10px; margin: 0.5em 0; overflow: auto; @@ -1118,7 +1138,7 @@ pre.sf-dump, pre.sf-dump .sf-dump-default { } #collector-content .sf-dump pre.sf-dump, #collector-content .sf-dump .trace { - border: 1px solid #DDD; + border: var(--border); padding: 10px; margin: 0.5em 0; overflow: auto;