Merge pull request #7091 from firefly-iii/dark-mode-arrow

Dark mode arrow
This commit is contained in:
James Cole 2023-02-27 06:04:49 +01:00 committed by GitHub
commit df78aa2f0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -410,13 +410,13 @@ function drawAChart(URL, container, chartType, options, colorData) {
mode: 'vertical',
scaleID: 'x-axis-0',
value: drawVerticalLine,
borderColor: 'red',
borderColor: lineColor,
borderWidth: 1,
label: {
backgroundColor: 'rgba(0,0,0,0)',
fontFamily: "sans-serif",
fontSize: 12,
fontColor: "#333",
fontColor: lineTextColor,
position: "right",
xAdjust: -20,
yAdjust: -125,

View File

@ -169,6 +169,12 @@
{% endblock %}
{% block scripts %}
<script type="text/javascript" nonce="{{ JS_NONCE }}">
var lineColor = 'red';
var lineTextColor = '#000';
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
var lineColor = '#a00';
var lineTextColor = '#bec5cb';
}
var billCount = {{ billCount }};
var accountFrontpageUrl = '{{ route('chart.account.frontpage') }}';
var accountRevenueUrl = '{{ route('chart.account.revenue') }}';