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
Copy file name to clipboardexpand all lines: content/practices/color-settings/color-settings-practice.html
+72-13
Original file line number
Diff line number
Diff line change
@@ -868,7 +868,7 @@ <h3>Current Color vs. System Colors</h3>
868
868
<p>System colors values should be used when the custom elements are built using elements whose current color does not match the semantics of the custom component and when <code>currentcolor</code> is insufficient for matching the styling needs of the component to make it's features discernible. Using System colors allows for setting both foreground and background colors and making features of the custom control identifiable. For example using <code>div</code> elements to build a custom slider component. If the <code>currentColor</code> value is used the <code>div</code> elements cause the features of the slider to be rendered using the <code>CanvasText</code> color, when the slider features should be rendered using <code>ButtonBorder</code>, <code>ButtonFace</code> and <code>ButtonText</code>. System Colors require using the <code>forced-colors: active</code> media query to ensure the system colors are only used to override the authors theme when the use renables a Contrast Theme.</p>
869
869
870
870
<tableclass="data">
871
-
<caption>Summary of Current Color vs. System Color</caption>
871
+
<caption>Summary of Current Color vs. System Color for Interactive Components</caption>
872
872
<thead>
873
873
<tr>
874
874
<thstyle="width: 7em">Technique</th>
@@ -912,6 +912,58 @@ <h3>Current Color vs. System Colors</h3>
<p>The following tables describe the differences in the two switch examples using Current Color and System Colors.
918
+
919
+
920
+
<tableclass="data">
921
+
<caption>Switch Examples using Current Color and Systems Colors</caption>
922
+
<thead>
923
+
<tr>
924
+
<throwspan="2">Example</th>
925
+
<thcolspan="2">Span</th>
926
+
<thcolspan="2">SVG Rect</th>
927
+
<thcolspan="2">SVG Circle Off</th>
928
+
<thcolspan="2">SVG Circle On</th>
929
+
</tr>
930
+
<tr>
931
+
<th>Background-Color</th>
932
+
<th>Color</th>
933
+
<th>Stroke</th>
934
+
<th>Fill</th>
935
+
<th>Stroke</th>
936
+
<th>Fill</th>
937
+
<th>Stroke</th>
938
+
<th>Fill</th>
939
+
</tr>
940
+
</thead>
941
+
<tbody>
942
+
<tr>
943
+
<td><code>button[role="switch"]</code></td>
944
+
<td>Opacity 0</td>
945
+
<td>CurrentColor</td>
946
+
<td>Opacity 0</td>
947
+
<td>CurrentColor</td>
948
+
<td>CurrentColor</td>
949
+
<td>CurrentColor</td>
950
+
<td>CurrentColor</td>
951
+
<td>CurrentColor</td>
952
+
</tr>
953
+
<tr>
954
+
<td><code>div[role="switch"]</code></td>
955
+
<td>ButtonFace</td>
956
+
<td>ButtonText</td>
957
+
<td>ButtonBorder</td>
958
+
<td>ButtonFace</td>
959
+
<td>ButtonText</td>
960
+
<td>GrayText</td>
961
+
<td>ButtonText</td>
962
+
<td>ActiveText</td>
963
+
</tr>
964
+
</tbody>
965
+
</table>
966
+
915
967
916
968
<h3>Using Current Color</h3>
917
969
@@ -1147,28 +1199,35 @@ <h3 id="using-system-colors">Using System Colors</h3>
1147
1199
</tbody>
1148
1200
</table>
1149
1201
1150
-
<h3id="computed-system-colors">Computed System Colors</h3>
1202
+
<h3id="computed-system-colors">System Color Support</h3>
1151
1203
1152
-
<p>The following table identifies the current system colors defined in <ahref="https://www.w3.org/TR/css-color-4/#css-system-colors">CSS Color Module Level 4</a>. System colors are supported in all major browsers, but the <strong>actual colors</strong> they render may vary between browsers and operating systems based on default and user theme and contrast settings.</p>
1204
+
<p>The following table identifies the current system colors defined in <ahref="https://www.w3.org/TR/css-color-4/#css-system-colors">CSS Color Module Level 4</a>. System colors are supported in all major browsers, but the default <strong>colors</strong> they render may vary between browsers and operating systems. When a user enables Contrast Themes not all system colors change to use one of the colors defined in the theme. The followin table identifies which system colors support a colors in a contrast theme. Fortunately for the supported, the system colors are consistently rendered between browsers.</p>
The system colors <code>AccentColor</code> and <code>AccentColorText</code> are not supported by the Chrome browser and are not included in the preceding table. They should not be used since they will result in unpredictable color contrast.
1170
-
</div>
1171
-
</div>
1224
+
<h3id="system-colors">Supported System Colors in Contrast Themes</h3>
1225
+
1226
+
<p>The following list of colors are considered "safe" to use when a user enables a contrast theme. Safe colors are color that use one of the theme colors.</p>
1227
+
1228
+
<ulid="usable-system-colors">
1229
+
</ul>
1230
+
1172
1231
1173
1232
<h3id="forced-colors-example-switch">System Color Example: Switch using <code>div[role="switch"]</code></h3>
0 commit comments