Skip to content
This repository was archived by the owner on Oct 17, 2025. It is now read-only.

Commit 728624a

Browse files
authored
CSS live examples: color contrast improvements (#2848)
* css logical-properties: Set fg & bg color For the demonstration elements with background-color: yellow, also set explicit foreground color. Prevents white-on-yellow text, with the dark skin. * css content-visibility: Set fg & bg color For demonstration elements with background-color: set and text content, also set explicit foreground color. * CSS filter example: Add white container element The default filter in the example is a drop-shadow, which will be invisible in dark mode against the default black background. Add an `.example-container` div with background-color set to `#fff`, so that the effect is visible regardless of the selected theme.
1 parent 43afb99 commit 728624a

File tree

8 files changed

+22
-1
lines changed

8 files changed

+22
-1
lines changed

live-examples/css-examples/container/content-visibility.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
.child {
1212
border: 3px solid rgb(64, 28, 163);
1313
background-color: wheat;
14+
color: black;
1415
width: 80%;
1516
height: 80%;
1617
display: flex;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.example-container {
2+
background-color: #fff;
3+
width: 260px;
4+
height: 260px;
5+
display: flex;
6+
align-items: center;
7+
justify-content: center;
8+
}
9+
10+
#example-element {
11+
flex: 1;
12+
padding: 30px;
13+
}

live-examples/css-examples/filter-effects/filter.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444

4545
<div id="output" class="output large hidden">
4646
<section id="default-example">
47-
<img id="example-element" src="../../media/examples/firefox-logo.svg" width="200" />
47+
<div class="example-container">
48+
<img id="example-element" src="../../media/examples/firefox-logo.svg" width="200" />
49+
</div>
4850
</section>
4951
</div>

live-examples/css-examples/filter-effects/meta.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"type": "css"
3333
},
3434
"filter": {
35+
"cssExampleSrc": "./live-examples/css-examples/filter-effects/filter.css",
3536
"exampleCode": "./live-examples/css-examples/filter-effects/filter.html",
3637
"fileName": "filter.html",
3738
"title": "CSS Demo: filter",

live-examples/css-examples/logical-properties/inset-block-end.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#abspos {
1111
background-color: yellow;
12+
color: black;
1213
border: 3px solid red;
1314
position: absolute;
1415
inset-block-end: 20px;

live-examples/css-examples/logical-properties/inset-block-start.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#abspos {
1111
background-color: yellow;
12+
color: black;
1213
border: 3px solid red;
1314
position: absolute;
1415
inset-block-start: 50px;

live-examples/css-examples/logical-properties/inset-inline-end.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#abspos {
1111
background-color: yellow;
12+
color: black;
1213
border: 3px solid red;
1314
position: absolute;
1415
inset-inline-end: 50px;

live-examples/css-examples/logical-properties/inset-inline-start.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#abspos {
1111
background-color: yellow;
12+
color: black;
1213
border: 3px solid red;
1314
position: absolute;
1415
inset-inline-start: 50px;

0 commit comments

Comments
 (0)