From 93ee7db9375debbceebc52adeed70899c6f78a2b Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Thu, 17 May 2018 16:30:19 -0700 Subject: [PATCH] fewer magic numbers for the chevrons --- lighthouse-core/report/html/report-styles.css | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/lighthouse-core/report/html/report-styles.css b/lighthouse-core/report/html/report-styles.css index 418862d2f217..23576782f1cb 100644 --- a/lighthouse-core/report/html/report-styles.css +++ b/lighthouse-core/report/html/report-styles.css @@ -65,6 +65,7 @@ --lh-audit-hgap: 12px; --lh-audit-group-vpadding: 8px; --lh-section-vpadding: 12px; + --chevron-size: 12px; --pass-icon-url: url('data:image/svg+xml;utf8,check'); --average-icon-url: url('data:image/svg+xml;utf8,info'); --fail-icon-url: url('data:image/svg+xml;utf8,warn'); @@ -894,39 +895,40 @@ summary.lh-passed-audits-summary { */ .lh-chevron { - width: 12px; - height: 12px; + --chevron-angle: 42deg; + width: var(--chevron-size); + height: var(--chevron-size); margin-top: calc((var(--body-line-height) - 12px) / 2); } .lh-chevron__lines { transition: transform 0.4s; - transform: translateY(20px); + transform: translateY(var(--body-line-height)); } .lh-chevron__line { - stroke: hsl(216, 5%, 39%); - transform-origin: 50px 50px; - stroke-width: 15px; + stroke: var(--display-value-gray); + stroke-width: var(--chevron-size); stroke-linecap: square; + transform-origin: 50%; + transform: rotate(var(--chevron-angle)); transition: transform 300ms, stroke 300ms; - transform: rotate(42deg); } .lh-audit-group > .lh-audit-group__summary > .lh-chevron .lh-chevron__line-right, .lh-audit-group[open] > .lh-audit-group__summary > .lh-chevron .lh-chevron__line-left, .lh-audit > .lh-expandable-details .lh-chevron__line-right, .lh-audit > .lh-expandable-details[open] .lh-chevron__line-left { - transform: rotate(-42deg); + transform: rotate(calc(var(--chevron-angle) * -1)); } .lh-audit-group[open] > .lh-audit-group__summary > .lh-chevron .lh-chevron__line-right, .lh-audit > .lh-expandable-details[open] .lh-chevron__line-right { - transform: rotate(42deg); + transform: rotate(var(--chevron-angle)); } .lh-audit-group[open] > .lh-audit-group__summary > .lh-chevron .lh-chevron__lines, .lh-audit > .lh-expandable-details[open] .lh-chevron__lines { - transform: translateY(-13px); + transform: translateY(calc(var(--chevron-size) * -1)); }