diff --git a/resources/assets/javascripts/bootstrap/application.js b/resources/assets/javascripts/bootstrap/application.js index b7e3854a2c28c63ba6d154daf67db2cb97357e18..994171c093764d0d5e2bc9b2e56a534a3b14d2f5 100644 --- a/resources/assets/javascripts/bootstrap/application.js +++ b/resources/assets/javascripts/bootstrap/application.js @@ -384,33 +384,6 @@ jQuery(document).on('click', 'a[data-behaviour~="ajax-toggle"]', function (event }); }(jQuery)); -// Detect high contrast mode -// https://gist.github.com/ffoodd/78f99204b5806e183574 -$(window).on('load', () => { - function prefersContrast () { - if (window.matchMedia('prefers-contrast: more').matches || window.matchMedia('prefers-contrast: high').matches) { - return true; - } - - const testColor = 'rgb(31,41,59)'; - const testElement = document.createElement('a'); - let strColor; - - testElement.style.color = testColor; - document.documentElement.appendChild(testElement); - strColor = document.defaultView ? document.defaultView.getComputedStyle(testElement, null).color : testElement.currentStyle.color; - strColor = strColor.replace(/ /g, ''); - document.documentElement.removeChild(testElement); - return strColor !== testColor; - } - - document.querySelector('html').classList.toggle( - 'high-contrast-mode-activated', - prefersContrast() - ); -}); - - // Trigger consuming mode on contentbar STUDIP.domReady(function () { $(document).on("click", ".consuming_mode_trigger", function () { diff --git a/resources/vue/components/MyCoursesNavigation.vue b/resources/vue/components/MyCoursesNavigation.vue index 3c899b1022de1486767d8c7419d8671286f44662..48fb23718ccf5472775f1116b628945e8055f7b7 100644 --- a/resources/vue/components/MyCoursesNavigation.vue +++ b/resources/vue/components/MyCoursesNavigation.vue @@ -70,7 +70,7 @@ $icon-padding: 3px; a { padding: $icon-padding - $border-width; } - html.high-contrast-mode-activated & { + @media (prefers-contrast: more) { a { border: 1px dashed mixins.$black; }