Skip to content

Commit 3c4dcea

Browse files
committed
tweak table header styling
1 parent d4342cb commit 3c4dcea

4 files changed

Lines changed: 34 additions & 16 deletions

File tree

src/Debug/Dump/Html/Table.php

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -198,15 +198,7 @@ protected function buildFooter()
198198
*/
199199
protected function buildHeader()
200200
{
201-
$labels = \array_map(function (array $colInfo) {
202-
$label = $this->dumper->valDumper->dump($colInfo['key'], array(
203-
'tagName' => null,
204-
));
205-
if (!empty($colInfo['class'])) {
206-
$label .= ' ' . $this->dumper->valDumper->markupIdentifier($colInfo['class'], 'className');
207-
}
208-
return $label;
209-
}, $this->options['tableInfo']['columns']);
201+
$labels = \array_map([$this, 'buildHeaderLabel'], $this->options['tableInfo']['columns']);
210202
$keyLabel = $this->options['tableInfo']['commonRowInfo']['keyOutput']
211203
? ($this->options['tableInfo']['indexLabel']
212204
? '<th class="text-right">' . $this->options['tableInfo']['indexLabel'] . '</th>'
@@ -218,11 +210,35 @@ protected function buildHeader()
218210
. ($this->options['tableInfo']['haveObjRow']
219211
? '<th>&nbsp;</th>'
220212
: '')
221-
. '<th scope="col">' . \implode('</th><th scope="col">', $labels) . '</th>'
213+
. \implode('', $labels)
222214
. '</tr>' . "\n"
223215
. '</thead>' . "\n";
224216
}
225217

218+
/**
219+
* Build header label th tag
220+
*
221+
* @param array $colInfo Column information
222+
*
223+
* @return string
224+
*/
225+
protected function buildHeaderLabel($colInfo)
226+
{
227+
$type = $this->debug->abstracter->type->getType($colInfo['key']);
228+
$label = $this->dumper->valDumper->dump($colInfo['key'], array(
229+
'tagName' => null,
230+
));
231+
if (!empty($colInfo['class'])) {
232+
$label .= ' ' . $this->dumper->valDumper->markupIdentifier($colInfo['class'], 'className');
233+
}
234+
return $this->debug->html->buildTag('th', array(
235+
'class' => $type[0] !== 'string'
236+
? 't_' . $type[0]
237+
: null,
238+
'scope' => 'col',
239+
), $label);
240+
}
241+
226242
/**
227243
* Returns table row
228244
*

src/Debug/css/Debug.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Debug/scss/Debug.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
.debug {
1010

1111
--font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
12-
--font-family-numeric: Courier New, monospace, Ariel;
12+
--font-family-numeric: monospace, Arial;
1313
--font-size: 13px;
1414

1515
font-size: var(--font-size);

src/Debug/scss/_tokens.scss

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,18 @@ $color-stringified-shadow: rgba(0, 200, 200, 0.6);
4343
.t_float,
4444
.t_string[data-type-more=numeric],
4545
.t_string[data-type-more=timestamp] {
46-
font-family: var(--font-family-numeric) !important;
4746
color: var(--color-numeric);
48-
font-size: 1.15em;
49-
line-height: 1.15em;
47+
font-family: var(--font-family-numeric) !important;
48+
// font-size: 1.15em;
49+
// line-height: 1.15em;
50+
/*
5051
&::before,
5152
&::after {
52-
// undo font-size increase got
53+
// undo font-size increase
5354
font-family: var(--font-family);
5455
font-size: 0.8695em;
5556
}
57+
*/
5658
}
5759

5860
.t_key {

0 commit comments

Comments
 (0)