You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The {{colorScheme}} attribute is a {{PreferenceObject}} used to override the user's preference for the color scheme of the site.
3262
+
This is modeled after the [[#prefers-color-scheme]].
3263
+
3264
+
<div algorithm='get valid values for colorScheme'>
3265
+
The <dfn>get valid values for colorScheme</dfn> algorithm, when invoked, must run these steps:
3266
+
3267
+
1. Let |validValues| be a new empty [=sequence=].
3268
+
1. Add ''light'' to |validValues|.
3269
+
1. Add ''dark'' to |validValues|.
3270
+
1. Return |validValues|.
3271
+
</div>
3272
+
3273
+
If an override is set for this preference:
3274
+
- The user agent MUST use this override for the [[#prefers-color-scheme]] in all stylesheets applied to an [=origin=] including the UA style sheet.
3275
+
- The user agent MUST also use this override when queried via `matchMedia()` from [[cssom-view#extensions-to-the-window-interface]].
3276
+
- The user agent MUST also use this override when calculating the [=used color scheme=].
3277
+
- The user agent MUST also use this override when sending [[USER-PREFERENCE-MEDIA-FEATURES-HEADERS#sec-ch-prefers-color-scheme]].
3278
+
- The user agent MUST also use this override for any UA features that are normally affected by [[#prefers-color-scheme]].
3279
+
3280
+
<h4 id=auto-pref>
3281
+
{{contrast}} attribute</h4>
3282
+
3283
+
The {{contrast}} attribute is a {{PreferenceObject}} used to override the user's preference for the contrast of the site.
3284
+
This is modeled after the [[#prefers-contrast]].
3285
+
3286
+
<div algorithm='get valid values for contrast'>
3287
+
The <dfn>get valid values for contrast</dfn> algorithm, when invoked, must run these steps:
3288
+
3289
+
1. Let |validValues| be a new empty [=sequence=].
3290
+
1. Add ''@media/prefers-contrast/more'' to |validValues|.
3291
+
1. Add ''@media/prefers-contrast/less'' to |validValues|.
3292
+
1. Add ''@media/prefers-contrast/no-preference'' to |validValues|.
3293
+
1. Return |validValues|.
3294
+
</div>
3295
+
3296
+
If an override is set for this preference:
3297
+
- The user agent MUST use this override for the [[#prefers-contrast]] in all stylesheets applied to an [=origin=] including the UA style sheet.
3298
+
- The user agent MUST also use this override when queried via `matchMedia()` from [[cssom-view#extensions-to-the-window-interface]].
3299
+
- The user agent MUST also use this override when sending [[USER-PREFERENCE-MEDIA-FEATURES-HEADERS#sec-ch-prefers-contrast]].
3300
+
- The user agent MUST also use this override for any UA features that are normally affected by [[#prefers-contrast]].
3301
+
3302
+
Note: Unlike the media feature this preference is NOT able to be set to ''@media/prefers-contrast/custom'' as this is tightly coupled to the [[#forced-colors]].
3303
+
3304
+
<h4 id=auto-pref>
3305
+
{{reducedMotion}} attribute</h4>
3306
+
3307
+
The {{reducedMotion}} attribute is a {{PreferenceObject}} used to override the user's preference for reduced motion on the site.
3308
+
This is modeled after the [[#prefers-reduced-motion]].
3309
+
3310
+
<div algorithm='get valid values for reducedMotion'>
3311
+
The <dfn>get valid values for reducedMotion</dfn> algorithm, when invoked, must run these steps:
3312
+
3313
+
1. Let |validValues| be a new empty [=sequence=].
3314
+
1. Add ''@media/prefers-reduced-motion/reduce'' to |validValues|.
3315
+
1. Add ''@media/prefers-reduced-motion/no-preference'' to |validValues|.
3316
+
1. Return |validValues|.
3317
+
</div>
3318
+
3319
+
If an override is set for this preference:
3320
+
- The user agent MUST use this override for the [[#prefers-reduced-motion]] in all stylesheets applied to an [=origin=] including the UA style sheet.
3321
+
- The user agent MUST also use this override when queried via `matchMedia()` from [[cssom-view#extensions-to-the-window-interface]].
3322
+
- The user agent MUST also use this override when sending [[USER-PREFERENCE-MEDIA-FEATURES-HEADERS#sec-ch-prefers-reduced-motion]].
3323
+
- The user agent MUST also use this override for any UA features that are normally affected by [[#prefers-reduced-motion]].
3324
+
3325
+
Note: An example of a UA feature that is affected by this preference could be disabling smooth scrolling, or pausing marquee elements.
3326
+
3327
+
<h4 id=auto-pref>
3328
+
{{reducedTransparency}} attribute</h4>
3329
+
3330
+
The {{reducedTransparency}} attribute is a {{PreferenceObject}} used to override the user's preference for reduced transparency on the site.
3331
+
This is modeled after the [[#prefers-reduced-transparency]].
3332
+
3333
+
<div algorithm='get valid values for reducedTransparency'>
3334
+
The <dfn>get valid values for reducedTransparency</dfn> algorithm, when invoked, must run these steps:
3335
+
3336
+
1. Let |validValues| be a new empty [=sequence=].
3337
+
1. Add ''@media/prefers-reduced-transparency/reduce'' to |validValues|.
3338
+
1. Add ''@media/prefers-reduced-transparency/no-preference'' to |validValues|.
3339
+
1. Return |validValues|.
3340
+
</div>
3341
+
3342
+
If an override is set for this preference:
3343
+
- The user agent MUST use this override for the [[#prefers-reduced-transparency]] in all stylesheets applied to an [=origin=] including the UA style sheet.
3344
+
- The user agent MUST also use this override when queried via `matchMedia()` from [[cssom-view#extensions-to-the-window-interface]].
3345
+
- The user agent MUST also use this override when sending [[USER-PREFERENCE-MEDIA-FEATURES-HEADERS#sec-ch-prefers-reduced-transparency]].
3346
+
- The user agent MUST also use this override for any UA features that are normally affected by [[#prefers-reduced-transparency]].
3347
+
3348
+
<h4 id=auto-pref>
3349
+
{{reducedData}} attribute</h4>
3350
+
3351
+
The {{reducedData}} attribute is a {{PreferenceObject}} used to override the user's preference for reduced data usage on the site.
3352
+
This is modeled after the [[#prefers-reduced-data]].
3353
+
3354
+
<div algorithm='get valid values for reducedData'>
3355
+
The <dfn>get valid values for reducedData</dfn> algorithm, when invoked, must run these steps:
3356
+
3357
+
1. Let |validValues| be a new empty [=sequence=].
3358
+
1. Add ''@media/prefers-reduced-data/reduce'' to |validValues|.
3359
+
1. Add ''@media/prefers-reduced-data/no-preference'' to |validValues|.
3360
+
1. Return |validValues|.
3361
+
</div>
3362
+
3363
+
If an override is set for this preference:
3364
+
- The user agent MUST use this override for the [[#prefers-reduced-data]] in all stylesheets applied to an [=origin=] including the UA style sheet.
3365
+
- The user agent MUST also use this override when queried via `matchMedia()` from [[cssom-view#extensions-to-the-window-interface]].
3366
+
- The user agent MUST also use this override when sending [[SAVEDATA#save-data-request-header-field]].
3367
+
- The user agent MUST also use this override when calculating the [[SAVEDATA#savedata-attribute]].
3368
+
- The user agent MUST also use this override for any UA features that are normally affected by [[#prefers-reduced-data]].
0 commit comments