@@ -14,7 +14,7 @@ import { makeThemeProps, provideTheme } from '@/composables/theme'
1414
1515// Utilities
1616import { computed , Transition } from 'vue'
17- import { clamp , convertToUnit , genericComponent , propsFactory , useRender } from '@/util'
17+ import { clamp , convertToUnit , genericComponent , IN_BROWSER , propsFactory , useRender } from '@/util'
1818
1919type VProgressLinearSlots = {
2020 default : { value : number , buffer : number }
@@ -98,6 +98,7 @@ export const VProgressLinear = genericComponent<VProgressLinearSlots>()({
9898 const normalizedValue = computed ( ( ) => clamp ( parseFloat ( progress . value ) / max . value * 100 , 0 , 100 ) )
9999 const isReversed = computed ( ( ) => isRtl . value !== props . reverse )
100100 const transition = computed ( ( ) => props . indeterminate ? 'fade-transition' : 'slide-x-transition' )
101+ const isForcedColorsModeActive = IN_BROWSER && window . matchMedia ( '(forced-colors: active)' ) . matches
101102
102103 function handleClick ( e : MouseEvent ) {
103104 if ( ! intersectionRef . value ) return
@@ -165,7 +166,7 @@ export const VProgressLinear = genericComponent<VProgressLinearSlots>()({
165166 < div
166167 class = { [
167168 'v-progress-linear__background' ,
168- backgroundColorClasses . value ,
169+ ! isForcedColorsModeActive ? backgroundColorClasses . value : undefined ,
169170 ] }
170171 style = { [
171172 backgroundColorStyles . value ,
@@ -179,7 +180,7 @@ export const VProgressLinear = genericComponent<VProgressLinearSlots>()({
179180 < div
180181 class = { [
181182 'v-progress-linear__buffer' ,
182- bufferColorClasses . value ,
183+ ! isForcedColorsModeActive ? bufferColorClasses . value : undefined ,
183184 ] }
184185 style = { [
185186 bufferColorStyles . value ,
@@ -195,7 +196,7 @@ export const VProgressLinear = genericComponent<VProgressLinearSlots>()({
195196 < div
196197 class = { [
197198 'v-progress-linear__determinate' ,
198- barColorClasses . value ,
199+ ! isForcedColorsModeActive ? barColorClasses . value : undefined ,
199200 ] }
200201 style = { [
201202 barColorStyles . value ,
@@ -210,7 +211,7 @@ export const VProgressLinear = genericComponent<VProgressLinearSlots>()({
210211 class = { [
211212 'v-progress-linear__indeterminate' ,
212213 bar ,
213- barColorClasses . value ,
214+ ! isForcedColorsModeActive ? barColorClasses . value : undefined ,
214215 ] }
215216 style = { barColorStyles . value }
216217 />
0 commit comments