xdebug的红色和黄色标准颜色会在几个小时后伤到你的眼睛。如何更改xdebug输出的颜色?
http://www.designified.com/blog/article/76/restyling-xdebug-output描述如何用需要jquery的javascript替换样式。
我正在寻找更直接的方式,最后找到一个。
xdebug的红色和黄色标准颜色会在几个小时后伤到你的眼睛。如何更改xdebug输出的颜色?
http://www.designified.com/blog/article/76/restyling-xdebug-output描述如何用需要jquery的javascript替换样式。
我正在寻找更直接的方式,最后找到一个。
解决方案是!重要标记,它覆盖了现有的样式值。使用下面的CSS代码使用的XDebug时避免眼癌:
.xdebug-error {
font-size: 12px !important;
width: 95% !important;
margin: 0 auto 10px auto !important;
border-color: #666 !important;
background: #ddd !important;
}
.xdebug-error th, .xdebug-error td {
padding: 2px !important;
}
.xdebug-error th {
background: #ccc !important;
}
.xdebug-error span {
display: none !important;
}
.xdebug-error_description th {
font-size: 1.2em !important;
padding: 20px 4px 20px 100px !important;
background: #ccc no-repeat left top !important;
}
.xdebug-error_callStack th {
background: #666 !important;
color: #ddd !important;
}
// notice the line height, the padding(cellspacing), monospace font, font size, making readability better at least for me.
//
// A FILENAME : xdebug_stack_trace.css
//
// This is how the xdebug_stack_trace.css is called from the index.php page
//
// <style><?php require_once("./resources/css/xdebug_stack_trace.css");?></ style>
//
// notice that on the line above there is a space between the slash
// and the 'style', on the ending 'style' tag, otherwise the display
// get all messed up when this page gets loaded.
//
// make sure that when you copy the 'style' line from here to the
// index page, that you remove the extra space at the ending 'style'
// tag of the index page.
// +---------+---------+---------+---------+---------+---------+---------+
// orange/black td header line
// +---------+---------+---------+---------+---------+---------+---------+
.xdebug-error th
{
font-family:monospace;
font-weight:normal;
font-size:15px;
padding: 6px 6px 6px 6px;
border:1px solid black;
background: #FFCC99; // orange
color:#000000; // black
}
// +---------+---------+---------+---------+---------+---------+---------+
// black/white th header line
// +---------+---------+---------+---------+---------+---------+---------+
.xdebug-error > tr:first-child > th:first-child,
.xdebug-error > tbody > tr:first-child > th:first-child
{
line-height:1.6em;
padding: 10px 10px 10px 10px;
border:1px solid #000000;
background: #000000; // black
color:#FFFFFF;
}
// +---------+---------+---------+---------+---------+---------+---------+
// green/black td content one or more lines
// +---------+---------+---------+---------+---------+---------+---------+
.xdebug-error td
{
font-size:14px;
padding: 6px 6px 6px 6px;
border:1px solid green;
background: #D1FFE8; // light green
}
// +---------+---------+---------+---------+---------+---------+---------+
添加一些说明,以便轻松理解您所写的内容 –
另一种选择是从超载的var_dump禁用Xdebug的。 在php.ini [XDebug]
部分添加xdebug.overload_var_dump=0
格式化输出然后由您决定;一种这样的方式可能会打包var_dump
在您自己的调试功能,打印<pre>
标签。
眼癌:) 重写CSS的独特解决方案?不可靠但很容易。也许结合append_file(在Apache)可以是一个全球性的解决方案。谢谢。 – erm3nda
我在哪里放这个CSS代码?在问题中链接到的页面不再存在... – TheStoryCoder
您需要自定义样式,例如通过浏览器中的添加项。例如,我使用Tampermonkey和一个自定义脚本,添加了css规则。看到这个[gist]中的小脚本(https://gist.github.com/bueltge/1a5013d392c4fd864886ccddac5280dd) – bueltge